bonnetid-ui 0.0.0 → 0.0.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/App.d.ts +1 -1
- package/dist/app/assets/{index-B8PCs-AY.css → index-BChLUg01.css} +1 -1
- package/dist/app/assets/index-BeH2CXvV.js +1169 -0
- package/dist/app/assets/{index.es-BE6LkVtq.js → index.es-Bwf93iys.js} +6 -6
- package/dist/app/assets/purify.es-CPrKKeqe.js +3 -0
- package/dist/app/index.html +2 -2
- package/dist/app/manifest.webmanifest +1 -1
- package/dist/app/sw.js +1 -1
- package/dist/app/workbox-9c191d2f.js +1 -0
- package/dist/components/lobby1/AnnouncementBar.d.ts +1 -1
- package/dist/components/lobby1/Carousel.d.ts +1 -1
- package/dist/components/lobby1/SmallPrayerTable.d.ts +1 -1
- package/dist/components/lobby2/PrayerBoxes.d.ts +1 -1
- package/dist/components/lobby3/Countdown.d.ts +4 -3
- package/dist/components/lobby3/LobbyTimetable.d.ts +1 -1
- package/dist/components/miscellaneous/ButtonSpin.d.ts +1 -1
- package/dist/components/miscellaneous/DownloadModal.d.ts +1 -1
- package/dist/components/miscellaneous/ErrorFallback.d.ts +2 -2
- package/dist/components/miscellaneous/Spin.d.ts +1 -1
- package/dist/components/ph1/Instruction.d.ts +1 -1
- package/dist/components/ph1/MasjidLogo.d.ts +1 -1
- package/dist/components/ph1/MasjidPrayerClock.d.ts +5 -3
- package/dist/components/ph1/PrayerClockPH1.d.ts +2 -1
- package/dist/components/ph1/TimeTablePH1.d.ts +1 -1
- package/dist/components/ph2/PrayerTimeBox.d.ts +1 -1
- package/dist/components/ph3/CountdownVisual.d.ts +4 -3
- package/dist/components/ph3/DateInfo.d.ts +1 -1
- package/dist/components/ph3/DigitalClock.d.ts +1 -1
- package/dist/components/ud/DateSelector.d.ts +1 -1
- package/dist/components/ud/Header.d.ts +2 -1
- package/dist/components/ud/HijriCalendar.d.ts +1 -1
- package/dist/components/ud/MasjidSelect.d.ts +1 -1
- package/dist/components/ud/PrayerTimetable.d.ts +1 -1
- package/dist/components/ud/Time.d.ts +1 -1
- package/dist/config/arabic-prayer-names.d.ts +3 -0
- package/dist/config/instruction-show-seconds.d.ts +1 -0
- package/dist/config/iqamah-window-duration.d.ts +1 -0
- package/dist/context/GlobalLanguageProvider.d.ts +1 -0
- package/dist/context/MosqueLanguageContext.d.ts +11 -0
- package/dist/context/ThemeContext.d.ts +1 -1
- package/dist/context/UDContext.d.ts +3 -1
- package/dist/context/UDProviderWrapper.d.ts +1 -1
- package/dist/database-services/MasjidService.d.ts +1 -1
- package/dist/database-services/PrayerTimesService.d.ts +3 -1
- package/dist/hooks/useIqamahCheck.d.ts +2 -1
- package/dist/hooks/useMasjidInfo.d.ts +2 -0
- package/dist/hooks/usePrayerTimes.d.ts +2 -1
- package/dist/hooks/usePrayerTimesUD.d.ts +4 -2
- package/dist/index.d.ts +1 -25
- package/dist/layout-components/lobby1/AnnouncementPart.d.ts +4 -3
- package/dist/layout-components/lobby1/ClockAndTime.d.ts +4 -3
- package/dist/layout-components/lobby1/TablePart.d.ts +4 -3
- package/dist/layout-components/lobby2/PrayerPart.d.ts +4 -3
- package/dist/layout-components/lobby3/TimePart.d.ts +1 -1
- package/dist/layout-components/ph1/ClockPart.d.ts +5 -3
- package/dist/layout-components/ph1/TimeTablePart.d.ts +1 -1
- package/dist/layout-components/ph2/ClockAndPrayers.d.ts +4 -3
- package/dist/layout-components/ph2/CountdownBox.d.ts +4 -3
- package/dist/layout-components/ph2/ExtraInfo.d.ts +1 -1
- package/dist/layout-components/ph2/TimeAndDate.d.ts +1 -1
- package/dist/layout-components/ph3/DigitalClockPart.d.ts +5 -4
- package/dist/layout-components/ph3/TimeTable.d.ts +1 -1
- package/dist/lib/index.css +1 -1
- package/dist/lib/manifest.webmanifest +1 -0
- package/dist/lib/my-ui-library.es.js +24208 -39
- package/dist/lib/my-ui-library.umd.js +53 -324
- package/dist/lib/registerSW.js +1 -0
- package/dist/lib/sw.js +1 -0
- package/dist/lib/workbox-9c191d2f.js +1 -0
- package/dist/pages/IqamahScreen.d.ts +1 -1
- package/dist/pages/Lobby1.d.ts +1 -1
- package/dist/pages/Lobby2.d.ts +1 -1
- package/dist/pages/Lobby3.d.ts +1 -1
- package/dist/pages/NotFound.d.ts +1 -1
- package/dist/pages/PH1.d.ts +1 -1
- package/dist/pages/PH2.d.ts +1 -1
- package/dist/pages/PH3.d.ts +4 -1
- package/dist/pages/ud/DownloadTimetable.d.ts +1 -1
- package/dist/pages/ud/Events.d.ts +1 -1
- package/dist/pages/ud/UD1.d.ts +1 -1
- package/dist/pages/ud/UD2.d.ts +1 -1
- package/dist/pages/ud/UD3.d.ts +1 -1
- package/dist/pages/ud/ViewTimetable.d.ts +1 -1
- package/dist/renderer/lobby/LobbyLayoutRenderer.d.ts +2 -1
- package/dist/renderer/lobby/LobbyRenderer.d.ts +1 -1
- package/dist/renderer/prayer-hall/PrayerHallLayoutRenderer.d.ts +2 -1
- package/dist/renderer/prayer-hall/PrayerHallRenderer.d.ts +1 -1
- package/dist/renderer/user-display/UDLayoutRenderer.d.ts +2 -1
- package/dist/renderer/user-display/UDRenderer.d.ts +1 -1
- package/dist/routes/AppRoutes.d.ts +1 -1
- package/dist/types/types.d.ts +6 -0
- package/dist/utils/CustomInput.d.ts +1 -1
- package/dist/utils/countdown.d.ts +8 -2
- package/dist/utils/idb/prayerTimesDB.d.ts +2 -1
- package/dist/utils/idb/udPrayerTimesDB.d.ts +2 -1
- package/dist/utils/prayertimeHelpers.d.ts +4 -0
- package/dist/utils/timeHelpers.d.ts +2 -0
- package/package.json +3 -1
- package/dist/app/assets/index-CQIIfC-Z.js +0 -345
- package/dist/app/assets/purify.es-B9ZVCkUG.js +0 -2
- package/dist/app/workbox-1ef09536.js +0 -1
- package/dist/lib/html2canvas.esm-dgT_1dIT.js +0 -4871
- package/dist/lib/index-BL2PYeMT.js +0 -32882
- package/dist/lib/index.es-DFW-PnlO.js +0 -6656
- package/dist/lib/purify.es-BpFm6ZGf.js +0 -553
|
@@ -0,0 +1,1169 @@
|
|
|
1
|
+
var cN=Object.defineProperty;var fN=(t,e,n)=>e in t?cN(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var rr=(t,e,n)=>fN(t,typeof e!="symbol"?e+"":e,n);function hN(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in t)){const s=Object.getOwnPropertyDescriptor(r,a);s&&Object.defineProperty(t,a,s.get?s:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var Mq=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function yg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var a1={exports:{}},kh={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var T5;function dN(){if(T5)return kh;T5=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,a,s){var l=null;if(s!==void 0&&(l=""+s),a.key!==void 0&&(l=""+a.key),"key"in a){s={};for(var u in a)u!=="key"&&(s[u]=a[u])}else s=a;return a=s.ref,{$$typeof:t,type:r,key:l,ref:a!==void 0?a:null,props:s}}return kh.Fragment=e,kh.jsx=n,kh.jsxs=n,kh}var L5;function pN(){return L5||(L5=1,a1.exports=dN()),a1.exports}var E=pN(),i1={exports:{}},ln={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var j5;function mN(){if(j5)return ln;j5=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function g(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,N={};function A(U,O,V){this.props=U,this.context=O,this.refs=N,this.updater=V||x}A.prototype.isReactComponent={},A.prototype.setState=function(U,O){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,U,O,"setState")},A.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function j(){}j.prototype=A.prototype;function L(U,O,V){this.props=U,this.context=O,this.refs=N,this.updater=V||x}var R=L.prototype=new j;R.constructor=L,_(R,A.prototype),R.isPureReactComponent=!0;var I=Array.isArray;function ee(){}var G={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function B(U,O,V){var Z=V.ref;return{$$typeof:t,type:U,key:O,ref:Z!==void 0?Z:null,props:V}}function X(U,O){return B(U.type,O,U.props)}function F(U){return typeof U=="object"&&U!==null&&U.$$typeof===t}function $(U){var O={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(V){return O[V]})}var K=/\/+/g;function Y(U,O){return typeof U=="object"&&U!==null&&U.key!=null?$(""+U.key):O.toString(36)}function he(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(ee,ee):(U.status="pending",U.then(function(O){U.status==="pending"&&(U.status="fulfilled",U.value=O)},function(O){U.status==="pending"&&(U.status="rejected",U.reason=O)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function te(U,O,V,Z,ie){var z=typeof U;(z==="undefined"||z==="boolean")&&(U=null);var se=!1;if(U===null)se=!0;else switch(z){case"bigint":case"string":case"number":se=!0;break;case"object":switch(U.$$typeof){case t:case e:se=!0;break;case d:return se=U._init,te(se(U._payload),O,V,Z,ie)}}if(se)return ie=ie(U),se=Z===""?"."+Y(U,0):Z,I(ie)?(V="",se!=null&&(V=se.replace(K,"$&/")+"/"),te(ie,O,V,"",function(Re){return Re})):ie!=null&&(F(ie)&&(ie=X(ie,V+(ie.key==null||U&&U.key===ie.key?"":(""+ie.key).replace(K,"$&/")+"/")+se)),O.push(ie)),1;se=0;var ge=Z===""?".":Z+":";if(I(U))for(var xe=0;xe<U.length;xe++)Z=U[xe],z=ge+Y(Z,xe),se+=te(Z,O,V,z,ie);else if(xe=g(U),typeof xe=="function")for(U=xe.call(U),xe=0;!(Z=U.next()).done;)Z=Z.value,z=ge+Y(Z,xe++),se+=te(Z,O,V,z,ie);else if(z==="object"){if(typeof U.then=="function")return te(he(U),O,V,Z,ie);throw O=String(U),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return se}function oe(U,O,V){if(U==null)return U;var Z=[],ie=0;return te(U,Z,"","",function(z){return O.call(V,z,ie++)}),Z}function le(U){if(U._status===-1){var O=U._result;O=O(),O.then(function(V){(U._status===0||U._status===-1)&&(U._status=1,U._result=V)},function(V){(U._status===0||U._status===-1)&&(U._status=2,U._result=V)}),U._status===-1&&(U._status=0,U._result=O)}if(U._status===1)return U._result.default;throw U._result}var pe=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},Ne={map:oe,forEach:function(U,O,V){oe(U,function(){O.apply(this,arguments)},V)},count:function(U){var O=0;return oe(U,function(){O++}),O},toArray:function(U){return oe(U,function(O){return O})||[]},only:function(U){if(!F(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return ln.Activity=m,ln.Children=Ne,ln.Component=A,ln.Fragment=n,ln.Profiler=a,ln.PureComponent=L,ln.StrictMode=r,ln.Suspense=c,ln.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,ln.__COMPILER_RUNTIME={__proto__:null,c:function(U){return G.H.useMemoCache(U)}},ln.cache=function(U){return function(){return U.apply(null,arguments)}},ln.cacheSignal=function(){return null},ln.cloneElement=function(U,O,V){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var Z=_({},U.props),ie=U.key;if(O!=null)for(z in O.key!==void 0&&(ie=""+O.key),O)!P.call(O,z)||z==="key"||z==="__self"||z==="__source"||z==="ref"&&O.ref===void 0||(Z[z]=O[z]);var z=arguments.length-2;if(z===1)Z.children=V;else if(1<z){for(var se=Array(z),ge=0;ge<z;ge++)se[ge]=arguments[ge+2];Z.children=se}return B(U.type,ie,Z)},ln.createContext=function(U){return U={$$typeof:l,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:s,_context:U},U},ln.createElement=function(U,O,V){var Z,ie={},z=null;if(O!=null)for(Z in O.key!==void 0&&(z=""+O.key),O)P.call(O,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ie[Z]=O[Z]);var se=arguments.length-2;if(se===1)ie.children=V;else if(1<se){for(var ge=Array(se),xe=0;xe<se;xe++)ge[xe]=arguments[xe+2];ie.children=ge}if(U&&U.defaultProps)for(Z in se=U.defaultProps,se)ie[Z]===void 0&&(ie[Z]=se[Z]);return B(U,z,ie)},ln.createRef=function(){return{current:null}},ln.forwardRef=function(U){return{$$typeof:u,render:U}},ln.isValidElement=F,ln.lazy=function(U){return{$$typeof:d,_payload:{_status:-1,_result:U},_init:le}},ln.memo=function(U,O){return{$$typeof:h,type:U,compare:O===void 0?null:O}},ln.startTransition=function(U){var O=G.T,V={};G.T=V;try{var Z=U(),ie=G.S;ie!==null&&ie(V,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(ee,pe)}catch(z){pe(z)}finally{O!==null&&V.types!==null&&(O.types=V.types),G.T=O}},ln.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},ln.use=function(U){return G.H.use(U)},ln.useActionState=function(U,O,V){return G.H.useActionState(U,O,V)},ln.useCallback=function(U,O){return G.H.useCallback(U,O)},ln.useContext=function(U){return G.H.useContext(U)},ln.useDebugValue=function(){},ln.useDeferredValue=function(U,O){return G.H.useDeferredValue(U,O)},ln.useEffect=function(U,O){return G.H.useEffect(U,O)},ln.useEffectEvent=function(U){return G.H.useEffectEvent(U)},ln.useId=function(){return G.H.useId()},ln.useImperativeHandle=function(U,O,V){return G.H.useImperativeHandle(U,O,V)},ln.useInsertionEffect=function(U,O){return G.H.useInsertionEffect(U,O)},ln.useLayoutEffect=function(U,O){return G.H.useLayoutEffect(U,O)},ln.useMemo=function(U,O){return G.H.useMemo(U,O)},ln.useOptimistic=function(U,O){return G.H.useOptimistic(U,O)},ln.useReducer=function(U,O,V){return G.H.useReducer(U,O,V)},ln.useRef=function(U){return G.H.useRef(U)},ln.useState=function(U){return G.H.useState(U)},ln.useSyncExternalStore=function(U,O,V){return G.H.useSyncExternalStore(U,O,V)},ln.useTransition=function(){return G.H.useTransition()},ln.version="19.2.7",ln}var O5;function Ty(){return O5||(O5=1,i1.exports=mN()),i1.exports}var D=Ty();const vn=yg(D),Sv=hN({__proto__:null,default:vn},[D]);var s1={exports:{}},Dh={},o1={exports:{}},l1={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var R5;function gN(){return R5||(R5=1,(function(t){function e(te,oe){var le=te.length;te.push(oe);e:for(;0<le;){var pe=le-1>>>1,Ne=te[pe];if(0<a(Ne,oe))te[pe]=oe,te[le]=Ne,le=pe;else break e}}function n(te){return te.length===0?null:te[0]}function r(te){if(te.length===0)return null;var oe=te[0],le=te.pop();if(le!==oe){te[0]=le;e:for(var pe=0,Ne=te.length,U=Ne>>>1;pe<U;){var O=2*(pe+1)-1,V=te[O],Z=O+1,ie=te[Z];if(0>a(V,le))Z<Ne&&0>a(ie,V)?(te[pe]=ie,te[Z]=le,pe=Z):(te[pe]=V,te[O]=le,pe=O);else if(Z<Ne&&0>a(ie,le))te[pe]=ie,te[Z]=le,pe=Z;else break e}}return oe}function a(te,oe){var le=te.sortIndex-oe.sortIndex;return le!==0?le:te.id-oe.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();t.unstable_now=function(){return l.now()-u}}var c=[],h=[],d=1,m=null,y=3,g=!1,x=!1,_=!1,N=!1,A=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function R(te){for(var oe=n(h);oe!==null;){if(oe.callback===null)r(h);else if(oe.startTime<=te)r(h),oe.sortIndex=oe.expirationTime,e(c,oe);else break;oe=n(h)}}function I(te){if(_=!1,R(te),!x)if(n(c)!==null)x=!0,ee||(ee=!0,$());else{var oe=n(h);oe!==null&&he(I,oe.startTime-te)}}var ee=!1,G=-1,P=5,B=-1;function X(){return N?!0:!(t.unstable_now()-B<P)}function F(){if(N=!1,ee){var te=t.unstable_now();B=te;var oe=!0;try{e:{x=!1,_&&(_=!1,j(G),G=-1),g=!0;var le=y;try{t:{for(R(te),m=n(c);m!==null&&!(m.expirationTime>te&&X());){var pe=m.callback;if(typeof pe=="function"){m.callback=null,y=m.priorityLevel;var Ne=pe(m.expirationTime<=te);if(te=t.unstable_now(),typeof Ne=="function"){m.callback=Ne,R(te),oe=!0;break t}m===n(c)&&r(c),R(te)}else r(c);m=n(c)}if(m!==null)oe=!0;else{var U=n(h);U!==null&&he(I,U.startTime-te),oe=!1}}break e}finally{m=null,y=le,g=!1}oe=void 0}}finally{oe?$():ee=!1}}}var $;if(typeof L=="function")$=function(){L(F)};else if(typeof MessageChannel<"u"){var K=new MessageChannel,Y=K.port2;K.port1.onmessage=F,$=function(){Y.postMessage(null)}}else $=function(){A(F,0)};function he(te,oe){G=A(function(){te(t.unstable_now())},oe)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(te){te.callback=null},t.unstable_forceFrameRate=function(te){0>te||125<te?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<te?Math.floor(1e3/te):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(te){switch(y){case 1:case 2:case 3:var oe=3;break;default:oe=y}var le=y;y=oe;try{return te()}finally{y=le}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(te,oe){switch(te){case 1:case 2:case 3:case 4:case 5:break;default:te=3}var le=y;y=te;try{return oe()}finally{y=le}},t.unstable_scheduleCallback=function(te,oe,le){var pe=t.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?pe+le:pe):le=pe,te){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=le+Ne,te={id:d++,callback:oe,priorityLevel:te,startTime:le,expirationTime:Ne,sortIndex:-1},le>pe?(te.sortIndex=le,e(h,te),n(c)===null&&te===n(h)&&(_?(j(G),G=-1):_=!0,he(I,le-pe))):(te.sortIndex=Ne,e(c,te),x||g||(x=!0,ee||(ee=!0,$()))),te},t.unstable_shouldYield=X,t.unstable_wrapCallback=function(te){var oe=y;return function(){var le=y;y=oe;try{return te.apply(this,arguments)}finally{y=le}}}})(l1)),l1}var k5;function vN(){return k5||(k5=1,o1.exports=gN()),o1.exports}var u1={exports:{}},ni={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var D5;function yN(){if(D5)return ni;D5=1;var t=Ty();function e(c){var h="https://react.dev/errors/"+c;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)h+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(c,h,d){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:c,containerInfo:h,implementation:d}}var l=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(c,h){if(c==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return ni.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ni.createPortal=function(c,h){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return s(c,h,null,d)},ni.flushSync=function(c){var h=l.T,d=r.p;try{if(l.T=null,r.p=2,c)return c()}finally{l.T=h,r.p=d,r.d.f()}},ni.preconnect=function(c,h){typeof c=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(c,h))},ni.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},ni.preinit=function(c,h){if(typeof c=="string"&&h&&typeof h.as=="string"){var d=h.as,m=u(d,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,g=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;d==="style"?r.d.S(c,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:g}):d==="script"&&r.d.X(c,{crossOrigin:m,integrity:y,fetchPriority:g,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ni.preinitModule=function(c,h){if(typeof c=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var d=u(h.as,h.crossOrigin);r.d.M(c,{crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(c)},ni.preload=function(c,h){if(typeof c=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var d=h.as,m=u(d,h.crossOrigin);r.d.L(c,d,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},ni.preloadModule=function(c,h){if(typeof c=="string")if(h){var d=u(h.as,h.crossOrigin);r.d.m(c,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:d,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(c)},ni.requestFormReset=function(c){r.d.r(c)},ni.unstable_batchedUpdates=function(c,h){return c(h)},ni.useFormState=function(c,h,d){return l.H.useFormState(c,h,d)},ni.useFormStatus=function(){return l.H.useHostTransitionStatus()},ni.version="19.2.7",ni}var P5;function X_(){if(P5)return u1.exports;P5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),u1.exports=yN(),u1.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var M5;function bN(){if(M5)return Dh;M5=1;var t=vN(),e=Ty(),n=X_();function r(i){var o="https://react.dev/errors/"+i;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)o+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+i+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function s(i){var o=i,f=i;if(i.alternate)for(;o.return;)o=o.return;else{i=o;do o=i,(o.flags&4098)!==0&&(f=o.return),i=o.return;while(i)}return o.tag===3?f:null}function l(i){if(i.tag===13){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function u(i){if(i.tag===31){var o=i.memoizedState;if(o===null&&(i=i.alternate,i!==null&&(o=i.memoizedState)),o!==null)return o.dehydrated}return null}function c(i){if(s(i)!==i)throw Error(r(188))}function h(i){var o=i.alternate;if(!o){if(o=s(i),o===null)throw Error(r(188));return o!==i?null:i}for(var f=i,p=o;;){var b=f.return;if(b===null)break;var S=b.alternate;if(S===null){if(p=b.return,p!==null){f=p;continue}break}if(b.child===S.child){for(S=b.child;S;){if(S===f)return c(b),i;if(S===p)return c(b),o;S=S.sibling}throw Error(r(188))}if(f.return!==p.return)f=b,p=S;else{for(var M=!1,Q=b.child;Q;){if(Q===f){M=!0,f=b,p=S;break}if(Q===p){M=!0,p=b,f=S;break}Q=Q.sibling}if(!M){for(Q=S.child;Q;){if(Q===f){M=!0,f=S,p=b;break}if(Q===p){M=!0,p=S,f=b;break}Q=Q.sibling}if(!M)throw Error(r(189))}}if(f.alternate!==p)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?i:o}function d(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i;for(i=i.child;i!==null;){if(o=d(i),o!==null)return o;i=i.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),L=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function $(i){return i===null||typeof i!="object"?null:(i=F&&i[F]||i["@@iterator"],typeof i=="function"?i:null)}var K=Symbol.for("react.client.reference");function Y(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===K?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case _:return"Fragment";case A:return"Profiler";case N:return"StrictMode";case I:return"Suspense";case ee:return"SuspenseList";case B:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case L:return i.displayName||"Context";case j:return(i._context.displayName||"Context")+".Consumer";case R:var o=i.render;return i=i.displayName,i||(i=o.displayName||o.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case G:return o=i.displayName||null,o!==null?o:Y(i.type)||"Memo";case P:o=i._payload,i=i._init;try{return Y(i(o))}catch{}}return null}var he=Array.isArray,te=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},pe=[],Ne=-1;function U(i){return{current:i}}function O(i){0>Ne||(i.current=pe[Ne],pe[Ne]=null,Ne--)}function V(i,o){Ne++,pe[Ne]=i.current,i.current=o}var Z=U(null),ie=U(null),z=U(null),se=U(null);function ge(i,o){switch(V(z,o),V(ie,i),V(Z,null),o.nodeType){case 9:case 11:i=(i=o.documentElement)&&(i=i.namespaceURI)?Xb(i):0;break;default:if(i=o.tagName,o=o.namespaceURI)o=Xb(o),i=Zb(o,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}O(Z),V(Z,i)}function xe(){O(Z),O(ie),O(z)}function Re(i){i.memoizedState!==null&&V(se,i);var o=Z.current,f=Zb(o,i.type);o!==f&&(V(ie,i),V(Z,f))}function De(i){ie.current===i&&(O(Z),O(ie)),se.current===i&&(O(se),Lh._currentValue=le)}var qe,Pe;function Ke(i){if(qe===void 0)try{throw Error()}catch(f){var o=f.stack.trim().match(/\n( *(at )?)/);qe=o&&o[1]||"",Pe=-1<f.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+qe+i+Pe}var ne=!1;function We(i,o){if(!i||ne)return"";ne=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(o){var Ge=function(){throw Error()};if(Object.defineProperty(Ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ge,[])}catch(Me){var ke=Me}Reflect.construct(i,[],Ge)}else{try{Ge.call()}catch(Me){ke=Me}i.call(Ge.prototype)}}else{try{throw Error()}catch(Me){ke=Me}(Ge=i())&&typeof Ge.catch=="function"&&Ge.catch(function(){})}}catch(Me){if(Me&&ke&&typeof Me.stack=="string")return[Me.stack,ke.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=p.DetermineComponentFrameRoot(),M=S[0],Q=S[1];if(M&&Q){var me=M.split(`
|
|
44
|
+
`),Oe=Q.split(`
|
|
45
|
+
`);for(b=p=0;p<me.length&&!me[p].includes("DetermineComponentFrameRoot");)p++;for(;b<Oe.length&&!Oe[b].includes("DetermineComponentFrameRoot");)b++;if(p===me.length||b===Oe.length)for(p=me.length-1,b=Oe.length-1;1<=p&&0<=b&&me[p]!==Oe[b];)b--;for(;1<=p&&0<=b;p--,b--)if(me[p]!==Oe[b]){if(p!==1||b!==1)do if(p--,b--,0>b||me[p]!==Oe[b]){var $e=`
|
|
46
|
+
`+me[p].replace(" at new "," at ");return i.displayName&&$e.includes("<anonymous>")&&($e=$e.replace("<anonymous>",i.displayName)),$e}while(1<=p&&0<=b);break}}}finally{ne=!1,Error.prepareStackTrace=f}return(f=i?i.displayName||i.name:"")?Ke(f):""}function it(i,o){switch(i.tag){case 26:case 27:case 5:return Ke(i.type);case 16:return Ke("Lazy");case 13:return i.child!==o&&o!==null?Ke("Suspense Fallback"):Ke("Suspense");case 19:return Ke("SuspenseList");case 0:case 15:return We(i.type,!1);case 11:return We(i.type.render,!1);case 1:return We(i.type,!0);case 31:return Ke("Activity");default:return""}}function tt(i){try{var o="",f=null;do o+=it(i,f),f=i,i=i.return;while(i);return o}catch(p){return`
|
|
47
|
+
Error generating stack: `+p.message+`
|
|
48
|
+
`+p.stack}}var Ve=Object.prototype.hasOwnProperty,gt=t.unstable_scheduleCallback,ut=t.unstable_cancelCallback,Ot=t.unstable_shouldYield,Ct=t.unstable_requestPaint,en=t.unstable_now,tn=t.unstable_getCurrentPriorityLevel,Bt=t.unstable_ImmediatePriority,pn=t.unstable_UserBlockingPriority,an=t.unstable_NormalPriority,lt=t.unstable_LowPriority,kt=t.unstable_IdlePriority,Et=t.log,gr=t.unstable_setDisableYieldValue,fn=null,Dt=null;function Tt(i){if(typeof Et=="function"&&gr(i),Dt&&typeof Dt.setStrictMode=="function")try{Dt.setStrictMode(fn,i)}catch{}}var mn=Math.clz32?Math.clz32:Ut,Lt=Math.log,Hn=Math.LN2;function Ut(i){return i>>>=0,i===0?32:31-(Lt(i)/Hn|0)|0}var qt=256,kn=262144,nn=4194304;function _t(i){var o=i&42;if(o!==0)return o;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Sn(i,o,f){var p=i.pendingLanes;if(p===0)return 0;var b=0,S=i.suspendedLanes,M=i.pingedLanes;i=i.warmLanes;var Q=p&134217727;return Q!==0?(p=Q&~S,p!==0?b=_t(p):(M&=Q,M!==0?b=_t(M):f||(f=Q&~i,f!==0&&(b=_t(f))))):(Q=p&~S,Q!==0?b=_t(Q):M!==0?b=_t(M):f||(f=p&~i,f!==0&&(b=_t(f)))),b===0?0:o!==0&&o!==b&&(o&S)===0&&(S=b&-b,f=o&-o,S>=f||S===32&&(f&4194048)!==0)?o:b}function Xa(i,o){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&o)===0}function sa(i,o){switch(i){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ci(){var i=nn;return nn<<=1,(nn&62914560)===0&&(nn=4194304),i}function ma(i){for(var o=[],f=0;31>f;f++)o.push(i);return o}function At(i,o){i.pendingLanes|=o,o!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function yi(i,o,f,p,b,S){var M=i.pendingLanes;i.pendingLanes=f,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=f,i.entangledLanes&=f,i.errorRecoveryDisabledLanes&=f,i.shellSuspendCounter=0;var Q=i.entanglements,me=i.expirationTimes,Oe=i.hiddenUpdates;for(f=M&~f;0<f;){var $e=31-mn(f),Ge=1<<$e;Q[$e]=0,me[$e]=-1;var ke=Oe[$e];if(ke!==null)for(Oe[$e]=null,$e=0;$e<ke.length;$e++){var Me=ke[$e];Me!==null&&(Me.lane&=-536870913)}f&=~Ge}p!==0&&bi(i,p,0),S!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=S&~(M&~o))}function bi(i,o,f){i.pendingLanes|=o,i.suspendedLanes&=~o;var p=31-mn(o);i.entangledLanes|=o,i.entanglements[p]=i.entanglements[p]|1073741824|f&261930}function Ba(i,o){var f=i.entangledLanes|=o;for(i=i.entanglements;f;){var p=31-mn(f),b=1<<p;b&o|i[p]&o&&(i[p]|=o),f&=~b}}function de(i,o){var f=o&-o;return f=(f&42)!==0?1:ve(f),(f&(i.suspendedLanes|o))!==0?0:f}function ve(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Ee(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Be(){var i=oe.p;return i!==0?i:(i=window.event,i===void 0?32:x5(i.type))}function Je(i,o){var f=oe.p;try{return oe.p=i,o()}finally{oe.p=f}}var at=Math.random().toString(36).slice(2),et="__reactFiber$"+at,ct="__reactProps$"+at,Qe="__reactContainer$"+at,st="__reactEvents$"+at,St="__reactListeners$"+at,Ht="__reactHandles$"+at,dt="__reactResources$"+at,Yt="__reactMarker$"+at;function bn(i){delete i[et],delete i[ct],delete i[st],delete i[St],delete i[Ht]}function Bn(i){var o=i[et];if(o)return o;for(var f=i.parentNode;f;){if(o=f[Qe]||f[et]){if(f=o.alternate,o.child!==null||f!==null&&f.child!==null)for(i=i5(i);i!==null;){if(f=i[et])return f;i=i5(i)}return o}i=f,f=i.parentNode}return null}function _n(i){if(i=i[et]||i[Qe]){var o=i.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return i}return null}function En(i){var o=i.tag;if(o===5||o===26||o===27||o===6)return i.stateNode;throw Error(r(33))}function lr(i){var o=i[dt];return o||(o=i[dt]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function wn(i){i[Yt]=!0}var zi=new Set,Nr={};function oa(i,o){la(i,o),la(i+"Capture",o)}function la(i,o){for(Nr[i]=o,i=0;i<o.length;i++)zi.add(o[i])}var Ca=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Ns={},Za={};function Cs(i){return Ve.call(Za,i)?!0:Ve.call(Ns,i)?!1:Ca.test(i)?Za[i]=!0:(Ns[i]=!0,!1)}function ua(i,o,f){if(Cs(o))if(f===null)i.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":i.removeAttribute(o);return;case"boolean":var p=o.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(o);return}}i.setAttribute(o,""+f)}}function Qa(i,o,f){if(f===null)i.removeAttribute(o);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttribute(o,""+f)}}function Kt(i,o,f,p){if(p===null)i.removeAttribute(f);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(f);return}i.setAttributeNS(o,f,""+p)}}function Jt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ta(i){var o=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Fr(i,o,f){var p=Object.getOwnPropertyDescriptor(i.constructor.prototype,o);if(!i.hasOwnProperty(o)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,S=p.set;return Object.defineProperty(i,o,{configurable:!0,get:function(){return b.call(this)},set:function(M){f=""+M,S.call(this,M)}}),Object.defineProperty(i,o,{enumerable:p.enumerable}),{getValue:function(){return f},setValue:function(M){f=""+M},stopTracking:function(){i._valueTracker=null,delete i[o]}}}}function qi(i){if(!i._valueTracker){var o=Ta(i)?"checked":"value";i._valueTracker=Fr(i,o,""+i[o])}}function us(i){if(!i)return!1;var o=i._valueTracker;if(!o)return!0;var f=o.getValue(),p="";return i&&(p=Ta(i)?i.checked?"true":"false":i.value),i=p,i!==f?(o.setValue(i),!0):!1}function hn(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var ei=/[\n"\\]/g;function vr(i){return i.replace(ei,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Dr(i,o,f,p,b,S,M,Q){i.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?i.type=M:i.removeAttribute("type"),o!=null?M==="number"?(o===0&&i.value===""||i.value!=o)&&(i.value=""+Jt(o)):i.value!==""+Jt(o)&&(i.value=""+Jt(o)):M!=="submit"&&M!=="reset"||i.removeAttribute("value"),o!=null?ju(i,M,Jt(o)):f!=null?ju(i,M,Jt(f)):p!=null&&i.removeAttribute("value"),b==null&&S!=null&&(i.defaultChecked=!!S),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?i.name=""+Jt(Q):i.removeAttribute("name")}function Lu(i,o,f,p,b,S,M,Q){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.type=S),o!=null||f!=null){if(!(S!=="submit"&&S!=="reset"||o!=null)){qi(i);return}f=f!=null?""+Jt(f):"",o=o!=null?""+Jt(o):f,Q||o===i.value||(i.value=o),i.defaultValue=o}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=Q?i.checked:!!p,i.defaultChecked=!!p,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(i.name=M),qi(i)}function ju(i,o,f){o==="number"&&hn(i.ownerDocument)===i||i.defaultValue===""+f||(i.defaultValue=""+f)}function ao(i,o,f,p){if(i=i.options,o){o={};for(var b=0;b<f.length;b++)o["$"+f[b]]=!0;for(f=0;f<i.length;f++)b=o.hasOwnProperty("$"+i[f].value),i[f].selected!==b&&(i[f].selected=b),b&&p&&(i[f].defaultSelected=!0)}else{for(f=""+Jt(f),o=null,b=0;b<i.length;b++){if(i[b].value===f){i[b].selected=!0,p&&(i[b].defaultSelected=!0);return}o!==null||i[b].disabled||(o=i[b])}o!==null&&(o.selected=!0)}}function wc(i,o,f){if(o!=null&&(o=""+Jt(o),o!==i.value&&(i.value=o),f==null)){i.defaultValue!==o&&(i.defaultValue=o);return}i.defaultValue=f!=null?""+Jt(f):""}function Hi(i,o,f,p){if(o==null){if(p!=null){if(f!=null)throw Error(r(92));if(he(p)){if(1<p.length)throw Error(r(93));p=p[0]}f=p}f==null&&(f=""),o=f}f=Jt(o),i.defaultValue=f,p=i.textContent,p===f&&p!==""&&p!==null&&(i.value=p),qi(i)}function Ts(i,o){if(o){var f=i.firstChild;if(f&&f===i.lastChild&&f.nodeType===3){f.nodeValue=o;return}}i.textContent=o}var Ul=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Ho(i,o,f){var p=o.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?p?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="":p?i.setProperty(o,f):typeof f!="number"||f===0||Ul.has(o)?o==="float"?i.cssFloat=f:i[o]=(""+f).trim():i[o]=f+"px"}function Bl(i,o,f){if(o!=null&&typeof o!="object")throw Error(r(62));if(i=i.style,f!=null){for(var p in f)!f.hasOwnProperty(p)||o!=null&&o.hasOwnProperty(p)||(p.indexOf("--")===0?i.setProperty(p,""):p==="float"?i.cssFloat="":i[p]="");for(var b in o)p=o[b],o.hasOwnProperty(b)&&f[b]!==p&&Ho(i,b,p)}else for(var S in o)o.hasOwnProperty(S)&&Ho(i,S,o[S])}function Ou(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Jf=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Xf=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Vi(i){return Xf.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function wi(){}var cs=null;function Ru(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var xi=null,Ft=null;function xc(i){var o=_n(i);if(o&&(i=o.stateNode)){var f=i[ct]||null;e:switch(i=o.stateNode,o.type){case"input":if(Dr(i,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),o=f.name,f.type==="radio"&&o!=null){for(f=i;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+vr(""+o)+'"][type="radio"]'),o=0;o<f.length;o++){var p=f[o];if(p!==i&&p.form===i.form){var b=p[ct]||null;if(!b)throw Error(r(90));Dr(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(o=0;o<f.length;o++)p=f[o],p.form===i.form&&us(p)}break e;case"textarea":wc(i,f.value,f.defaultValue);break e;case"select":o=f.value,o!=null&&ao(i,!!f.multiple,o,!1)}}}var ku=!1;function Sc(i,o,f){if(ku)return i(o,f);ku=!0;try{var p=i(o);return p}finally{if(ku=!1,(xi!==null||Ft!==null)&&(fp(),xi&&(o=xi,i=Ft,Ft=xi=null,xc(o),i)))for(o=0;o<i.length;o++)xc(i[o])}}function Vo(i,o){var f=i.stateNode;if(f===null)return null;var p=f[ct]||null;if(p===null)return null;f=p[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break e;default:i=!1}if(i)return null;if(f&&typeof f!="function")throw Error(r(231,o,typeof f));return f}var Gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Wi=!1;if(Gi)try{var fi={};Object.defineProperty(fi,"passive",{get:function(){Wi=!0}}),window.addEventListener("test",fi,fi),window.removeEventListener("test",fi,fi)}catch{Wi=!1}var fs=null,Du=null,Ls=null;function $l(){if(Ls)return Ls;var i,o=Du,f=o.length,p,b="value"in fs?fs.value:fs.textContent,S=b.length;for(i=0;i<f&&o[i]===b[i];i++);var M=f-i;for(p=1;p<=M&&o[f-p]===b[S-p];p++);return Ls=b.slice(i,1<p?1-p:void 0)}function hi(i){var o=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&o===13&&(i=13)):i=o,i===10&&(i=13),32<=i||i===13?i:0}function zl(){return!0}function Go(){return!1}function La(i){function o(f,p,b,S,M){this._reactName=f,this._targetInst=b,this.type=p,this.nativeEvent=S,this.target=M,this.currentTarget=null;for(var Q in i)i.hasOwnProperty(Q)&&(f=i[Q],this[Q]=f?f(S):S[Q]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?zl:Go,this.isPropagationStopped=Go,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=zl)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),o}var Yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ki=La(Yi),js=m({},Yi,{view:0,detail:0}),Wo=La(js),Yo,io,Os,Rs=m({},js,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pt,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Os&&(Os&&i.type==="mousemove"?(Yo=i.screenX-Os.screenX,io=i.screenY-Os.screenY):io=Yo=0,Os=i),Yo)},movementY:function(i){return"movementY"in i?i.movementY:io}}),Pu=La(Rs),ks=m({},Rs,{dataTransfer:0}),Ds=La(ks),_c=m({},js,{relatedTarget:0}),ql=La(_c),Ec=m({},Yi,{animationName:0,elapsedTime:0,pseudoElement:0}),Ko=La(Ec),Ac=m({},Yi,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),C=La(Ac),q=m({},Yi,{data:0}),ue=La(q),ye={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_e={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Ue={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xe(i){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(i):(i=Ue[i])?!!o[i]:!1}function pt(){return Xe}var vt=m({},js,{key:function(i){if(i.key){var o=ye[i.key]||i.key;if(o!=="Unidentified")return o}return i.type==="keypress"?(i=hi(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?_e[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pt,charCode:function(i){return i.type==="keypress"?hi(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?hi(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),Xt=La(vt),sn=m({},Rs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),An=La(sn),Ur=m({},js,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pt}),Qn=La(Ur),Jn=m({},Yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ur=La(Jn),yr=m({},Rs,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),br=La(yr),ja=m({},Yi,{newState:0,oldState:0}),Ps=La(ja),Mu=[9,13,27,32],Ms=Gi&&"CompositionEvent"in window,Ji=null;Gi&&"documentMode"in document&&(Ji=document.documentMode);var so=Gi&&"TextEvent"in window&&!Ji,oo=Gi&&(!Ms||Ji&&8<Ji&&11>=Ji),Jo=" ",Xo=!1;function ga(i,o){switch(i){case"keyup":return Mu.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lo(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Si=!1;function Iu(i,o){switch(i){case"compositionend":return lo(o);case"keypress":return o.which!==32?null:(Xo=!0,Jo);case"textInput":return i=o.data,i===Jo&&Xo?null:i;default:return null}}function hs(i,o){if(Si)return i==="compositionend"||!Ms&&ga(i,o)?(i=$l(),Ls=Du=fs=null,Si=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return oo&&o.locale!=="ko"?null:o.data;default:return null}}var $a={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fu(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o==="input"?!!$a[i.type]:o==="textarea"}function Zo(i,o,f,p){xi?Ft?Ft.push(p):Ft=[p]:xi=p,o=yp(o,"onChange"),0<o.length&&(f=new Ki("onChange","change",null,f,p),i.push({event:f,listeners:o}))}var uo=null,Oa=null;function Qo(i){Vb(i,0)}function co(i){var o=En(i);if(us(o))return i}function el(i,o){if(i==="change")return o}var fo=!1;if(Gi){var tl;if(Gi){var va="oninput"in document;if(!va){var za=document.createElement("div");za.setAttribute("oninput","return;"),va=typeof za.oninput=="function"}tl=va}else tl=!1;fo=tl&&(!document.documentMode||9<document.documentMode)}function nl(){uo&&(uo.detachEvent("onpropertychange",Is),Oa=uo=null)}function Is(i){if(i.propertyName==="value"&&co(Oa)){var o=[];Zo(o,Oa,i,Ru(i)),Sc(Qo,o)}}function ho(i,o,f){i==="focusin"?(nl(),uo=o,Oa=f,uo.attachEvent("onpropertychange",Is)):i==="focusout"&&nl()}function Hl(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return co(Oa)}function rl(i,o){if(i==="click")return co(o)}function Br(i,o){if(i==="input"||i==="change")return co(o)}function Zf(i,o){return i===o&&(i!==0||1/i===1/o)||i!==i&&o!==o}var Cr=typeof Object.is=="function"?Object.is:Zf;function qa(i,o){if(Cr(i,o))return!0;if(typeof i!="object"||i===null||typeof o!="object"||o===null)return!1;var f=Object.keys(i),p=Object.keys(o);if(f.length!==p.length)return!1;for(p=0;p<f.length;p++){var b=f[p];if(!Ve.call(o,b)||!Cr(i[b],o[b]))return!1}return!0}function po(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Vl(i,o){var f=po(i);i=0;for(var p;f;){if(f.nodeType===3){if(p=i+f.textContent.length,i<=o&&p>=o)return{node:f,offset:o-i};i=p}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=po(f)}}function Gl(i,o){return i&&o?i===o?!0:i&&i.nodeType===3?!1:o&&o.nodeType===3?Gl(i,o.parentNode):"contains"in i?i.contains(o):i.compareDocumentPosition?!!(i.compareDocumentPosition(o)&16):!1:!1}function al(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var o=hn(i.document);o instanceof i.HTMLIFrameElement;){try{var f=typeof o.contentWindow.location.href=="string"}catch{f=!1}if(f)i=o.contentWindow;else break;o=hn(i.document)}return o}function Fs(i){var o=i&&i.nodeName&&i.nodeName.toLowerCase();return o&&(o==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||o==="textarea"||i.contentEditable==="true")}var il=Gi&&"documentMode"in document&&11>=document.documentMode,di=null,Xi=null,_i=null,mo=!1;function ya(i,o,f){var p=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;mo||di==null||di!==hn(p)||(p=di,"selectionStart"in p&&Fs(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),_i&&qa(_i,p)||(_i=p,p=yp(Xi,"onSelect"),0<p.length&&(o=new Ki("onSelect","select",null,o,f),i.push({event:o,listeners:p}),o.target=di)))}function Ra(i,o){var f={};return f[i.toLowerCase()]=o.toLowerCase(),f["Webkit"+i]="webkit"+o,f["Moz"+i]="moz"+o,f}var Fn={animationend:Ra("Animation","AnimationEnd"),animationiteration:Ra("Animation","AnimationIteration"),animationstart:Ra("Animation","AnimationStart"),transitionrun:Ra("Transition","TransitionRun"),transitionstart:Ra("Transition","TransitionStart"),transitioncancel:Ra("Transition","TransitionCancel"),transitionend:Ra("Transition","TransitionEnd")},Xn={},Tr={};Gi&&(Tr=document.createElement("div").style,"AnimationEvent"in window||(delete Fn.animationend.animation,delete Fn.animationiteration.animation,delete Fn.animationstart.animation),"TransitionEvent"in window||delete Fn.transitionend.transition);function cr(i){if(Xn[i])return Xn[i];if(!Fn[i])return i;var o=Fn[i],f;for(f in o)if(o.hasOwnProperty(f)&&f in Tr)return Xn[i]=o[f];return i}var ds=cr("animationend"),Wl=cr("animationiteration"),sl=cr("animationstart"),Nc=cr("transitionrun"),zd=cr("transitionstart"),qd=cr("transitioncancel"),Qf=cr("transitionend"),eh=new Map,ol="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ol.push("scrollEnd");function Ei(i,o){eh.set(i,o),oa(o,[i])}var Uu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},pi=[],ll=0,Cc=0;function Bu(){for(var i=ll,o=Cc=ll=0;o<i;){var f=pi[o];pi[o++]=null;var p=pi[o];pi[o++]=null;var b=pi[o];pi[o++]=null;var S=pi[o];if(pi[o++]=null,p!==null&&b!==null){var M=p.pending;M===null?b.next=b:(b.next=M.next,M.next=b),p.pending=b}S!==0&&zu(f,b,S)}}function $u(i,o,f,p){pi[ll++]=i,pi[ll++]=o,pi[ll++]=f,pi[ll++]=p,Cc|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function Tc(i,o,f,p){return $u(i,o,f,p),ka(i)}function Us(i,o){return $u(i,null,null,o),ka(i)}function zu(i,o,f){i.lanes|=f;var p=i.alternate;p!==null&&(p.lanes|=f);for(var b=!1,S=i.return;S!==null;)S.childLanes|=f,p=S.alternate,p!==null&&(p.childLanes|=f),S.tag===22&&(i=S.stateNode,i===null||i._visibility&1||(b=!0)),i=S,S=S.return;return i.tag===3?(S=i.stateNode,b&&o!==null&&(b=31-mn(f),i=S.hiddenUpdates,p=i[b],p===null?i[b]=[o]:p.push(o),o.lane=f|536870912),S):null}function ka(i){if(50<Sh)throw Sh=0,T0=null,Error(r(185));for(var o=i.return;o!==null;)i=o,o=i.return;return i.tag===3?i.stateNode:null}var ba={};function Lc(i,o,f,p){this.tag=i,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Da(i,o,f,p){return new Lc(i,o,f,p)}function jc(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Ai(i,o){var f=i.alternate;return f===null?(f=Da(i.tag,o,i.key,i.mode),f.elementType=i.elementType,f.type=i.type,f.stateNode=i.stateNode,f.alternate=i,i.alternate=f):(f.pendingProps=o,f.type=i.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=i.flags&65011712,f.childLanes=i.childLanes,f.lanes=i.lanes,f.child=i.child,f.memoizedProps=i.memoizedProps,f.memoizedState=i.memoizedState,f.updateQueue=i.updateQueue,o=i.dependencies,f.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},f.sibling=i.sibling,f.index=i.index,f.ref=i.ref,f.refCleanup=i.refCleanup,f}function qu(i,o){i.flags&=65011714;var f=i.alternate;return f===null?(i.childLanes=0,i.lanes=o,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=f.childLanes,i.lanes=f.lanes,i.child=f.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=f.memoizedProps,i.memoizedState=f.memoizedState,i.updateQueue=f.updateQueue,i.type=f.type,o=f.dependencies,i.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),i}function Yl(i,o,f,p,b,S){var M=0;if(p=i,typeof i=="function")jc(i)&&(M=1);else if(typeof i=="string")M=Z6(i,f,Z.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case B:return i=Da(31,f,o,b),i.elementType=B,i.lanes=S,i;case _:return go(f.children,b,S,o);case N:M=8,b|=24;break;case A:return i=Da(12,f,o,b|2),i.elementType=A,i.lanes=S,i;case I:return i=Da(13,f,o,b),i.elementType=I,i.lanes=S,i;case ee:return i=Da(19,f,o,b),i.elementType=ee,i.lanes=S,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case L:M=10;break e;case j:M=9;break e;case R:M=11;break e;case G:M=14;break e;case P:M=16,p=null;break e}M=29,f=Error(r(130,i===null?"null":typeof i,"")),p=null}return o=Da(M,f,o,b),o.elementType=i,o.type=p,o.lanes=S,o}function go(i,o,f,p){return i=Da(7,i,p,o),i.lanes=f,i}function Hu(i,o,f){return i=Da(6,i,null,o),i.lanes=f,i}function Oc(i){var o=Da(18,null,null,0);return o.stateNode=i,o}function Kl(i,o,f){return o=Da(4,i.children!==null?i.children:[],i.key,o),o.lanes=f,o.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},o}var Rc=new WeakMap;function Ni(i,o){if(typeof i=="object"&&i!==null){var f=Rc.get(i);return f!==void 0?f:(o={value:i,source:o,stack:tt(o)},Rc.set(i,o),o)}return{value:i,source:o,stack:tt(o)}}var Jl=[],ul=0,kc=null,Vu=0,Ci=[],Ti=0,vo=null,Li=1,ji="";function mi(i,o){Jl[ul++]=Vu,Jl[ul++]=kc,kc=i,Vu=o}function Hd(i,o,f){Ci[Ti++]=Li,Ci[Ti++]=ji,Ci[Ti++]=vo,vo=i;var p=Li;i=ji;var b=32-mn(p)-1;p&=~(1<<b),f+=1;var S=32-mn(o)+b;if(30<S){var M=b-b%5;S=(p&(1<<M)-1).toString(32),p>>=M,b-=M,Li=1<<32-mn(o)+b|f<<b|p,ji=S+i}else Li=1<<S|f<<b|p,ji=i}function th(i){i.return!==null&&(mi(i,1),Hd(i,1,0))}function Dc(i){for(;i===kc;)kc=Jl[--ul],Jl[ul]=null,Vu=Jl[--ul],Jl[ul]=null;for(;i===vo;)vo=Ci[--Ti],Ci[Ti]=null,ji=Ci[--Ti],Ci[Ti]=null,Li=Ci[--Ti],Ci[Ti]=null}function Vd(i,o){Ci[Ti++]=Li,Ci[Ti++]=ji,Ci[Ti++]=vo,Li=o.id,ji=o.overflow,vo=i}var wa=null,fr=null,Nn=!1,Ha=null,Lr=!1,Zi=Error(r(519));function yo(i){var o=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Xl(Ni(o,i)),Zi}function nh(i){var o=i.stateNode,f=i.type,p=i.memoizedProps;switch(o[et]=i,o[ct]=p,f){case"dialog":Tn("cancel",o),Tn("close",o);break;case"iframe":case"object":case"embed":Tn("load",o);break;case"video":case"audio":for(f=0;f<Eh.length;f++)Tn(Eh[f],o);break;case"source":Tn("error",o);break;case"img":case"image":case"link":Tn("error",o),Tn("load",o);break;case"details":Tn("toggle",o);break;case"input":Tn("invalid",o),Lu(o,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Tn("invalid",o);break;case"textarea":Tn("invalid",o),Hi(o,p.value,p.defaultValue,p.children)}f=p.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||o.textContent===""+f||p.suppressHydrationWarning===!0||Kb(o.textContent,f)?(p.popover!=null&&(Tn("beforetoggle",o),Tn("toggle",o)),p.onScroll!=null&&Tn("scroll",o),p.onScrollEnd!=null&&Tn("scrollend",o),p.onClick!=null&&(o.onclick=wi),o=!0):o=!1,o||yo(i,!0)}function Bs(i){for(wa=i.return;wa;)switch(wa.tag){case 5:case 31:case 13:Lr=!1;return;case 27:case 3:Lr=!0;return;default:wa=wa.return}}function xa(i){if(i!==wa)return!1;if(!Nn)return Bs(i),Nn=!0,!1;var o=i.tag,f;if((f=o!==3&&o!==27)&&((f=o===5)&&(f=i.type,f=!(f!=="form"&&f!=="button")||q0(i.type,i.memoizedProps)),f=!f),f&&fr&&yo(i),Bs(i),o===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));fr=a5(i)}else if(o===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));fr=a5(i)}else o===27?(o=fr,fu(i.type)?(i=Y0,Y0=null,fr=i):fr=o):fr=wa?vs(i.stateNode.nextSibling):null;return!0}function cl(){fr=wa=null,Nn=!1}function rh(){var i=Ha;return i!==null&&(Mi===null?Mi=i:Mi.push.apply(Mi,i),Ha=null),i}function Xl(i){Ha===null?Ha=[i]:Ha.push(i)}var Pc=U(null),bo=null,ps=null;function wo(i,o,f){V(Pc,o._currentValue),o._currentValue=f}function Oi(i){i._currentValue=Pc.current,O(Pc)}function Zl(i,o,f){for(;i!==null;){var p=i.alternate;if((i.childLanes&o)!==o?(i.childLanes|=o,p!==null&&(p.childLanes|=o)):p!==null&&(p.childLanes&o)!==o&&(p.childLanes|=o),i===f)break;i=i.return}}function fl(i,o,f,p){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var S=b.dependencies;if(S!==null){var M=b.child;S=S.firstContext;e:for(;S!==null;){var Q=S;S=b;for(var me=0;me<o.length;me++)if(Q.context===o[me]){S.lanes|=f,Q=S.alternate,Q!==null&&(Q.lanes|=f),Zl(S.return,f,i),p||(M=null);break e}S=Q.next}}else if(b.tag===18){if(M=b.return,M===null)throw Error(r(341));M.lanes|=f,S=M.alternate,S!==null&&(S.lanes|=f),Zl(M,f,i),M=null}else M=b.child;if(M!==null)M.return=b;else for(M=b;M!==null;){if(M===i){M=null;break}if(b=M.sibling,b!==null){b.return=M.return,M=b;break}M=M.return}b=M}}function xo(i,o,f,p){i=null;for(var b=o,S=!1;b!==null;){if(!S){if((b.flags&524288)!==0)S=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var M=b.alternate;if(M===null)throw Error(r(387));if(M=M.memoizedProps,M!==null){var Q=b.type;Cr(b.pendingProps.value,M.value)||(i!==null?i.push(Q):i=[Q])}}else if(b===se.current){if(M=b.alternate,M===null)throw Error(r(387));M.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(Lh):i=[Lh])}b=b.return}i!==null&&fl(o,i,f,p),o.flags|=262144}function Mc(i){for(i=i.firstContext;i!==null;){if(!Cr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function So(i){bo=i,ps=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Sa(i){return Gd(bo,i)}function Ic(i,o){return bo===null&&So(i),Gd(i,o)}function Gd(i,o){var f=o._currentValue;if(o={context:o,memoizedValue:f,next:null},ps===null){if(i===null)throw Error(r(308));ps=o,i.dependencies={lanes:0,firstContext:o},i.flags|=524288}else ps=ps.next=o;return f}var Wg=typeof AbortController<"u"?AbortController:function(){var i=[],o=this.signal={aborted:!1,addEventListener:function(f,p){i.push(p)}};this.abort=function(){o.aborted=!0,i.forEach(function(f){return f()})}},Yg=t.unstable_scheduleCallback,Kg=t.unstable_NormalPriority,Pr={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ql(){return{controller:new Wg,data:new Map,refCount:0}}function Gu(i){i.refCount--,i.refCount===0&&Yg(Kg,function(){i.controller.abort()})}var Wu=null,Fc=0,v=0,w=null;function T(i,o){if(Wu===null){var f=Wu=[];Fc=0,v=D0(),w={status:"pending",value:void 0,then:function(p){f.push(p)}}}return Fc++,o.then(k,k),o}function k(){if(--Fc===0&&Wu!==null){w!==null&&(w.status="fulfilled");var i=Wu;Wu=null,v=0,w=null;for(var o=0;o<i.length;o++)(0,i[o])()}}function H(i,o){var f=[],p={status:"pending",value:null,reason:null,then:function(b){f.push(b)}};return i.then(function(){p.status="fulfilled",p.value=o;for(var b=0;b<f.length;b++)(0,f[b])(o)},function(b){for(p.status="rejected",p.reason=b,b=0;b<f.length;b++)(0,f[b])(void 0)}),p}var W=te.S;te.S=function(i,o){bb=en(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&T(i,o),W!==null&&W(i,o)};var J=U(null);function re(){var i=J.current;return i!==null?i:dr.pooledCache}function ae(i,o){o===null?V(J,J.current):V(J,o.pool)}function fe(){var i=re();return i===null?null:{parent:Pr._currentValue,pool:i}}var be=Error(r(460)),Le=Error(r(474)),ce=Error(r(542)),Se={then:function(){}};function Ce(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Fe(i,o,f){switch(f=i[f],f===void 0?i.push(o):f!==o&&(o.then(wi,wi),o=f),o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Ze(i),i;default:if(typeof o.status=="string")o.then(wi,wi);else{if(i=dr,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=o,i.status="pending",i.then(function(p){if(o.status==="pending"){var b=o;b.status="fulfilled",b.value=p}},function(p){if(o.status==="pending"){var b=o;b.status="rejected",b.reason=p}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw i=o.reason,Ze(i),i}throw Ie=o,be}}function Te(i){try{var o=i._init;return o(i._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Ie=f,be):f}}var Ie=null;function ze(){if(Ie===null)throw Error(r(459));var i=Ie;return Ie=null,i}function Ze(i){if(i===be||i===ce)throw Error(r(483))}var Ye=null,bt=0;function ft(i){var o=bt;return bt+=1,Ye===null&&(Ye=[]),Fe(Ye,i,o)}function Zt(i,o){o=o.props.ref,i.ref=o!==void 0?o:null}function mt(i,o){throw o.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(o),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":i)))}function xn(i){function o(Ae,we){if(i){var je=Ae.deletions;je===null?(Ae.deletions=[we],Ae.flags|=16):je.push(we)}}function f(Ae,we){if(!i)return null;for(;we!==null;)o(Ae,we),we=we.sibling;return null}function p(Ae){for(var we=new Map;Ae!==null;)Ae.key!==null?we.set(Ae.key,Ae):we.set(Ae.index,Ae),Ae=Ae.sibling;return we}function b(Ae,we){return Ae=Ai(Ae,we),Ae.index=0,Ae.sibling=null,Ae}function S(Ae,we,je){return Ae.index=je,i?(je=Ae.alternate,je!==null?(je=je.index,je<we?(Ae.flags|=67108866,we):je):(Ae.flags|=67108866,we)):(Ae.flags|=1048576,we)}function M(Ae){return i&&Ae.alternate===null&&(Ae.flags|=67108866),Ae}function Q(Ae,we,je,He){return we===null||we.tag!==6?(we=Hu(je,Ae.mode,He),we.return=Ae,we):(we=b(we,je),we.return=Ae,we)}function me(Ae,we,je,He){var Mt=je.type;return Mt===_?$e(Ae,we,je.props.children,He,je.key):we!==null&&(we.elementType===Mt||typeof Mt=="object"&&Mt!==null&&Mt.$$typeof===P&&Te(Mt)===we.type)?(we=b(we,je.props),Zt(we,je),we.return=Ae,we):(we=Yl(je.type,je.key,je.props,null,Ae.mode,He),Zt(we,je),we.return=Ae,we)}function Oe(Ae,we,je,He){return we===null||we.tag!==4||we.stateNode.containerInfo!==je.containerInfo||we.stateNode.implementation!==je.implementation?(we=Kl(je,Ae.mode,He),we.return=Ae,we):(we=b(we,je.children||[]),we.return=Ae,we)}function $e(Ae,we,je,He,Mt){return we===null||we.tag!==7?(we=go(je,Ae.mode,He,Mt),we.return=Ae,we):(we=b(we,je),we.return=Ae,we)}function Ge(Ae,we,je){if(typeof we=="string"&&we!==""||typeof we=="number"||typeof we=="bigint")return we=Hu(""+we,Ae.mode,je),we.return=Ae,we;if(typeof we=="object"&&we!==null){switch(we.$$typeof){case g:return je=Yl(we.type,we.key,we.props,null,Ae.mode,je),Zt(je,we),je.return=Ae,je;case x:return we=Kl(we,Ae.mode,je),we.return=Ae,we;case P:return we=Te(we),Ge(Ae,we,je)}if(he(we)||$(we))return we=go(we,Ae.mode,je,null),we.return=Ae,we;if(typeof we.then=="function")return Ge(Ae,ft(we),je);if(we.$$typeof===L)return Ge(Ae,Ic(Ae,we),je);mt(Ae,we)}return null}function ke(Ae,we,je,He){var Mt=we!==null?we.key:null;if(typeof je=="string"&&je!==""||typeof je=="number"||typeof je=="bigint")return Mt!==null?null:Q(Ae,we,""+je,He);if(typeof je=="object"&&je!==null){switch(je.$$typeof){case g:return je.key===Mt?me(Ae,we,je,He):null;case x:return je.key===Mt?Oe(Ae,we,je,He):null;case P:return je=Te(je),ke(Ae,we,je,He)}if(he(je)||$(je))return Mt!==null?null:$e(Ae,we,je,He,null);if(typeof je.then=="function")return ke(Ae,we,ft(je),He);if(je.$$typeof===L)return ke(Ae,we,Ic(Ae,je),He);mt(Ae,je)}return null}function Me(Ae,we,je,He,Mt){if(typeof He=="string"&&He!==""||typeof He=="number"||typeof He=="bigint")return Ae=Ae.get(je)||null,Q(we,Ae,""+He,Mt);if(typeof He=="object"&&He!==null){switch(He.$$typeof){case g:return Ae=Ae.get(He.key===null?je:He.key)||null,me(we,Ae,He,Mt);case x:return Ae=Ae.get(He.key===null?je:He.key)||null,Oe(we,Ae,He,Mt);case P:return He=Te(He),Me(Ae,we,je,He,Mt)}if(he(He)||$(He))return Ae=Ae.get(je)||null,$e(we,Ae,He,Mt,null);if(typeof He.then=="function")return Me(Ae,we,je,ft(He),Mt);if(He.$$typeof===L)return Me(Ae,we,je,Ic(we,He),Mt);mt(we,He)}return null}function yt(Ae,we,je,He){for(var Mt=null,$n=null,Nt=we,gn=we=0,jn=null;Nt!==null&&gn<je.length;gn++){Nt.index>gn?(jn=Nt,Nt=null):jn=Nt.sibling;var zn=ke(Ae,Nt,je[gn],He);if(zn===null){Nt===null&&(Nt=jn);break}i&&Nt&&zn.alternate===null&&o(Ae,Nt),we=S(zn,we,gn),$n===null?Mt=zn:$n.sibling=zn,$n=zn,Nt=jn}if(gn===je.length)return f(Ae,Nt),Nn&&mi(Ae,gn),Mt;if(Nt===null){for(;gn<je.length;gn++)Nt=Ge(Ae,je[gn],He),Nt!==null&&(we=S(Nt,we,gn),$n===null?Mt=Nt:$n.sibling=Nt,$n=Nt);return Nn&&mi(Ae,gn),Mt}for(Nt=p(Nt);gn<je.length;gn++)jn=Me(Nt,Ae,gn,je[gn],He),jn!==null&&(i&&jn.alternate!==null&&Nt.delete(jn.key===null?gn:jn.key),we=S(jn,we,gn),$n===null?Mt=jn:$n.sibling=jn,$n=jn);return i&&Nt.forEach(function(gu){return o(Ae,gu)}),Nn&&mi(Ae,gn),Mt}function Vt(Ae,we,je,He){if(je==null)throw Error(r(151));for(var Mt=null,$n=null,Nt=we,gn=we=0,jn=null,zn=je.next();Nt!==null&&!zn.done;gn++,zn=je.next()){Nt.index>gn?(jn=Nt,Nt=null):jn=Nt.sibling;var gu=ke(Ae,Nt,zn.value,He);if(gu===null){Nt===null&&(Nt=jn);break}i&&Nt&&gu.alternate===null&&o(Ae,Nt),we=S(gu,we,gn),$n===null?Mt=gu:$n.sibling=gu,$n=gu,Nt=jn}if(zn.done)return f(Ae,Nt),Nn&&mi(Ae,gn),Mt;if(Nt===null){for(;!zn.done;gn++,zn=je.next())zn=Ge(Ae,zn.value,He),zn!==null&&(we=S(zn,we,gn),$n===null?Mt=zn:$n.sibling=zn,$n=zn);return Nn&&mi(Ae,gn),Mt}for(Nt=p(Nt);!zn.done;gn++,zn=je.next())zn=Me(Nt,Ae,gn,zn.value,He),zn!==null&&(i&&zn.alternate!==null&&Nt.delete(zn.key===null?gn:zn.key),we=S(zn,we,gn),$n===null?Mt=zn:$n.sibling=zn,$n=zn);return i&&Nt.forEach(function(uN){return o(Ae,uN)}),Nn&&mi(Ae,gn),Mt}function or(Ae,we,je,He){if(typeof je=="object"&&je!==null&&je.type===_&&je.key===null&&(je=je.props.children),typeof je=="object"&&je!==null){switch(je.$$typeof){case g:e:{for(var Mt=je.key;we!==null;){if(we.key===Mt){if(Mt=je.type,Mt===_){if(we.tag===7){f(Ae,we.sibling),He=b(we,je.props.children),He.return=Ae,Ae=He;break e}}else if(we.elementType===Mt||typeof Mt=="object"&&Mt!==null&&Mt.$$typeof===P&&Te(Mt)===we.type){f(Ae,we.sibling),He=b(we,je.props),Zt(He,je),He.return=Ae,Ae=He;break e}f(Ae,we);break}else o(Ae,we);we=we.sibling}je.type===_?(He=go(je.props.children,Ae.mode,He,je.key),He.return=Ae,Ae=He):(He=Yl(je.type,je.key,je.props,null,Ae.mode,He),Zt(He,je),He.return=Ae,Ae=He)}return M(Ae);case x:e:{for(Mt=je.key;we!==null;){if(we.key===Mt)if(we.tag===4&&we.stateNode.containerInfo===je.containerInfo&&we.stateNode.implementation===je.implementation){f(Ae,we.sibling),He=b(we,je.children||[]),He.return=Ae,Ae=He;break e}else{f(Ae,we);break}else o(Ae,we);we=we.sibling}He=Kl(je,Ae.mode,He),He.return=Ae,Ae=He}return M(Ae);case P:return je=Te(je),or(Ae,we,je,He)}if(he(je))return yt(Ae,we,je,He);if($(je)){if(Mt=$(je),typeof Mt!="function")throw Error(r(150));return je=Mt.call(je),Vt(Ae,we,je,He)}if(typeof je.then=="function")return or(Ae,we,ft(je),He);if(je.$$typeof===L)return or(Ae,we,Ic(Ae,je),He);mt(Ae,je)}return typeof je=="string"&&je!==""||typeof je=="number"||typeof je=="bigint"?(je=""+je,we!==null&&we.tag===6?(f(Ae,we.sibling),He=b(we,je),He.return=Ae,Ae=He):(f(Ae,we),He=Hu(je,Ae.mode,He),He.return=Ae,Ae=He),M(Ae)):f(Ae,we)}return function(Ae,we,je,He){try{bt=0;var Mt=or(Ae,we,je,He);return Ye=null,Mt}catch(Nt){if(Nt===be||Nt===ce)throw Nt;var $n=Da(29,Nt,null,Ae.mode);return $n.lanes=He,$n.return=Ae,$n}finally{}}}var hr=xn(!0),on=xn(!1),ht=!1;function nt(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function wr(i,o){i=i.updateQueue,o.updateQueue===i&&(o.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function $t(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function dn(i,o,f){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(Wn&2)!==0){var b=p.pending;return b===null?o.next=o:(o.next=b.next,b.next=o),p.pending=o,o=ka(i),zu(i,null,f),o}return $u(i,p,o,f),ka(i)}function Vn(i,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194048)!==0)){var p=o.lanes;p&=i.pendingLanes,f|=p,o.lanes=f,Ba(i,f)}}function Zr(i,o){var f=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,f===p)){var b=null,S=null;if(f=f.firstBaseUpdate,f!==null){do{var M={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};S===null?b=S=M:S=S.next=M,f=f.next}while(f!==null);S===null?b=S=o:S=S.next=o}else b=S=o;f={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:S,shared:p.shared,callbacks:p.callbacks},i.updateQueue=f;return}i=f.lastBaseUpdate,i===null?f.firstBaseUpdate=o:i.next=o,f.lastBaseUpdate=o}var _a=!1;function ar(){if(_a){var i=w;if(i!==null)throw i}}function $r(i,o,f,p){_a=!1;var b=i.updateQueue;ht=!1;var S=b.firstBaseUpdate,M=b.lastBaseUpdate,Q=b.shared.pending;if(Q!==null){b.shared.pending=null;var me=Q,Oe=me.next;me.next=null,M===null?S=Oe:M.next=Oe,M=me;var $e=i.alternate;$e!==null&&($e=$e.updateQueue,Q=$e.lastBaseUpdate,Q!==M&&(Q===null?$e.firstBaseUpdate=Oe:Q.next=Oe,$e.lastBaseUpdate=me))}if(S!==null){var Ge=b.baseState;M=0,$e=Oe=me=null,Q=S;do{var ke=Q.lane&-536870913,Me=ke!==Q.lane;if(Me?(Ln&ke)===ke:(p&ke)===ke){ke!==0&&ke===v&&(_a=!0),$e!==null&&($e=$e.next={lane:0,tag:Q.tag,payload:Q.payload,callback:null,next:null});e:{var yt=i,Vt=Q;ke=o;var or=f;switch(Vt.tag){case 1:if(yt=Vt.payload,typeof yt=="function"){Ge=yt.call(or,Ge,ke);break e}Ge=yt;break e;case 3:yt.flags=yt.flags&-65537|128;case 0:if(yt=Vt.payload,ke=typeof yt=="function"?yt.call(or,Ge,ke):yt,ke==null)break e;Ge=m({},Ge,ke);break e;case 2:ht=!0}}ke=Q.callback,ke!==null&&(i.flags|=64,Me&&(i.flags|=8192),Me=b.callbacks,Me===null?b.callbacks=[ke]:Me.push(ke))}else Me={lane:ke,tag:Q.tag,payload:Q.payload,callback:Q.callback,next:null},$e===null?(Oe=$e=Me,me=Ge):$e=$e.next=Me,M|=ke;if(Q=Q.next,Q===null){if(Q=b.shared.pending,Q===null)break;Me=Q,Q=Me.next,Me.next=null,b.lastBaseUpdate=Me,b.shared.pending=null}}while(!0);$e===null&&(me=Ge),b.baseState=me,b.firstBaseUpdate=Oe,b.lastBaseUpdate=$e,S===null&&(b.shared.lanes=0),su|=M,i.lanes=M,i.memoizedState=Ge}}function Pa(i,o){if(typeof i!="function")throw Error(r(191,i));i.call(o)}function zr(i,o){var f=i.callbacks;if(f!==null)for(i.callbacks=null,i=0;i<f.length;i++)Pa(f[i],o)}var yn=U(null),Dn=U(0);function xr(i,o){i=xl,V(Dn,i),V(yn,o),xl=i|o.baseLanes}function Un(){V(Dn,xl),V(yn,yn.current)}function Qr(){xl=Dn.current,O(yn),O(Dn)}var Sr=U(null),Pn=null;function Mr(i){var o=i.alternate;V(On,On.current&1),V(Sr,i),Pn===null&&(o===null||yn.current!==null||o.memoizedState!==null)&&(Pn=i)}function Gn(i){V(On,On.current),V(Sr,i),Pn===null&&(Pn=i)}function qr(i){i.tag===22?(V(On,On.current),V(Sr,i),Pn===null&&(Pn=i)):Hr()}function Hr(){V(On,On.current),V(Sr,Sr.current)}function er(i){O(Sr),Pn===i&&(Pn=null),O(On)}var On=U(0);function Ma(i){for(var o=i;o!==null;){if(o.tag===13){var f=o.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||G0(f)||W0(f)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var jr=0,Rt=null,Pt=null,Mn=null,ti=!1,Ri=!1,Va=!1,Vr=0,_o=0,Eo=null,Uc=0;function ir(){throw Error(r(321))}function ah(i,o){if(o===null)return!1;for(var f=0;f<o.length&&f<i.length;f++)if(!Cr(i[f],o[f]))return!1;return!0}function ih(i,o,f,p,b,S){return jr=S,Rt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,te.H=i===null||i.memoizedState===null?j2:r0,Va=!1,S=f(p,b),Va=!1,Ri&&(S=$s(o,f,p,b)),Bc(i),S}function Bc(i){te.H=dh;var o=Pt!==null&&Pt.next!==null;if(jr=0,Mn=Pt=Rt=null,ti=!1,_o=0,Eo=null,o)throw Error(r(300));i===null||fa||(i=i.dependencies,i!==null&&Mc(i)&&(fa=!0))}function $s(i,o,f,p){Rt=i;var b=0;do{if(Ri&&(Eo=null),_o=0,Ri=!1,25<=b)throw Error(r(301));if(b+=1,Mn=Pt=null,i.updateQueue!=null){var S=i.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}te.H=O2,S=o(f,p)}while(Ri);return S}function Jg(){var i=te.H,o=i.useState()[0];return o=typeof o.then=="function"?Ao(o):o,i=i.useState()[0],(Pt!==null?Pt.memoizedState:null)!==i&&(Rt.flags|=1024),o}function sh(){var i=Vr!==0;return Vr=0,i}function oh(i,o,f){o.updateQueue=i.updateQueue,o.flags&=-2053,i.lanes&=~f}function $c(i){if(ti){for(i=i.memoizedState;i!==null;){var o=i.queue;o!==null&&(o.pending=null),i=i.next}ti=!1}jr=0,Mn=Pt=Rt=null,Ri=!1,_o=Vr=0,Eo=null}function ca(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mn===null?Rt.memoizedState=Mn=i:Mn=Mn.next=i,Mn}function Or(){if(Pt===null){var i=Rt.alternate;i=i!==null?i.memoizedState:null}else i=Pt.next;var o=Mn===null?Rt.memoizedState:Mn.next;if(o!==null)Mn=o,Pt=i;else{if(i===null)throw Rt.alternate===null?Error(r(467)):Error(r(310));Pt=i,i={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},Mn===null?Rt.memoizedState=Mn=i:Mn=Mn.next=i}return Mn}function Yu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ao(i){var o=_o;return _o+=1,Eo===null&&(Eo=[]),i=Fe(Eo,i,o),o=Rt,(Mn===null?o.memoizedState:Mn.next)===null&&(o=o.alternate,te.H=o===null||o.memoizedState===null?j2:r0),i}function eu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ao(i);if(i.$$typeof===L)return Sa(i)}throw Error(r(438,String(i)))}function hl(i){var o=null,f=Rt.updateQueue;if(f!==null&&(o=f.memoCache),o==null){var p=Rt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(o={data:p.data.map(function(b){return b.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),f===null&&(f=Yu(),Rt.updateQueue=f),f.memoCache=o,f=o.data[o.index],f===void 0)for(f=o.data[o.index]=Array(i),p=0;p<i;p++)f[p]=X;return o.index++,f}function ms(i,o){return typeof o=="function"?o(i):o}function zc(i){var o=Or();return tu(o,Pt,i)}function tu(i,o,f){var p=i.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=f;var b=i.baseQueue,S=p.pending;if(S!==null){if(b!==null){var M=b.next;b.next=S.next,S.next=M}o.baseQueue=b=S,p.pending=null}if(S=i.baseState,b===null)i.memoizedState=S;else{o=b.next;var Q=M=null,me=null,Oe=o,$e=!1;do{var Ge=Oe.lane&-536870913;if(Ge!==Oe.lane?(Ln&Ge)===Ge:(jr&Ge)===Ge){var ke=Oe.revertLane;if(ke===0)me!==null&&(me=me.next={lane:0,revertLane:0,gesture:null,action:Oe.action,hasEagerState:Oe.hasEagerState,eagerState:Oe.eagerState,next:null}),Ge===v&&($e=!0);else if((jr&ke)===ke){Oe=Oe.next,ke===v&&($e=!0);continue}else Ge={lane:0,revertLane:Oe.revertLane,gesture:null,action:Oe.action,hasEagerState:Oe.hasEagerState,eagerState:Oe.eagerState,next:null},me===null?(Q=me=Ge,M=S):me=me.next=Ge,Rt.lanes|=ke,su|=ke;Ge=Oe.action,Va&&f(S,Ge),S=Oe.hasEagerState?Oe.eagerState:f(S,Ge)}else ke={lane:Ge,revertLane:Oe.revertLane,gesture:Oe.gesture,action:Oe.action,hasEagerState:Oe.hasEagerState,eagerState:Oe.eagerState,next:null},me===null?(Q=me=ke,M=S):me=me.next=ke,Rt.lanes|=Ge,su|=Ge;Oe=Oe.next}while(Oe!==null&&Oe!==o);if(me===null?M=S:me.next=Q,!Cr(S,i.memoizedState)&&(fa=!0,$e&&(f=w,f!==null)))throw f;i.memoizedState=S,i.baseState=M,i.baseQueue=me,p.lastRenderedState=S}return b===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function qc(i){var o=Or(),f=o.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=i;var p=f.dispatch,b=f.pending,S=o.memoizedState;if(b!==null){f.pending=null;var M=b=b.next;do S=i(S,M.action),M=M.next;while(M!==b);Cr(S,o.memoizedState)||(fa=!0),o.memoizedState=S,o.baseQueue===null&&(o.baseState=S),f.lastRenderedState=S}return[S,p]}function Hc(i,o,f){var p=Rt,b=Or(),S=Nn;if(S){if(f===void 0)throw Error(r(407));f=f()}else f=o();var M=!Cr((Pt||b).memoizedState,f);if(M&&(b.memoizedState=f,fa=!0),b=b.queue,Xg(uh.bind(null,p,b,i),[i]),b.getSnapshot!==o||M||Mn!==null&&Mn.memoizedState.tag&1){if(p.flags|=2048,pl(9,{destroy:void 0},lh.bind(null,p,b,f,o),null),dr===null)throw Error(r(349));S||(jr&127)!==0||zs(p,o,f)}return f}function zs(i,o,f){i.flags|=16384,i={getSnapshot:o,value:f},o=Rt.updateQueue,o===null?(o=Yu(),Rt.updateQueue=o,o.stores=[i]):(f=o.stores,f===null?o.stores=[i]:f.push(i))}function lh(i,o,f,p){o.value=f,o.getSnapshot=p,Wd(o)&&ch(i)}function uh(i,o,f){return f(function(){Wd(o)&&ch(i)})}function Wd(i){var o=i.getSnapshot;i=i.value;try{var f=o();return!Cr(i,f)}catch{return!0}}function ch(i){var o=Us(i,2);o!==null&&Ii(o,i,2)}function No(i){var o=ca();if(typeof i=="function"){var f=i;if(i=f(),Va){Tt(!0);try{f()}finally{Tt(!1)}}}return o.memoizedState=o.baseState=i,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:i},o}function Yd(i,o,f,p){return i.baseState=f,tu(i,Pt,typeof p=="function"?p:ms)}function Kd(i,o,f,p,b){if(Qd(i))throw Error(r(485));if(i=o.action,i!==null){var S={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(M){S.listeners.push(M)}};te.T!==null?f(!0):S.isTransition=!1,p(S),f=o.pending,f===null?(S.next=o.pending=S,Jd(o,S)):(S.next=f.next,o.pending=f.next=S)}}function Jd(i,o){var f=o.action,p=o.payload,b=i.state;if(o.isTransition){var S=te.T,M={};te.T=M;try{var Q=f(b,p),me=te.S;me!==null&&me(M,Q),fh(i,o,Q)}catch(Oe){dl(i,o,Oe)}finally{S!==null&&M.types!==null&&(S.types=M.types),te.T=S}}else try{S=f(b,p),fh(i,o,S)}catch(Oe){dl(i,o,Oe)}}function fh(i,o,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(p){Xd(i,o,p)},function(p){return dl(i,o,p)}):Xd(i,o,f)}function Xd(i,o,f){o.status="fulfilled",o.value=f,Vc(o),i.state=f,o=i.pending,o!==null&&(f=o.next,f===o?i.pending=null:(f=f.next,o.next=f,Jd(i,f)))}function dl(i,o,f){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do o.status="rejected",o.reason=f,Vc(o),o=o.next;while(o!==p)}i.action=null}function Vc(i){i=i.listeners;for(var o=0;o<i.length;o++)(0,i[o])()}function Ku(i,o){return o}function gs(i,o){if(Nn){var f=dr.formState;if(f!==null){e:{var p=Rt;if(Nn){if(fr){t:{for(var b=fr,S=Lr;b.nodeType!==8;){if(!S){b=null;break t}if(b=vs(b.nextSibling),b===null){b=null;break t}}S=b.data,b=S==="F!"||S==="F"?b:null}if(b){fr=vs(b.nextSibling),p=b.data==="F!";break e}}yo(p)}p=!1}p&&(o=f[0])}}return f=ca(),f.memoizedState=f.baseState=o,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ku,lastRenderedState:o},f.queue=p,f=C2.bind(null,Rt,p),p.dispatch=f,p=No(!1),S=n0.bind(null,Rt,!1,p.queue),p=ca(),b={state:o,dispatch:null,action:i,pending:null},p.queue=b,f=Kd.bind(null,Rt,b,S,f),b.dispatch=f,p.memoizedState=i,[o,f,!1]}function qs(i){var o=Or();return Hs(o,Pt,i)}function Hs(i,o,f){if(o=tu(i,o,Ku)[0],i=zc(ms)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var p=Ao(o)}catch(M){throw M===be?ce:M}else p=o;o=Or();var b=o.queue,S=b.dispatch;return f!==o.memoizedState&&(Rt.flags|=2048,pl(9,{destroy:void 0},Gc.bind(null,b,f),null)),[p,S,i]}function Gc(i,o){i.action=o}function Wc(i){var o=Or(),f=Pt;if(f!==null)return Hs(o,f,i);Or(),o=o.memoizedState,f=Or();var p=f.queue.dispatch;return f.memoizedState=i,[o,p,!1]}function pl(i,o,f,p){return i={tag:i,create:f,deps:p,inst:o,next:null},o=Rt.updateQueue,o===null&&(o=Yu(),Rt.updateQueue=o),f=o.lastEffect,f===null?o.lastEffect=i.next=i:(p=f.next,f.next=i,i.next=p,o.lastEffect=i),i}function Zd(){return Or().memoizedState}function nu(i,o,f,p){var b=ca();Rt.flags|=i,b.memoizedState=pl(1|o,{destroy:void 0},f,p===void 0?null:p)}function ru(i,o,f,p){var b=Or();p=p===void 0?null:p;var S=b.memoizedState.inst;Pt!==null&&p!==null&&ah(p,Pt.memoizedState.deps)?b.memoizedState=pl(o,S,f,p):(Rt.flags|=i,b.memoizedState=pl(1|o,S,f,p))}function d2(i,o){nu(8390656,8,i,o)}function Xg(i,o){ru(2048,8,i,o)}function r6(i){Rt.flags|=4;var o=Rt.updateQueue;if(o===null)o=Yu(),Rt.updateQueue=o,o.events=[i];else{var f=o.events;f===null?o.events=[i]:f.push(i)}}function p2(i){var o=Or().memoizedState;return r6({ref:o,nextImpl:i}),function(){if((Wn&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}function m2(i,o){return ru(4,2,i,o)}function g2(i,o){return ru(4,4,i,o)}function v2(i,o){if(typeof o=="function"){i=i();var f=o(i);return function(){typeof f=="function"?f():o(null)}}if(o!=null)return i=i(),o.current=i,function(){o.current=null}}function y2(i,o,f){f=f!=null?f.concat([i]):null,ru(4,4,v2.bind(null,o,i),f)}function Zg(){}function b2(i,o){var f=Or();o=o===void 0?null:o;var p=f.memoizedState;return o!==null&&ah(o,p[1])?p[0]:(f.memoizedState=[i,o],i)}function w2(i,o){var f=Or();o=o===void 0?null:o;var p=f.memoizedState;if(o!==null&&ah(o,p[1]))return p[0];if(p=i(),Va){Tt(!0);try{i()}finally{Tt(!1)}}return f.memoizedState=[p,o],p}function Qg(i,o,f){return f===void 0||(jr&1073741824)!==0&&(Ln&261930)===0?i.memoizedState=o:(i.memoizedState=f,i=xb(),Rt.lanes|=i,su|=i,f)}function x2(i,o,f,p){return Cr(f,o)?f:yn.current!==null?(i=Qg(i,f,p),Cr(i,o)||(fa=!0),i):(jr&42)===0||(jr&1073741824)!==0&&(Ln&261930)===0?(fa=!0,i.memoizedState=f):(i=xb(),Rt.lanes|=i,su|=i,o)}function S2(i,o,f,p,b){var S=oe.p;oe.p=S!==0&&8>S?S:8;var M=te.T,Q={};te.T=Q,n0(i,!1,o,f);try{var me=b(),Oe=te.S;if(Oe!==null&&Oe(Q,me),me!==null&&typeof me=="object"&&typeof me.then=="function"){var $e=H(me,p);hh(i,o,$e,ts(i))}else hh(i,o,p,ts(i))}catch(Ge){hh(i,o,{then:function(){},status:"rejected",reason:Ge},ts())}finally{oe.p=S,M!==null&&Q.types!==null&&(M.types=Q.types),te.T=M}}function a6(){}function e0(i,o,f,p){if(i.tag!==5)throw Error(r(476));var b=_2(i).queue;S2(i,b,o,le,f===null?a6:function(){return E2(i),f(p)})}function _2(i){var o=i.memoizedState;if(o!==null)return o;o={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:le},next:null};var f={};return o.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ms,lastRenderedState:f},next:null},i.memoizedState=o,i=i.alternate,i!==null&&(i.memoizedState=o),o}function E2(i){var o=_2(i);o.next===null&&(o=i.alternate.memoizedState),hh(i,o.next.queue,{},ts())}function t0(){return Sa(Lh)}function A2(){return Or().memoizedState}function N2(){return Or().memoizedState}function i6(i){for(var o=i.return;o!==null;){switch(o.tag){case 24:case 3:var f=ts();i=$t(f);var p=dn(o,i,f);p!==null&&(Ii(p,o,f),Vn(p,o,f)),o={cache:Ql()},i.payload=o;return}o=o.return}}function s6(i,o,f){var p=ts();f={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},Qd(i)?T2(o,f):(f=Tc(i,o,f,p),f!==null&&(Ii(f,i,p),L2(f,o,p)))}function C2(i,o,f){var p=ts();hh(i,o,f,p)}function hh(i,o,f,p){var b={lane:p,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(Qd(i))T2(o,b);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=o.lastRenderedReducer,S!==null))try{var M=o.lastRenderedState,Q=S(M,f);if(b.hasEagerState=!0,b.eagerState=Q,Cr(Q,M))return $u(i,o,b,0),dr===null&&Bu(),!1}catch{}finally{}if(f=Tc(i,o,b,p),f!==null)return Ii(f,i,p),L2(f,o,p),!0}return!1}function n0(i,o,f,p){if(p={lane:2,revertLane:D0(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Qd(i)){if(o)throw Error(r(479))}else o=Tc(i,f,p,2),o!==null&&Ii(o,i,2)}function Qd(i){var o=i.alternate;return i===Rt||o!==null&&o===Rt}function T2(i,o){Ri=ti=!0;var f=i.pending;f===null?o.next=o:(o.next=f.next,f.next=o),i.pending=o}function L2(i,o,f){if((f&4194048)!==0){var p=o.lanes;p&=i.pendingLanes,f|=p,o.lanes=f,Ba(i,f)}}var dh={readContext:Sa,use:eu,useCallback:ir,useContext:ir,useEffect:ir,useImperativeHandle:ir,useLayoutEffect:ir,useInsertionEffect:ir,useMemo:ir,useReducer:ir,useRef:ir,useState:ir,useDebugValue:ir,useDeferredValue:ir,useTransition:ir,useSyncExternalStore:ir,useId:ir,useHostTransitionStatus:ir,useFormState:ir,useActionState:ir,useOptimistic:ir,useMemoCache:ir,useCacheRefresh:ir};dh.useEffectEvent=ir;var j2={readContext:Sa,use:eu,useCallback:function(i,o){return ca().memoizedState=[i,o===void 0?null:o],i},useContext:Sa,useEffect:d2,useImperativeHandle:function(i,o,f){f=f!=null?f.concat([i]):null,nu(4194308,4,v2.bind(null,o,i),f)},useLayoutEffect:function(i,o){return nu(4194308,4,i,o)},useInsertionEffect:function(i,o){nu(4,2,i,o)},useMemo:function(i,o){var f=ca();o=o===void 0?null:o;var p=i();if(Va){Tt(!0);try{i()}finally{Tt(!1)}}return f.memoizedState=[p,o],p},useReducer:function(i,o,f){var p=ca();if(f!==void 0){var b=f(o);if(Va){Tt(!0);try{f(o)}finally{Tt(!1)}}}else b=o;return p.memoizedState=p.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},p.queue=i,i=i.dispatch=s6.bind(null,Rt,i),[p.memoizedState,i]},useRef:function(i){var o=ca();return i={current:i},o.memoizedState=i},useState:function(i){i=No(i);var o=i.queue,f=C2.bind(null,Rt,o);return o.dispatch=f,[i.memoizedState,f]},useDebugValue:Zg,useDeferredValue:function(i,o){var f=ca();return Qg(f,i,o)},useTransition:function(){var i=No(!1);return i=S2.bind(null,Rt,i.queue,!0,!1),ca().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,o,f){var p=Rt,b=ca();if(Nn){if(f===void 0)throw Error(r(407));f=f()}else{if(f=o(),dr===null)throw Error(r(349));(Ln&127)!==0||zs(p,o,f)}b.memoizedState=f;var S={value:f,getSnapshot:o};return b.queue=S,d2(uh.bind(null,p,S,i),[i]),p.flags|=2048,pl(9,{destroy:void 0},lh.bind(null,p,S,f,o),null),f},useId:function(){var i=ca(),o=dr.identifierPrefix;if(Nn){var f=ji,p=Li;f=(p&~(1<<32-mn(p)-1)).toString(32)+f,o="_"+o+"R_"+f,f=Vr++,0<f&&(o+="H"+f.toString(32)),o+="_"}else f=Uc++,o="_"+o+"r_"+f.toString(32)+"_";return i.memoizedState=o},useHostTransitionStatus:t0,useFormState:gs,useActionState:gs,useOptimistic:function(i){var o=ca();o.memoizedState=o.baseState=i;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=f,o=n0.bind(null,Rt,!0,f),f.dispatch=o,[i,o]},useMemoCache:hl,useCacheRefresh:function(){return ca().memoizedState=i6.bind(null,Rt)},useEffectEvent:function(i){var o=ca(),f={impl:i};return o.memoizedState=f,function(){if((Wn&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}},r0={readContext:Sa,use:eu,useCallback:b2,useContext:Sa,useEffect:Xg,useImperativeHandle:y2,useInsertionEffect:m2,useLayoutEffect:g2,useMemo:w2,useReducer:zc,useRef:Zd,useState:function(){return zc(ms)},useDebugValue:Zg,useDeferredValue:function(i,o){var f=Or();return x2(f,Pt.memoizedState,i,o)},useTransition:function(){var i=zc(ms)[0],o=Or().memoizedState;return[typeof i=="boolean"?i:Ao(i),o]},useSyncExternalStore:Hc,useId:A2,useHostTransitionStatus:t0,useFormState:qs,useActionState:qs,useOptimistic:function(i,o){var f=Or();return Yd(f,Pt,i,o)},useMemoCache:hl,useCacheRefresh:N2};r0.useEffectEvent=p2;var O2={readContext:Sa,use:eu,useCallback:b2,useContext:Sa,useEffect:Xg,useImperativeHandle:y2,useInsertionEffect:m2,useLayoutEffect:g2,useMemo:w2,useReducer:qc,useRef:Zd,useState:function(){return qc(ms)},useDebugValue:Zg,useDeferredValue:function(i,o){var f=Or();return Pt===null?Qg(f,i,o):x2(f,Pt.memoizedState,i,o)},useTransition:function(){var i=qc(ms)[0],o=Or().memoizedState;return[typeof i=="boolean"?i:Ao(i),o]},useSyncExternalStore:Hc,useId:A2,useHostTransitionStatus:t0,useFormState:Wc,useActionState:Wc,useOptimistic:function(i,o){var f=Or();return Pt!==null?Yd(f,Pt,i,o):(f.baseState=i,[i,f.queue.dispatch])},useMemoCache:hl,useCacheRefresh:N2};O2.useEffectEvent=p2;function a0(i,o,f,p){o=i.memoizedState,f=f(p,o),f=f==null?o:m({},o,f),i.memoizedState=f,i.lanes===0&&(i.updateQueue.baseState=f)}var i0={enqueueSetState:function(i,o,f){i=i._reactInternals;var p=ts(),b=$t(p);b.payload=o,f!=null&&(b.callback=f),o=dn(i,b,p),o!==null&&(Ii(o,i,p),Vn(o,i,p))},enqueueReplaceState:function(i,o,f){i=i._reactInternals;var p=ts(),b=$t(p);b.tag=1,b.payload=o,f!=null&&(b.callback=f),o=dn(i,b,p),o!==null&&(Ii(o,i,p),Vn(o,i,p))},enqueueForceUpdate:function(i,o){i=i._reactInternals;var f=ts(),p=$t(f);p.tag=2,o!=null&&(p.callback=o),o=dn(i,p,f),o!==null&&(Ii(o,i,f),Vn(o,i,f))}};function R2(i,o,f,p,b,S,M){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,S,M):o.prototype&&o.prototype.isPureReactComponent?!qa(f,p)||!qa(b,S):!0}function k2(i,o,f,p){i=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,p),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,p),o.state!==i&&i0.enqueueReplaceState(o,o.state,null)}function Ju(i,o){var f=o;if("ref"in o){f={};for(var p in o)p!=="ref"&&(f[p]=o[p])}if(i=i.defaultProps){f===o&&(f=m({},f));for(var b in i)f[b]===void 0&&(f[b]=i[b])}return f}function D2(i){Uu(i)}function P2(i){console.error(i)}function M2(i){Uu(i)}function ep(i,o){try{var f=i.onUncaughtError;f(o.value,{componentStack:o.stack})}catch(p){setTimeout(function(){throw p})}}function I2(i,o,f){try{var p=i.onCaughtError;p(f.value,{componentStack:f.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function s0(i,o,f){return f=$t(f),f.tag=3,f.payload={element:null},f.callback=function(){ep(i,o)},f}function F2(i){return i=$t(i),i.tag=3,i}function U2(i,o,f,p){var b=f.type.getDerivedStateFromError;if(typeof b=="function"){var S=p.value;i.payload=function(){return b(S)},i.callback=function(){I2(o,f,p)}}var M=f.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(i.callback=function(){I2(o,f,p),typeof b!="function"&&(ou===null?ou=new Set([this]):ou.add(this));var Q=p.stack;this.componentDidCatch(p.value,{componentStack:Q!==null?Q:""})})}function o6(i,o,f,p,b){if(f.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(o=f.alternate,o!==null&&xo(o,f,b,!0),f=Sr.current,f!==null){switch(f.tag){case 31:case 13:return Pn===null?hp():f.alternate===null&&Gr===0&&(Gr=3),f.flags&=-257,f.flags|=65536,f.lanes=b,p===Se?f.flags|=16384:(o=f.updateQueue,o===null?f.updateQueue=new Set([p]):o.add(p),O0(i,p,b)),!1;case 22:return f.flags|=65536,p===Se?f.flags|=16384:(o=f.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([p])},f.updateQueue=o):(f=o.retryQueue,f===null?o.retryQueue=new Set([p]):f.add(p)),O0(i,p,b)),!1}throw Error(r(435,f.tag))}return O0(i,p,b),hp(),!1}if(Nn)return o=Sr.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=b,p!==Zi&&(i=Error(r(422),{cause:p}),Xl(Ni(i,f)))):(p!==Zi&&(o=Error(r(423),{cause:p}),Xl(Ni(o,f))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,p=Ni(p,f),b=s0(i.stateNode,p,b),Zr(i,b),Gr!==4&&(Gr=2)),!1;var S=Error(r(520),{cause:p});if(S=Ni(S,f),xh===null?xh=[S]:xh.push(S),Gr!==4&&(Gr=2),o===null)return!0;p=Ni(p,f),f=o;do{switch(f.tag){case 3:return f.flags|=65536,i=b&-b,f.lanes|=i,i=s0(f.stateNode,p,i),Zr(f,i),!1;case 1:if(o=f.type,S=f.stateNode,(f.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(ou===null||!ou.has(S))))return f.flags|=65536,b&=-b,f.lanes|=b,b=F2(b),U2(b,i,f,p),Zr(f,b),!1}f=f.return}while(f!==null);return!1}var o0=Error(r(461)),fa=!1;function Ga(i,o,f,p){o.child=i===null?on(o,null,f,p):hr(o,i.child,f,p)}function B2(i,o,f,p,b){f=f.render;var S=o.ref;if("ref"in p){var M={};for(var Q in p)Q!=="ref"&&(M[Q]=p[Q])}else M=p;return So(o),p=ih(i,o,f,M,S,b),Q=sh(),i!==null&&!fa?(oh(i,o,b),ml(i,o,b)):(Nn&&Q&&th(o),o.flags|=1,Ga(i,o,p,b),o.child)}function $2(i,o,f,p,b){if(i===null){var S=f.type;return typeof S=="function"&&!jc(S)&&S.defaultProps===void 0&&f.compare===null?(o.tag=15,o.type=S,z2(i,o,S,p,b)):(i=Yl(f.type,null,p,o,o.mode,b),i.ref=o.ref,i.return=o,o.child=i)}if(S=i.child,!m0(i,b)){var M=S.memoizedProps;if(f=f.compare,f=f!==null?f:qa,f(M,p)&&i.ref===o.ref)return ml(i,o,b)}return o.flags|=1,i=Ai(S,p),i.ref=o.ref,i.return=o,o.child=i}function z2(i,o,f,p,b){if(i!==null){var S=i.memoizedProps;if(qa(S,p)&&i.ref===o.ref)if(fa=!1,o.pendingProps=p=S,m0(i,b))(i.flags&131072)!==0&&(fa=!0);else return o.lanes=i.lanes,ml(i,o,b)}return l0(i,o,f,p,b)}function q2(i,o,f,p){var b=p.children,S=i!==null?i.memoizedState:null;if(i===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((o.flags&128)!==0){if(S=S!==null?S.baseLanes|f:f,i!==null){for(p=o.child=i.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~S}else p=0,o.child=null;return H2(i,o,S,f,p)}if((f&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},i!==null&&ae(o,S!==null?S.cachePool:null),S!==null?xr(o,S):Un(),qr(o);else return p=o.lanes=536870912,H2(i,o,S!==null?S.baseLanes|f:f,f,p)}else S!==null?(ae(o,S.cachePool),xr(o,S),Hr(),o.memoizedState=null):(i!==null&&ae(o,null),Un(),Hr());return Ga(i,o,b,f),o.child}function ph(i,o){return i!==null&&i.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function H2(i,o,f,p,b){var S=re();return S=S===null?null:{parent:Pr._currentValue,pool:S},o.memoizedState={baseLanes:f,cachePool:S},i!==null&&ae(o,null),Un(),qr(o),i!==null&&xo(i,o,p,!0),o.childLanes=b,null}function tp(i,o){return o=rp({mode:o.mode,children:o.children},i.mode),o.ref=i.ref,i.child=o,o.return=i,o}function V2(i,o,f){return hr(o,i.child,null,f),i=tp(o,o.pendingProps),i.flags|=2,er(o),o.memoizedState=null,i}function l6(i,o,f){var p=o.pendingProps,b=(o.flags&128)!==0;if(o.flags&=-129,i===null){if(Nn){if(p.mode==="hidden")return i=tp(o,p),o.lanes=536870912,ph(null,i);if(Gn(o),(i=fr)?(i=r5(i,Lr),i=i!==null&&i.data==="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:vo!==null?{id:Li,overflow:ji}:null,retryLane:536870912,hydrationErrors:null},f=Oc(i),f.return=o,o.child=f,wa=o,fr=null)):i=null,i===null)throw yo(o);return o.lanes=536870912,null}return tp(o,p)}var S=i.memoizedState;if(S!==null){var M=S.dehydrated;if(Gn(o),b)if(o.flags&256)o.flags&=-257,o=V2(i,o,f);else if(o.memoizedState!==null)o.child=i.child,o.flags|=128,o=null;else throw Error(r(558));else if(fa||xo(i,o,f,!1),b=(f&i.childLanes)!==0,fa||b){if(p=dr,p!==null&&(M=de(p,f),M!==0&&M!==S.retryLane))throw S.retryLane=M,Us(i,M),Ii(p,i,M),o0;hp(),o=V2(i,o,f)}else i=S.treeContext,fr=vs(M.nextSibling),wa=o,Nn=!0,Ha=null,Lr=!1,i!==null&&Vd(o,i),o=tp(o,p),o.flags|=4096;return o}return i=Ai(i.child,{mode:p.mode,children:p.children}),i.ref=o.ref,o.child=i,i.return=o,i}function np(i,o){var f=o.ref;if(f===null)i!==null&&i.ref!==null&&(o.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(i===null||i.ref!==f)&&(o.flags|=4194816)}}function l0(i,o,f,p,b){return So(o),f=ih(i,o,f,p,void 0,b),p=sh(),i!==null&&!fa?(oh(i,o,b),ml(i,o,b)):(Nn&&p&&th(o),o.flags|=1,Ga(i,o,f,b),o.child)}function G2(i,o,f,p,b,S){return So(o),o.updateQueue=null,f=$s(o,p,f,b),Bc(i),p=sh(),i!==null&&!fa?(oh(i,o,S),ml(i,o,S)):(Nn&&p&&th(o),o.flags|=1,Ga(i,o,f,S),o.child)}function W2(i,o,f,p,b){if(So(o),o.stateNode===null){var S=ba,M=f.contextType;typeof M=="object"&&M!==null&&(S=Sa(M)),S=new f(p,S),o.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=i0,o.stateNode=S,S._reactInternals=o,S=o.stateNode,S.props=p,S.state=o.memoizedState,S.refs={},nt(o),M=f.contextType,S.context=typeof M=="object"&&M!==null?Sa(M):ba,S.state=o.memoizedState,M=f.getDerivedStateFromProps,typeof M=="function"&&(a0(o,f,M,p),S.state=o.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(M=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),M!==S.state&&i0.enqueueReplaceState(S,S.state,null),$r(o,p,S,b),ar(),S.state=o.memoizedState),typeof S.componentDidMount=="function"&&(o.flags|=4194308),p=!0}else if(i===null){S=o.stateNode;var Q=o.memoizedProps,me=Ju(f,Q);S.props=me;var Oe=S.context,$e=f.contextType;M=ba,typeof $e=="object"&&$e!==null&&(M=Sa($e));var Ge=f.getDerivedStateFromProps;$e=typeof Ge=="function"||typeof S.getSnapshotBeforeUpdate=="function",Q=o.pendingProps!==Q,$e||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(Q||Oe!==M)&&k2(o,S,p,M),ht=!1;var ke=o.memoizedState;S.state=ke,$r(o,p,S,b),ar(),Oe=o.memoizedState,Q||ke!==Oe||ht?(typeof Ge=="function"&&(a0(o,f,Ge,p),Oe=o.memoizedState),(me=ht||R2(o,f,me,p,ke,Oe,M))?($e||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(o.flags|=4194308)):(typeof S.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=p,o.memoizedState=Oe),S.props=p,S.state=Oe,S.context=M,p=me):(typeof S.componentDidMount=="function"&&(o.flags|=4194308),p=!1)}else{S=o.stateNode,wr(i,o),M=o.memoizedProps,$e=Ju(f,M),S.props=$e,Ge=o.pendingProps,ke=S.context,Oe=f.contextType,me=ba,typeof Oe=="object"&&Oe!==null&&(me=Sa(Oe)),Q=f.getDerivedStateFromProps,(Oe=typeof Q=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(M!==Ge||ke!==me)&&k2(o,S,p,me),ht=!1,ke=o.memoizedState,S.state=ke,$r(o,p,S,b),ar();var Me=o.memoizedState;M!==Ge||ke!==Me||ht||i!==null&&i.dependencies!==null&&Mc(i.dependencies)?(typeof Q=="function"&&(a0(o,f,Q,p),Me=o.memoizedState),($e=ht||R2(o,f,$e,p,ke,Me,me)||i!==null&&i.dependencies!==null&&Mc(i.dependencies))?(Oe||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(p,Me,me),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(p,Me,me)),typeof S.componentDidUpdate=="function"&&(o.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof S.componentDidUpdate!="function"||M===i.memoizedProps&&ke===i.memoizedState||(o.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===i.memoizedProps&&ke===i.memoizedState||(o.flags|=1024),o.memoizedProps=p,o.memoizedState=Me),S.props=p,S.state=Me,S.context=me,p=$e):(typeof S.componentDidUpdate!="function"||M===i.memoizedProps&&ke===i.memoizedState||(o.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||M===i.memoizedProps&&ke===i.memoizedState||(o.flags|=1024),p=!1)}return S=p,np(i,o),p=(o.flags&128)!==0,S||p?(S=o.stateNode,f=p&&typeof f.getDerivedStateFromError!="function"?null:S.render(),o.flags|=1,i!==null&&p?(o.child=hr(o,i.child,null,b),o.child=hr(o,null,f,b)):Ga(i,o,f,b),o.memoizedState=S.state,i=o.child):i=ml(i,o,b),i}function Y2(i,o,f,p){return cl(),o.flags|=256,Ga(i,o,f,p),o.child}var u0={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function c0(i){return{baseLanes:i,cachePool:fe()}}function f0(i,o,f){return i=i!==null?i.childLanes&~f:0,o&&(i|=es),i}function K2(i,o,f){var p=o.pendingProps,b=!1,S=(o.flags&128)!==0,M;if((M=S)||(M=i!==null&&i.memoizedState===null?!1:(On.current&2)!==0),M&&(b=!0,o.flags&=-129),M=(o.flags&32)!==0,o.flags&=-33,i===null){if(Nn){if(b?Mr(o):Hr(),(i=fr)?(i=r5(i,Lr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(o.memoizedState={dehydrated:i,treeContext:vo!==null?{id:Li,overflow:ji}:null,retryLane:536870912,hydrationErrors:null},f=Oc(i),f.return=o,o.child=f,wa=o,fr=null)):i=null,i===null)throw yo(o);return W0(i)?o.lanes=32:o.lanes=536870912,null}var Q=p.children;return p=p.fallback,b?(Hr(),b=o.mode,Q=rp({mode:"hidden",children:Q},b),p=go(p,b,f,null),Q.return=o,p.return=o,Q.sibling=p,o.child=Q,p=o.child,p.memoizedState=c0(f),p.childLanes=f0(i,M,f),o.memoizedState=u0,ph(null,p)):(Mr(o),h0(o,Q))}var me=i.memoizedState;if(me!==null&&(Q=me.dehydrated,Q!==null)){if(S)o.flags&256?(Mr(o),o.flags&=-257,o=d0(i,o,f)):o.memoizedState!==null?(Hr(),o.child=i.child,o.flags|=128,o=null):(Hr(),Q=p.fallback,b=o.mode,p=rp({mode:"visible",children:p.children},b),Q=go(Q,b,f,null),Q.flags|=2,p.return=o,Q.return=o,p.sibling=Q,o.child=p,hr(o,i.child,null,f),p=o.child,p.memoizedState=c0(f),p.childLanes=f0(i,M,f),o.memoizedState=u0,o=ph(null,p));else if(Mr(o),W0(Q)){if(M=Q.nextSibling&&Q.nextSibling.dataset,M)var Oe=M.dgst;M=Oe,p=Error(r(419)),p.stack="",p.digest=M,Xl({value:p,source:null,stack:null}),o=d0(i,o,f)}else if(fa||xo(i,o,f,!1),M=(f&i.childLanes)!==0,fa||M){if(M=dr,M!==null&&(p=de(M,f),p!==0&&p!==me.retryLane))throw me.retryLane=p,Us(i,p),Ii(M,i,p),o0;G0(Q)||hp(),o=d0(i,o,f)}else G0(Q)?(o.flags|=192,o.child=i.child,o=null):(i=me.treeContext,fr=vs(Q.nextSibling),wa=o,Nn=!0,Ha=null,Lr=!1,i!==null&&Vd(o,i),o=h0(o,p.children),o.flags|=4096);return o}return b?(Hr(),Q=p.fallback,b=o.mode,me=i.child,Oe=me.sibling,p=Ai(me,{mode:"hidden",children:p.children}),p.subtreeFlags=me.subtreeFlags&65011712,Oe!==null?Q=Ai(Oe,Q):(Q=go(Q,b,f,null),Q.flags|=2),Q.return=o,p.return=o,p.sibling=Q,o.child=p,ph(null,p),p=o.child,Q=i.child.memoizedState,Q===null?Q=c0(f):(b=Q.cachePool,b!==null?(me=Pr._currentValue,b=b.parent!==me?{parent:me,pool:me}:b):b=fe(),Q={baseLanes:Q.baseLanes|f,cachePool:b}),p.memoizedState=Q,p.childLanes=f0(i,M,f),o.memoizedState=u0,ph(i.child,p)):(Mr(o),f=i.child,i=f.sibling,f=Ai(f,{mode:"visible",children:p.children}),f.return=o,f.sibling=null,i!==null&&(M=o.deletions,M===null?(o.deletions=[i],o.flags|=16):M.push(i)),o.child=f,o.memoizedState=null,f)}function h0(i,o){return o=rp({mode:"visible",children:o},i.mode),o.return=i,i.child=o}function rp(i,o){return i=Da(22,i,null,o),i.lanes=0,i}function d0(i,o,f){return hr(o,i.child,null,f),i=h0(o,o.pendingProps.children),i.flags|=2,o.memoizedState=null,i}function J2(i,o,f){i.lanes|=o;var p=i.alternate;p!==null&&(p.lanes|=o),Zl(i.return,o,f)}function p0(i,o,f,p,b,S){var M=i.memoizedState;M===null?i.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:p,tail:f,tailMode:b,treeForkCount:S}:(M.isBackwards=o,M.rendering=null,M.renderingStartTime=0,M.last=p,M.tail=f,M.tailMode=b,M.treeForkCount=S)}function X2(i,o,f){var p=o.pendingProps,b=p.revealOrder,S=p.tail;p=p.children;var M=On.current,Q=(M&2)!==0;if(Q?(M=M&1|2,o.flags|=128):M&=1,V(On,M),Ga(i,o,p,f),p=Nn?Vu:0,!Q&&i!==null&&(i.flags&128)!==0)e:for(i=o.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&J2(i,f,o);else if(i.tag===19)J2(i,f,o);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===o)break e;for(;i.sibling===null;){if(i.return===null||i.return===o)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(b){case"forwards":for(f=o.child,b=null;f!==null;)i=f.alternate,i!==null&&Ma(i)===null&&(b=f),f=f.sibling;f=b,f===null?(b=o.child,o.child=null):(b=f.sibling,f.sibling=null),p0(o,!1,b,f,S,p);break;case"backwards":case"unstable_legacy-backwards":for(f=null,b=o.child,o.child=null;b!==null;){if(i=b.alternate,i!==null&&Ma(i)===null){o.child=b;break}i=b.sibling,b.sibling=f,f=b,b=i}p0(o,!0,f,null,S,p);break;case"together":p0(o,!1,null,null,void 0,p);break;default:o.memoizedState=null}return o.child}function ml(i,o,f){if(i!==null&&(o.dependencies=i.dependencies),su|=o.lanes,(f&o.childLanes)===0)if(i!==null){if(xo(i,o,f,!1),(f&o.childLanes)===0)return null}else return null;if(i!==null&&o.child!==i.child)throw Error(r(153));if(o.child!==null){for(i=o.child,f=Ai(i,i.pendingProps),o.child=f,f.return=o;i.sibling!==null;)i=i.sibling,f=f.sibling=Ai(i,i.pendingProps),f.return=o;f.sibling=null}return o.child}function m0(i,o){return(i.lanes&o)!==0?!0:(i=i.dependencies,!!(i!==null&&Mc(i)))}function u6(i,o,f){switch(o.tag){case 3:ge(o,o.stateNode.containerInfo),wo(o,Pr,i.memoizedState.cache),cl();break;case 27:case 5:Re(o);break;case 4:ge(o,o.stateNode.containerInfo);break;case 10:wo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,Gn(o),null;break;case 13:var p=o.memoizedState;if(p!==null)return p.dehydrated!==null?(Mr(o),o.flags|=128,null):(f&o.child.childLanes)!==0?K2(i,o,f):(Mr(o),i=ml(i,o,f),i!==null?i.sibling:null);Mr(o);break;case 19:var b=(i.flags&128)!==0;if(p=(f&o.childLanes)!==0,p||(xo(i,o,f,!1),p=(f&o.childLanes)!==0),b){if(p)return X2(i,o,f);o.flags|=128}if(b=o.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),V(On,On.current),p)break;return null;case 22:return o.lanes=0,q2(i,o,f,o.pendingProps);case 24:wo(o,Pr,i.memoizedState.cache)}return ml(i,o,f)}function Z2(i,o,f){if(i!==null)if(i.memoizedProps!==o.pendingProps)fa=!0;else{if(!m0(i,f)&&(o.flags&128)===0)return fa=!1,u6(i,o,f);fa=(i.flags&131072)!==0}else fa=!1,Nn&&(o.flags&1048576)!==0&&Hd(o,Vu,o.index);switch(o.lanes=0,o.tag){case 16:e:{var p=o.pendingProps;if(i=Te(o.elementType),o.type=i,typeof i=="function")jc(i)?(p=Ju(i,p),o.tag=1,o=W2(null,o,i,p,f)):(o.tag=0,o=l0(null,o,i,p,f));else{if(i!=null){var b=i.$$typeof;if(b===R){o.tag=11,o=B2(null,o,i,p,f);break e}else if(b===G){o.tag=14,o=$2(null,o,i,p,f);break e}}throw o=Y(i)||i,Error(r(306,o,""))}}return o;case 0:return l0(i,o,o.type,o.pendingProps,f);case 1:return p=o.type,b=Ju(p,o.pendingProps),W2(i,o,p,b,f);case 3:e:{if(ge(o,o.stateNode.containerInfo),i===null)throw Error(r(387));p=o.pendingProps;var S=o.memoizedState;b=S.element,wr(i,o),$r(o,p,null,f);var M=o.memoizedState;if(p=M.cache,wo(o,Pr,p),p!==S.cache&&fl(o,[Pr],f,!0),ar(),p=M.element,S.isDehydrated)if(S={element:p,isDehydrated:!1,cache:M.cache},o.updateQueue.baseState=S,o.memoizedState=S,o.flags&256){o=Y2(i,o,p,f);break e}else if(p!==b){b=Ni(Error(r(424)),o),Xl(b),o=Y2(i,o,p,f);break e}else{switch(i=o.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(fr=vs(i.firstChild),wa=o,Nn=!0,Ha=null,Lr=!0,f=on(o,null,p,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(cl(),p===b){o=ml(i,o,f);break e}Ga(i,o,p,f)}o=o.child}return o;case 26:return np(i,o),i===null?(f=u5(o.type,null,o.pendingProps,null))?o.memoizedState=f:Nn||(f=o.type,i=o.pendingProps,p=bp(z.current).createElement(f),p[et]=o,p[ct]=i,Wa(p,f,i),wn(p),o.stateNode=p):o.memoizedState=u5(o.type,i.memoizedProps,o.pendingProps,i.memoizedState),null;case 27:return Re(o),i===null&&Nn&&(p=o.stateNode=s5(o.type,o.pendingProps,z.current),wa=o,Lr=!0,b=fr,fu(o.type)?(Y0=b,fr=vs(p.firstChild)):fr=b),Ga(i,o,o.pendingProps.children,f),np(i,o),i===null&&(o.flags|=4194304),o.child;case 5:return i===null&&Nn&&((b=p=fr)&&(p=U6(p,o.type,o.pendingProps,Lr),p!==null?(o.stateNode=p,wa=o,fr=vs(p.firstChild),Lr=!1,b=!0):b=!1),b||yo(o)),Re(o),b=o.type,S=o.pendingProps,M=i!==null?i.memoizedProps:null,p=S.children,q0(b,S)?p=null:M!==null&&q0(b,M)&&(o.flags|=32),o.memoizedState!==null&&(b=ih(i,o,Jg,null,null,f),Lh._currentValue=b),np(i,o),Ga(i,o,p,f),o.child;case 6:return i===null&&Nn&&((i=f=fr)&&(f=B6(f,o.pendingProps,Lr),f!==null?(o.stateNode=f,wa=o,fr=null,i=!0):i=!1),i||yo(o)),null;case 13:return K2(i,o,f);case 4:return ge(o,o.stateNode.containerInfo),p=o.pendingProps,i===null?o.child=hr(o,null,p,f):Ga(i,o,p,f),o.child;case 11:return B2(i,o,o.type,o.pendingProps,f);case 7:return Ga(i,o,o.pendingProps,f),o.child;case 8:return Ga(i,o,o.pendingProps.children,f),o.child;case 12:return Ga(i,o,o.pendingProps.children,f),o.child;case 10:return p=o.pendingProps,wo(o,o.type,p.value),Ga(i,o,p.children,f),o.child;case 9:return b=o.type._context,p=o.pendingProps.children,So(o),b=Sa(b),p=p(b),o.flags|=1,Ga(i,o,p,f),o.child;case 14:return $2(i,o,o.type,o.pendingProps,f);case 15:return z2(i,o,o.type,o.pendingProps,f);case 19:return X2(i,o,f);case 31:return l6(i,o,f);case 22:return q2(i,o,f,o.pendingProps);case 24:return So(o),p=Sa(Pr),i===null?(b=re(),b===null&&(b=dr,S=Ql(),b.pooledCache=S,S.refCount++,S!==null&&(b.pooledCacheLanes|=f),b=S),o.memoizedState={parent:p,cache:b},nt(o),wo(o,Pr,b)):((i.lanes&f)!==0&&(wr(i,o),$r(o,null,null,f),ar()),b=i.memoizedState,S=o.memoizedState,b.parent!==p?(b={parent:p,cache:p},o.memoizedState=b,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=b),wo(o,Pr,p)):(p=S.cache,wo(o,Pr,p),p!==b.cache&&fl(o,[Pr],f,!0))),Ga(i,o,o.pendingProps.children,f),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function gl(i){i.flags|=4}function g0(i,o,f,p,b){if((o=(i.mode&32)!==0)&&(o=!1),o){if(i.flags|=16777216,(b&335544128)===b)if(i.stateNode.complete)i.flags|=8192;else if(Ab())i.flags|=8192;else throw Ie=Se,Le}else i.flags&=-16777217}function Q2(i,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!p5(o))if(Ab())i.flags|=8192;else throw Ie=Se,Le}function ap(i,o){o!==null&&(i.flags|=4),i.flags&16384&&(o=i.tag!==22?ci():536870912,i.lanes|=o,Xc|=o)}function mh(i,o){if(!Nn)switch(i.tailMode){case"hidden":o=i.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?i.tail=null:f.sibling=null;break;case"collapsed":f=i.tail;for(var p=null;f!==null;)f.alternate!==null&&(p=f),f=f.sibling;p===null?o||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function _r(i){var o=i.alternate!==null&&i.alternate.child===i.child,f=0,p=0;if(o)for(var b=i.child;b!==null;)f|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)f|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=p,i.childLanes=f,o}function c6(i,o,f){var p=o.pendingProps;switch(Dc(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _r(o),null;case 1:return _r(o),null;case 3:return f=o.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),o.memoizedState.cache!==p&&(o.flags|=2048),Oi(Pr),xe(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(i===null||i.child===null)&&(xa(o)?gl(o):i===null||i.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,rh())),_r(o),null;case 26:var b=o.type,S=o.memoizedState;return i===null?(gl(o),S!==null?(_r(o),Q2(o,S)):(_r(o),g0(o,b,null,p,f))):S?S!==i.memoizedState?(gl(o),_r(o),Q2(o,S)):(_r(o),o.flags&=-16777217):(i=i.memoizedProps,i!==p&&gl(o),_r(o),g0(o,b,i,p,f)),null;case 27:if(De(o),f=z.current,b=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==p&&gl(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return _r(o),null}i=Z.current,xa(o)?nh(o):(i=s5(b,p,f),o.stateNode=i,gl(o))}return _r(o),null;case 5:if(De(o),b=o.type,i!==null&&o.stateNode!=null)i.memoizedProps!==p&&gl(o);else{if(!p){if(o.stateNode===null)throw Error(r(166));return _r(o),null}if(S=Z.current,xa(o))nh(o);else{var M=bp(z.current);switch(S){case 1:S=M.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:S=M.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":S=M.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":S=M.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":S=M.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof p.is=="string"?M.createElement("select",{is:p.is}):M.createElement("select"),p.multiple?S.multiple=!0:p.size&&(S.size=p.size);break;default:S=typeof p.is=="string"?M.createElement(b,{is:p.is}):M.createElement(b)}}S[et]=o,S[ct]=p;e:for(M=o.child;M!==null;){if(M.tag===5||M.tag===6)S.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===o)break e;for(;M.sibling===null;){if(M.return===null||M.return===o)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}o.stateNode=S;e:switch(Wa(S,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&gl(o)}}return _r(o),g0(o,o.type,i===null?null:i.memoizedProps,o.pendingProps,f),null;case 6:if(i&&o.stateNode!=null)i.memoizedProps!==p&&gl(o);else{if(typeof p!="string"&&o.stateNode===null)throw Error(r(166));if(i=z.current,xa(o)){if(i=o.stateNode,f=o.memoizedProps,p=null,b=wa,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}i[et]=o,i=!!(i.nodeValue===f||p!==null&&p.suppressHydrationWarning===!0||Kb(i.nodeValue,f)),i||yo(o,!0)}else i=bp(i).createTextNode(p),i[et]=o,o.stateNode=i}return _r(o),null;case 31:if(f=o.memoizedState,i===null||i.memoizedState!==null){if(p=xa(o),f!==null){if(i===null){if(!p)throw Error(r(318));if(i=o.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[et]=o}else cl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;_r(o),i=!1}else f=rh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),i=!0;if(!i)return o.flags&256?(er(o),o):(er(o),null);if((o.flags&128)!==0)throw Error(r(558))}return _r(o),null;case 13:if(p=o.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=xa(o),p!==null&&p.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=o.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[et]=o}else cl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;_r(o),b=!1}else b=rh(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return o.flags&256?(er(o),o):(er(o),null)}return er(o),(o.flags&128)!==0?(o.lanes=f,o):(f=p!==null,i=i!==null&&i.memoizedState!==null,f&&(p=o.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),S=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(S=p.memoizedState.cachePool.pool),S!==b&&(p.flags|=2048)),f!==i&&f&&(o.child.flags|=8192),ap(o,o.updateQueue),_r(o),null);case 4:return xe(),i===null&&F0(o.stateNode.containerInfo),_r(o),null;case 10:return Oi(o.type),_r(o),null;case 19:if(O(On),p=o.memoizedState,p===null)return _r(o),null;if(b=(o.flags&128)!==0,S=p.rendering,S===null)if(b)mh(p,!1);else{if(Gr!==0||i!==null&&(i.flags&128)!==0)for(i=o.child;i!==null;){if(S=Ma(i),S!==null){for(o.flags|=128,mh(p,!1),i=S.updateQueue,o.updateQueue=i,ap(o,i),o.subtreeFlags=0,i=f,f=o.child;f!==null;)qu(f,i),f=f.sibling;return V(On,On.current&1|2),Nn&&mi(o,p.treeForkCount),o.child}i=i.sibling}p.tail!==null&&en()>up&&(o.flags|=128,b=!0,mh(p,!1),o.lanes=4194304)}else{if(!b)if(i=Ma(S),i!==null){if(o.flags|=128,b=!0,i=i.updateQueue,o.updateQueue=i,ap(o,i),mh(p,!0),p.tail===null&&p.tailMode==="hidden"&&!S.alternate&&!Nn)return _r(o),null}else 2*en()-p.renderingStartTime>up&&f!==536870912&&(o.flags|=128,b=!0,mh(p,!1),o.lanes=4194304);p.isBackwards?(S.sibling=o.child,o.child=S):(i=p.last,i!==null?i.sibling=S:o.child=S,p.last=S)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=en(),i.sibling=null,f=On.current,V(On,b?f&1|2:f&1),Nn&&mi(o,p.treeForkCount),i):(_r(o),null);case 22:case 23:return er(o),Qr(),p=o.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(o.flags|=8192):p&&(o.flags|=8192),p?(f&536870912)!==0&&(o.flags&128)===0&&(_r(o),o.subtreeFlags&6&&(o.flags|=8192)):_r(o),f=o.updateQueue,f!==null&&ap(o,f.retryQueue),f=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==f&&(o.flags|=2048),i!==null&&O(J),null;case 24:return f=null,i!==null&&(f=i.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),Oi(Pr),_r(o),null;case 25:return null;case 30:return null}throw Error(r(156,o.tag))}function f6(i,o){switch(Dc(o),o.tag){case 1:return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 3:return Oi(Pr),xe(),i=o.flags,(i&65536)!==0&&(i&128)===0?(o.flags=i&-65537|128,o):null;case 26:case 27:case 5:return De(o),null;case 31:if(o.memoizedState!==null){if(er(o),o.alternate===null)throw Error(r(340));cl()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 13:if(er(o),i=o.memoizedState,i!==null&&i.dehydrated!==null){if(o.alternate===null)throw Error(r(340));cl()}return i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 19:return O(On),null;case 4:return xe(),null;case 10:return Oi(o.type),null;case 22:case 23:return er(o),Qr(),i!==null&&O(J),i=o.flags,i&65536?(o.flags=i&-65537|128,o):null;case 24:return Oi(Pr),null;case 25:return null;default:return null}}function eb(i,o){switch(Dc(o),o.tag){case 3:Oi(Pr),xe();break;case 26:case 27:case 5:De(o);break;case 4:xe();break;case 31:o.memoizedState!==null&&er(o);break;case 13:er(o);break;case 19:O(On);break;case 10:Oi(o.type);break;case 22:case 23:er(o),Qr(),i!==null&&O(J);break;case 24:Oi(Pr)}}function gh(i,o){try{var f=o.updateQueue,p=f!==null?f.lastEffect:null;if(p!==null){var b=p.next;f=b;do{if((f.tag&i)===i){p=void 0;var S=f.create,M=f.inst;p=S(),M.destroy=p}f=f.next}while(f!==b)}}catch(Q){nr(o,o.return,Q)}}function au(i,o,f){try{var p=o.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var S=b.next;p=S;do{if((p.tag&i)===i){var M=p.inst,Q=M.destroy;if(Q!==void 0){M.destroy=void 0,b=o;var me=f,Oe=Q;try{Oe()}catch($e){nr(b,me,$e)}}}p=p.next}while(p!==S)}}catch($e){nr(o,o.return,$e)}}function tb(i){var o=i.updateQueue;if(o!==null){var f=i.stateNode;try{zr(o,f)}catch(p){nr(i,i.return,p)}}}function nb(i,o,f){f.props=Ju(i.type,i.memoizedProps),f.state=i.memoizedState;try{f.componentWillUnmount()}catch(p){nr(i,o,p)}}function vh(i,o){try{var f=i.ref;if(f!==null){switch(i.tag){case 26:case 27:case 5:var p=i.stateNode;break;case 30:p=i.stateNode;break;default:p=i.stateNode}typeof f=="function"?i.refCleanup=f(p):f.current=p}}catch(b){nr(i,o,b)}}function Co(i,o){var f=i.ref,p=i.refCleanup;if(f!==null)if(typeof p=="function")try{p()}catch(b){nr(i,o,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(b){nr(i,o,b)}else f.current=null}function rb(i){var o=i.type,f=i.memoizedProps,p=i.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":f.autoFocus&&p.focus();break e;case"img":f.src?p.src=f.src:f.srcSet&&(p.srcset=f.srcSet)}}catch(b){nr(i,i.return,b)}}function v0(i,o,f){try{var p=i.stateNode;k6(p,i.type,f,o),p[ct]=o}catch(b){nr(i,i.return,b)}}function ab(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&fu(i.type)||i.tag===4}function y0(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||ab(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&fu(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function b0(i,o,f){var p=i.tag;if(p===5||p===6)i=i.stateNode,o?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(i,o):(o=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,o.appendChild(i),f=f._reactRootContainer,f!=null||o.onclick!==null||(o.onclick=wi));else if(p!==4&&(p===27&&fu(i.type)&&(f=i.stateNode,o=null),i=i.child,i!==null))for(b0(i,o,f),i=i.sibling;i!==null;)b0(i,o,f),i=i.sibling}function ip(i,o,f){var p=i.tag;if(p===5||p===6)i=i.stateNode,o?f.insertBefore(i,o):f.appendChild(i);else if(p!==4&&(p===27&&fu(i.type)&&(f=i.stateNode),i=i.child,i!==null))for(ip(i,o,f),i=i.sibling;i!==null;)ip(i,o,f),i=i.sibling}function ib(i){var o=i.stateNode,f=i.memoizedProps;try{for(var p=i.type,b=o.attributes;b.length;)o.removeAttributeNode(b[0]);Wa(o,p,f),o[et]=i,o[ct]=f}catch(S){nr(i,i.return,S)}}var vl=!1,ha=!1,w0=!1,sb=typeof WeakSet=="function"?WeakSet:Set,Ia=null;function h6(i,o){if(i=i.containerInfo,$0=Np,i=al(i),Fs(i)){if("selectionStart"in i)var f={start:i.selectionStart,end:i.selectionEnd};else e:{f=(f=i.ownerDocument)&&f.defaultView||window;var p=f.getSelection&&f.getSelection();if(p&&p.rangeCount!==0){f=p.anchorNode;var b=p.anchorOffset,S=p.focusNode;p=p.focusOffset;try{f.nodeType,S.nodeType}catch{f=null;break e}var M=0,Q=-1,me=-1,Oe=0,$e=0,Ge=i,ke=null;t:for(;;){for(var Me;Ge!==f||b!==0&&Ge.nodeType!==3||(Q=M+b),Ge!==S||p!==0&&Ge.nodeType!==3||(me=M+p),Ge.nodeType===3&&(M+=Ge.nodeValue.length),(Me=Ge.firstChild)!==null;)ke=Ge,Ge=Me;for(;;){if(Ge===i)break t;if(ke===f&&++Oe===b&&(Q=M),ke===S&&++$e===p&&(me=M),(Me=Ge.nextSibling)!==null)break;Ge=ke,ke=Ge.parentNode}Ge=Me}f=Q===-1||me===-1?null:{start:Q,end:me}}else f=null}f=f||{start:0,end:0}}else f=null;for(z0={focusedElem:i,selectionRange:f},Np=!1,Ia=o;Ia!==null;)if(o=Ia,i=o.child,(o.subtreeFlags&1028)!==0&&i!==null)i.return=o,Ia=i;else for(;Ia!==null;){switch(o=Ia,S=o.alternate,i=o.flags,o.tag){case 0:if((i&4)!==0&&(i=o.updateQueue,i=i!==null?i.events:null,i!==null))for(f=0;f<i.length;f++)b=i[f],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&S!==null){i=void 0,f=o,b=S.memoizedProps,S=S.memoizedState,p=f.stateNode;try{var yt=Ju(f.type,b);i=p.getSnapshotBeforeUpdate(yt,S),p.__reactInternalSnapshotBeforeUpdate=i}catch(Vt){nr(f,f.return,Vt)}}break;case 3:if((i&1024)!==0){if(i=o.stateNode.containerInfo,f=i.nodeType,f===9)V0(i);else if(f===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":V0(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=o.sibling,i!==null){i.return=o.return,Ia=i;break}Ia=o.return}}function ob(i,o,f){var p=f.flags;switch(f.tag){case 0:case 11:case 15:bl(i,f),p&4&&gh(5,f);break;case 1:if(bl(i,f),p&4)if(i=f.stateNode,o===null)try{i.componentDidMount()}catch(M){nr(f,f.return,M)}else{var b=Ju(f.type,o.memoizedProps);o=o.memoizedState;try{i.componentDidUpdate(b,o,i.__reactInternalSnapshotBeforeUpdate)}catch(M){nr(f,f.return,M)}}p&64&&tb(f),p&512&&vh(f,f.return);break;case 3:if(bl(i,f),p&64&&(i=f.updateQueue,i!==null)){if(o=null,f.child!==null)switch(f.child.tag){case 27:case 5:o=f.child.stateNode;break;case 1:o=f.child.stateNode}try{zr(i,o)}catch(M){nr(f,f.return,M)}}break;case 27:o===null&&p&4&&ib(f);case 26:case 5:bl(i,f),o===null&&p&4&&rb(f),p&512&&vh(f,f.return);break;case 12:bl(i,f);break;case 31:bl(i,f),p&4&&cb(i,f);break;case 13:bl(i,f),p&4&&fb(i,f),p&64&&(i=f.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(f=x6.bind(null,f),$6(i,f))));break;case 22:if(p=f.memoizedState!==null||vl,!p){o=o!==null&&o.memoizedState!==null||ha,b=vl;var S=ha;vl=p,(ha=o)&&!S?wl(i,f,(f.subtreeFlags&8772)!==0):bl(i,f),vl=b,ha=S}break;case 30:break;default:bl(i,f)}}function lb(i){var o=i.alternate;o!==null&&(i.alternate=null,lb(o)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(o=i.stateNode,o!==null&&bn(o)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Rr=null,ki=!1;function yl(i,o,f){for(f=f.child;f!==null;)ub(i,o,f),f=f.sibling}function ub(i,o,f){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(fn,f)}catch{}switch(f.tag){case 26:ha||Co(f,o),yl(i,o,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:ha||Co(f,o);var p=Rr,b=ki;fu(f.type)&&(Rr=f.stateNode,ki=!1),yl(i,o,f),Nh(f.stateNode),Rr=p,ki=b;break;case 5:ha||Co(f,o);case 6:if(p=Rr,b=ki,Rr=null,yl(i,o,f),Rr=p,ki=b,Rr!==null)if(ki)try{(Rr.nodeType===9?Rr.body:Rr.nodeName==="HTML"?Rr.ownerDocument.body:Rr).removeChild(f.stateNode)}catch(S){nr(f,o,S)}else try{Rr.removeChild(f.stateNode)}catch(S){nr(f,o,S)}break;case 18:Rr!==null&&(ki?(i=Rr,t5(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,f.stateNode),sf(i)):t5(Rr,f.stateNode));break;case 4:p=Rr,b=ki,Rr=f.stateNode.containerInfo,ki=!0,yl(i,o,f),Rr=p,ki=b;break;case 0:case 11:case 14:case 15:au(2,f,o),ha||au(4,f,o),yl(i,o,f);break;case 1:ha||(Co(f,o),p=f.stateNode,typeof p.componentWillUnmount=="function"&&nb(f,o,p)),yl(i,o,f);break;case 21:yl(i,o,f);break;case 22:ha=(p=ha)||f.memoizedState!==null,yl(i,o,f),ha=p;break;default:yl(i,o,f)}}function cb(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{sf(i)}catch(f){nr(o,o.return,f)}}}function fb(i,o){if(o.memoizedState===null&&(i=o.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{sf(i)}catch(f){nr(o,o.return,f)}}function d6(i){switch(i.tag){case 31:case 13:case 19:var o=i.stateNode;return o===null&&(o=i.stateNode=new sb),o;case 22:return i=i.stateNode,o=i._retryCache,o===null&&(o=i._retryCache=new sb),o;default:throw Error(r(435,i.tag))}}function sp(i,o){var f=d6(i);o.forEach(function(p){if(!f.has(p)){f.add(p);var b=S6.bind(null,i,p);p.then(b,b)}})}function Di(i,o){var f=o.deletions;if(f!==null)for(var p=0;p<f.length;p++){var b=f[p],S=i,M=o,Q=M;e:for(;Q!==null;){switch(Q.tag){case 27:if(fu(Q.type)){Rr=Q.stateNode,ki=!1;break e}break;case 5:Rr=Q.stateNode,ki=!1;break e;case 3:case 4:Rr=Q.stateNode.containerInfo,ki=!0;break e}Q=Q.return}if(Rr===null)throw Error(r(160));ub(S,M,b),Rr=null,ki=!1,S=b.alternate,S!==null&&(S.return=null),b.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)hb(o,i),o=o.sibling}var Vs=null;function hb(i,o){var f=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Di(o,i),Pi(i),p&4&&(au(3,i,i.return),gh(3,i),au(5,i,i.return));break;case 1:Di(o,i),Pi(i),p&512&&(ha||f===null||Co(f,f.return)),p&64&&vl&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(f=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=f===null?p:f.concat(p))));break;case 26:var b=Vs;if(Di(o,i),Pi(i),p&512&&(ha||f===null||Co(f,f.return)),p&4){var S=f!==null?f.memoizedState:null;if(p=i.memoizedState,f===null)if(p===null)if(i.stateNode===null){e:{p=i.type,f=i.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":S=b.getElementsByTagName("title")[0],(!S||S[Yt]||S[et]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=b.createElement(p),b.head.insertBefore(S,b.querySelector("head > title"))),Wa(S,p,f),S[et]=i,wn(S),p=S;break e;case"link":var M=h5("link","href",b).get(p+(f.href||""));if(M){for(var Q=0;Q<M.length;Q++)if(S=M[Q],S.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&S.getAttribute("rel")===(f.rel==null?null:f.rel)&&S.getAttribute("title")===(f.title==null?null:f.title)&&S.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){M.splice(Q,1);break t}}S=b.createElement(p),Wa(S,p,f),b.head.appendChild(S);break;case"meta":if(M=h5("meta","content",b).get(p+(f.content||""))){for(Q=0;Q<M.length;Q++)if(S=M[Q],S.getAttribute("content")===(f.content==null?null:""+f.content)&&S.getAttribute("name")===(f.name==null?null:f.name)&&S.getAttribute("property")===(f.property==null?null:f.property)&&S.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&S.getAttribute("charset")===(f.charSet==null?null:f.charSet)){M.splice(Q,1);break t}}S=b.createElement(p),Wa(S,p,f),b.head.appendChild(S);break;default:throw Error(r(468,p))}S[et]=i,wn(S),p=S}i.stateNode=p}else d5(b,i.type,i.stateNode);else i.stateNode=f5(b,p,i.memoizedProps);else S!==p?(S===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):S.count--,p===null?d5(b,i.type,i.stateNode):f5(b,p,i.memoizedProps)):p===null&&i.stateNode!==null&&v0(i,i.memoizedProps,f.memoizedProps)}break;case 27:Di(o,i),Pi(i),p&512&&(ha||f===null||Co(f,f.return)),f!==null&&p&4&&v0(i,i.memoizedProps,f.memoizedProps);break;case 5:if(Di(o,i),Pi(i),p&512&&(ha||f===null||Co(f,f.return)),i.flags&32){b=i.stateNode;try{Ts(b,"")}catch(yt){nr(i,i.return,yt)}}p&4&&i.stateNode!=null&&(b=i.memoizedProps,v0(i,b,f!==null?f.memoizedProps:b)),p&1024&&(w0=!0);break;case 6:if(Di(o,i),Pi(i),p&4){if(i.stateNode===null)throw Error(r(162));p=i.memoizedProps,f=i.stateNode;try{f.nodeValue=p}catch(yt){nr(i,i.return,yt)}}break;case 3:if(Sp=null,b=Vs,Vs=wp(o.containerInfo),Di(o,i),Vs=b,Pi(i),p&4&&f!==null&&f.memoizedState.isDehydrated)try{sf(o.containerInfo)}catch(yt){nr(i,i.return,yt)}w0&&(w0=!1,db(i));break;case 4:p=Vs,Vs=wp(i.stateNode.containerInfo),Di(o,i),Pi(i),Vs=p;break;case 12:Di(o,i),Pi(i);break;case 31:Di(o,i),Pi(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,sp(i,p)));break;case 13:Di(o,i),Pi(i),i.child.flags&8192&&i.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(lp=en()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,sp(i,p)));break;case 22:b=i.memoizedState!==null;var me=f!==null&&f.memoizedState!==null,Oe=vl,$e=ha;if(vl=Oe||b,ha=$e||me,Di(o,i),ha=$e,vl=Oe,Pi(i),p&8192)e:for(o=i.stateNode,o._visibility=b?o._visibility&-2:o._visibility|1,b&&(f===null||me||vl||ha||Xu(i)),f=null,o=i;;){if(o.tag===5||o.tag===26){if(f===null){me=f=o;try{if(S=me.stateNode,b)M=S.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{Q=me.stateNode;var Ge=me.memoizedProps.style,ke=Ge!=null&&Ge.hasOwnProperty("display")?Ge.display:null;Q.style.display=ke==null||typeof ke=="boolean"?"":(""+ke).trim()}}catch(yt){nr(me,me.return,yt)}}}else if(o.tag===6){if(f===null){me=o;try{me.stateNode.nodeValue=b?"":me.memoizedProps}catch(yt){nr(me,me.return,yt)}}}else if(o.tag===18){if(f===null){me=o;try{var Me=me.stateNode;b?n5(Me,!0):n5(me.stateNode,!1)}catch(yt){nr(me,me.return,yt)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===i)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break e;for(;o.sibling===null;){if(o.return===null||o.return===i)break e;f===o&&(f=null),o=o.return}f===o&&(f=null),o.sibling.return=o.return,o=o.sibling}p&4&&(p=i.updateQueue,p!==null&&(f=p.retryQueue,f!==null&&(p.retryQueue=null,sp(i,f))));break;case 19:Di(o,i),Pi(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,sp(i,p)));break;case 30:break;case 21:break;default:Di(o,i),Pi(i)}}function Pi(i){var o=i.flags;if(o&2){try{for(var f,p=i.return;p!==null;){if(ab(p)){f=p;break}p=p.return}if(f==null)throw Error(r(160));switch(f.tag){case 27:var b=f.stateNode,S=y0(i);ip(i,S,b);break;case 5:var M=f.stateNode;f.flags&32&&(Ts(M,""),f.flags&=-33);var Q=y0(i);ip(i,Q,M);break;case 3:case 4:var me=f.stateNode.containerInfo,Oe=y0(i);b0(i,Oe,me);break;default:throw Error(r(161))}}catch($e){nr(i,i.return,$e)}i.flags&=-3}o&4096&&(i.flags&=-4097)}function db(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var o=i;db(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),i=i.sibling}}function bl(i,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)ob(i,o.alternate,o),o=o.sibling}function Xu(i){for(i=i.child;i!==null;){var o=i;switch(o.tag){case 0:case 11:case 14:case 15:au(4,o,o.return),Xu(o);break;case 1:Co(o,o.return);var f=o.stateNode;typeof f.componentWillUnmount=="function"&&nb(o,o.return,f),Xu(o);break;case 27:Nh(o.stateNode);case 26:case 5:Co(o,o.return),Xu(o);break;case 22:o.memoizedState===null&&Xu(o);break;case 30:Xu(o);break;default:Xu(o)}i=i.sibling}}function wl(i,o,f){for(f=f&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var p=o.alternate,b=i,S=o,M=S.flags;switch(S.tag){case 0:case 11:case 15:wl(b,S,f),gh(4,S);break;case 1:if(wl(b,S,f),p=S,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(Oe){nr(p,p.return,Oe)}if(p=S,b=p.updateQueue,b!==null){var Q=p.stateNode;try{var me=b.shared.hiddenCallbacks;if(me!==null)for(b.shared.hiddenCallbacks=null,b=0;b<me.length;b++)Pa(me[b],Q)}catch(Oe){nr(p,p.return,Oe)}}f&&M&64&&tb(S),vh(S,S.return);break;case 27:ib(S);case 26:case 5:wl(b,S,f),f&&p===null&&M&4&&rb(S),vh(S,S.return);break;case 12:wl(b,S,f);break;case 31:wl(b,S,f),f&&M&4&&cb(b,S);break;case 13:wl(b,S,f),f&&M&4&&fb(b,S);break;case 22:S.memoizedState===null&&wl(b,S,f),vh(S,S.return);break;case 30:break;default:wl(b,S,f)}o=o.sibling}}function x0(i,o){var f=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),i=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(i=o.memoizedState.cachePool.pool),i!==f&&(i!=null&&i.refCount++,f!=null&&Gu(f))}function S0(i,o){i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Gu(i))}function Gs(i,o,f,p){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)pb(i,o,f,p),o=o.sibling}function pb(i,o,f,p){var b=o.flags;switch(o.tag){case 0:case 11:case 15:Gs(i,o,f,p),b&2048&&gh(9,o);break;case 1:Gs(i,o,f,p);break;case 3:Gs(i,o,f,p),b&2048&&(i=null,o.alternate!==null&&(i=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==i&&(o.refCount++,i!=null&&Gu(i)));break;case 12:if(b&2048){Gs(i,o,f,p),i=o.stateNode;try{var S=o.memoizedProps,M=S.id,Q=S.onPostCommit;typeof Q=="function"&&Q(M,o.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(me){nr(o,o.return,me)}}else Gs(i,o,f,p);break;case 31:Gs(i,o,f,p);break;case 13:Gs(i,o,f,p);break;case 23:break;case 22:S=o.stateNode,M=o.alternate,o.memoizedState!==null?S._visibility&2?Gs(i,o,f,p):yh(i,o):S._visibility&2?Gs(i,o,f,p):(S._visibility|=2,Yc(i,o,f,p,(o.subtreeFlags&10256)!==0||!1)),b&2048&&x0(M,o);break;case 24:Gs(i,o,f,p),b&2048&&S0(o.alternate,o);break;default:Gs(i,o,f,p)}}function Yc(i,o,f,p,b){for(b=b&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var S=i,M=o,Q=f,me=p,Oe=M.flags;switch(M.tag){case 0:case 11:case 15:Yc(S,M,Q,me,b),gh(8,M);break;case 23:break;case 22:var $e=M.stateNode;M.memoizedState!==null?$e._visibility&2?Yc(S,M,Q,me,b):yh(S,M):($e._visibility|=2,Yc(S,M,Q,me,b)),b&&Oe&2048&&x0(M.alternate,M);break;case 24:Yc(S,M,Q,me,b),b&&Oe&2048&&S0(M.alternate,M);break;default:Yc(S,M,Q,me,b)}o=o.sibling}}function yh(i,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var f=i,p=o,b=p.flags;switch(p.tag){case 22:yh(f,p),b&2048&&x0(p.alternate,p);break;case 24:yh(f,p),b&2048&&S0(p.alternate,p);break;default:yh(f,p)}o=o.sibling}}var bh=8192;function Kc(i,o,f){if(i.subtreeFlags&bh)for(i=i.child;i!==null;)mb(i,o,f),i=i.sibling}function mb(i,o,f){switch(i.tag){case 26:Kc(i,o,f),i.flags&bh&&i.memoizedState!==null&&Q6(f,Vs,i.memoizedState,i.memoizedProps);break;case 5:Kc(i,o,f);break;case 3:case 4:var p=Vs;Vs=wp(i.stateNode.containerInfo),Kc(i,o,f),Vs=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=bh,bh=16777216,Kc(i,o,f),bh=p):Kc(i,o,f));break;default:Kc(i,o,f)}}function gb(i){var o=i.alternate;if(o!==null&&(i=o.child,i!==null)){o.child=null;do o=i.sibling,i.sibling=null,i=o;while(i!==null)}}function wh(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var p=o[f];Ia=p,yb(p,i)}gb(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)vb(i),i=i.sibling}function vb(i){switch(i.tag){case 0:case 11:case 15:wh(i),i.flags&2048&&au(9,i,i.return);break;case 3:wh(i);break;case 12:wh(i);break;case 22:var o=i.stateNode;i.memoizedState!==null&&o._visibility&2&&(i.return===null||i.return.tag!==13)?(o._visibility&=-3,op(i)):wh(i);break;default:wh(i)}}function op(i){var o=i.deletions;if((i.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var p=o[f];Ia=p,yb(p,i)}gb(i)}for(i=i.child;i!==null;){switch(o=i,o.tag){case 0:case 11:case 15:au(8,o,o.return),op(o);break;case 22:f=o.stateNode,f._visibility&2&&(f._visibility&=-3,op(o));break;default:op(o)}i=i.sibling}}function yb(i,o){for(;Ia!==null;){var f=Ia;switch(f.tag){case 0:case 11:case 15:au(8,f,o);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var p=f.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Gu(f.memoizedState.cache)}if(p=f.child,p!==null)p.return=f,Ia=p;else e:for(f=i;Ia!==null;){p=Ia;var b=p.sibling,S=p.return;if(lb(p),p===f){Ia=null;break e}if(b!==null){b.return=S,Ia=b;break e}Ia=S}}}var p6={getCacheForType:function(i){var o=Sa(Pr),f=o.data.get(i);return f===void 0&&(f=i(),o.data.set(i,f)),f},cacheSignal:function(){return Sa(Pr).controller.signal}},m6=typeof WeakMap=="function"?WeakMap:Map,Wn=0,dr=null,Cn=null,Ln=0,tr=0,Qi=null,iu=!1,Jc=!1,_0=!1,xl=0,Gr=0,su=0,Zu=0,E0=0,es=0,Xc=0,xh=null,Mi=null,A0=!1,lp=0,bb=0,up=1/0,cp=null,ou=null,Ea=0,lu=null,Zc=null,Sl=0,N0=0,C0=null,wb=null,Sh=0,T0=null;function ts(){return(Wn&2)!==0&&Ln!==0?Ln&-Ln:te.T!==null?D0():Be()}function xb(){if(es===0)if((Ln&536870912)===0||Nn){var i=kn;kn<<=1,(kn&3932160)===0&&(kn=262144),es=i}else es=536870912;return i=Sr.current,i!==null&&(i.flags|=32),es}function Ii(i,o,f){(i===dr&&(tr===2||tr===9)||i.cancelPendingCommit!==null)&&(Qc(i,0),uu(i,Ln,es,!1)),At(i,f),((Wn&2)===0||i!==dr)&&(i===dr&&((Wn&2)===0&&(Zu|=f),Gr===4&&uu(i,Ln,es,!1)),To(i))}function Sb(i,o,f){if((Wn&6)!==0)throw Error(r(327));var p=!f&&(o&127)===0&&(o&i.expiredLanes)===0||Xa(i,o),b=p?y6(i,o):j0(i,o,!0),S=p;do{if(b===0){Jc&&!p&&uu(i,o,0,!1);break}else{if(f=i.current.alternate,S&&!g6(f)){b=j0(i,o,!1),S=!1;continue}if(b===2){if(S=o,i.errorRecoveryDisabledLanes&S)var M=0;else M=i.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){o=M;e:{var Q=i;b=xh;var me=Q.current.memoizedState.isDehydrated;if(me&&(Qc(Q,M).flags|=256),M=j0(Q,M,!1),M!==2){if(_0&&!me){Q.errorRecoveryDisabledLanes|=S,Zu|=S,b=4;break e}S=Mi,Mi=b,S!==null&&(Mi===null?Mi=S:Mi.push.apply(Mi,S))}b=M}if(S=!1,b!==2)continue}}if(b===1){Qc(i,0),uu(i,o,0,!0);break}e:{switch(p=i,S=b,S){case 0:case 1:throw Error(r(345));case 4:if((o&4194048)!==o)break;case 6:uu(p,o,es,!iu);break e;case 2:Mi=null;break;case 3:case 5:break;default:throw Error(r(329))}if((o&62914560)===o&&(b=lp+300-en(),10<b)){if(uu(p,o,es,!iu),Sn(p,0,!0)!==0)break e;Sl=o,p.timeoutHandle=Qb(_b.bind(null,p,f,Mi,cp,A0,o,es,Zu,Xc,iu,S,"Throttled",-0,0),b);break e}_b(p,f,Mi,cp,A0,o,es,Zu,Xc,iu,S,null,-0,0)}}break}while(!0);To(i)}function _b(i,o,f,p,b,S,M,Q,me,Oe,$e,Ge,ke,Me){if(i.timeoutHandle=-1,Ge=o.subtreeFlags,Ge&8192||(Ge&16785408)===16785408){Ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wi},mb(o,S,Ge);var yt=(S&62914560)===S?lp-en():(S&4194048)===S?bb-en():0;if(yt=eN(Ge,yt),yt!==null){Sl=S,i.cancelPendingCommit=yt(Ob.bind(null,i,o,S,f,p,b,M,Q,me,$e,Ge,null,ke,Me)),uu(i,S,M,!Oe);return}}Ob(i,o,S,f,p,b,M,Q,me)}function g6(i){for(var o=i;;){var f=o.tag;if((f===0||f===11||f===15)&&o.flags&16384&&(f=o.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var p=0;p<f.length;p++){var b=f[p],S=b.getSnapshot;b=b.value;try{if(!Cr(S(),b))return!1}catch{return!1}}if(f=o.child,o.subtreeFlags&16384&&f!==null)f.return=o,o=f;else{if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function uu(i,o,f,p){o&=~E0,o&=~Zu,i.suspendedLanes|=o,i.pingedLanes&=~o,p&&(i.warmLanes|=o),p=i.expirationTimes;for(var b=o;0<b;){var S=31-mn(b),M=1<<S;p[S]=-1,b&=~M}f!==0&&bi(i,f,o)}function fp(){return(Wn&6)===0?(_h(0),!1):!0}function L0(){if(Cn!==null){if(tr===0)var i=Cn.return;else i=Cn,ps=bo=null,$c(i),Ye=null,bt=0,i=Cn;for(;i!==null;)eb(i.alternate,i),i=i.return;Cn=null}}function Qc(i,o){var f=i.timeoutHandle;f!==-1&&(i.timeoutHandle=-1,M6(f)),f=i.cancelPendingCommit,f!==null&&(i.cancelPendingCommit=null,f()),Sl=0,L0(),dr=i,Cn=f=Ai(i.current,null),Ln=o,tr=0,Qi=null,iu=!1,Jc=Xa(i,o),_0=!1,Xc=es=E0=Zu=su=Gr=0,Mi=xh=null,A0=!1,(o&8)!==0&&(o|=o&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=o;0<p;){var b=31-mn(p),S=1<<b;o|=i[b],p&=~S}return xl=o,Bu(),f}function Eb(i,o){Rt=null,te.H=dh,o===be||o===ce?(o=ze(),tr=3):o===Le?(o=ze(),tr=4):tr=o===o0?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Qi=o,Cn===null&&(Gr=1,ep(i,Ni(o,i.current)))}function Ab(){var i=Sr.current;return i===null?!0:(Ln&4194048)===Ln?Pn===null:(Ln&62914560)===Ln||(Ln&536870912)!==0?i===Pn:!1}function Nb(){var i=te.H;return te.H=dh,i===null?dh:i}function Cb(){var i=te.A;return te.A=p6,i}function hp(){Gr=4,iu||(Ln&4194048)!==Ln&&Sr.current!==null||(Jc=!0),(su&134217727)===0&&(Zu&134217727)===0||dr===null||uu(dr,Ln,es,!1)}function j0(i,o,f){var p=Wn;Wn|=2;var b=Nb(),S=Cb();(dr!==i||Ln!==o)&&(cp=null,Qc(i,o)),o=!1;var M=Gr;e:do try{if(tr!==0&&Cn!==null){var Q=Cn,me=Qi;switch(tr){case 8:L0(),M=6;break e;case 3:case 2:case 9:case 6:Sr.current===null&&(o=!0);var Oe=tr;if(tr=0,Qi=null,ef(i,Q,me,Oe),f&&Jc){M=0;break e}break;default:Oe=tr,tr=0,Qi=null,ef(i,Q,me,Oe)}}v6(),M=Gr;break}catch($e){Eb(i,$e)}while(!0);return o&&i.shellSuspendCounter++,ps=bo=null,Wn=p,te.H=b,te.A=S,Cn===null&&(dr=null,Ln=0,Bu()),M}function v6(){for(;Cn!==null;)Tb(Cn)}function y6(i,o){var f=Wn;Wn|=2;var p=Nb(),b=Cb();dr!==i||Ln!==o?(cp=null,up=en()+500,Qc(i,o)):Jc=Xa(i,o);e:do try{if(tr!==0&&Cn!==null){o=Cn;var S=Qi;t:switch(tr){case 1:tr=0,Qi=null,ef(i,o,S,1);break;case 2:case 9:if(Ce(S)){tr=0,Qi=null,Lb(o);break}o=function(){tr!==2&&tr!==9||dr!==i||(tr=7),To(i)},S.then(o,o);break e;case 3:tr=7;break e;case 4:tr=5;break e;case 7:Ce(S)?(tr=0,Qi=null,Lb(o)):(tr=0,Qi=null,ef(i,o,S,7));break;case 5:var M=null;switch(Cn.tag){case 26:M=Cn.memoizedState;case 5:case 27:var Q=Cn;if(M?p5(M):Q.stateNode.complete){tr=0,Qi=null;var me=Q.sibling;if(me!==null)Cn=me;else{var Oe=Q.return;Oe!==null?(Cn=Oe,dp(Oe)):Cn=null}break t}}tr=0,Qi=null,ef(i,o,S,5);break;case 6:tr=0,Qi=null,ef(i,o,S,6);break;case 8:L0(),Gr=6;break e;default:throw Error(r(462))}}b6();break}catch($e){Eb(i,$e)}while(!0);return ps=bo=null,te.H=p,te.A=b,Wn=f,Cn!==null?0:(dr=null,Ln=0,Bu(),Gr)}function b6(){for(;Cn!==null&&!Ot();)Tb(Cn)}function Tb(i){var o=Z2(i.alternate,i,xl);i.memoizedProps=i.pendingProps,o===null?dp(i):Cn=o}function Lb(i){var o=i,f=o.alternate;switch(o.tag){case 15:case 0:o=G2(f,o,o.pendingProps,o.type,void 0,Ln);break;case 11:o=G2(f,o,o.pendingProps,o.type.render,o.ref,Ln);break;case 5:$c(o);default:eb(f,o),o=Cn=qu(o,xl),o=Z2(f,o,xl)}i.memoizedProps=i.pendingProps,o===null?dp(i):Cn=o}function ef(i,o,f,p){ps=bo=null,$c(o),Ye=null,bt=0;var b=o.return;try{if(o6(i,b,o,f,Ln)){Gr=1,ep(i,Ni(f,i.current)),Cn=null;return}}catch(S){if(b!==null)throw Cn=b,S;Gr=1,ep(i,Ni(f,i.current)),Cn=null;return}o.flags&32768?(Nn||p===1?i=!0:Jc||(Ln&536870912)!==0?i=!1:(iu=i=!0,(p===2||p===9||p===3||p===6)&&(p=Sr.current,p!==null&&p.tag===13&&(p.flags|=16384))),jb(o,i)):dp(o)}function dp(i){var o=i;do{if((o.flags&32768)!==0){jb(o,iu);return}i=o.return;var f=c6(o.alternate,o,xl);if(f!==null){Cn=f;return}if(o=o.sibling,o!==null){Cn=o;return}Cn=o=i}while(o!==null);Gr===0&&(Gr=5)}function jb(i,o){do{var f=f6(i.alternate,i);if(f!==null){f.flags&=32767,Cn=f;return}if(f=i.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!o&&(i=i.sibling,i!==null)){Cn=i;return}Cn=i=f}while(i!==null);Gr=6,Cn=null}function Ob(i,o,f,p,b,S,M,Q,me){i.cancelPendingCommit=null;do pp();while(Ea!==0);if((Wn&6)!==0)throw Error(r(327));if(o!==null){if(o===i.current)throw Error(r(177));if(S=o.lanes|o.childLanes,S|=Cc,yi(i,f,S,M,Q,me),i===dr&&(Cn=dr=null,Ln=0),Zc=o,lu=i,Sl=f,N0=S,C0=b,wb=p,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,_6(an,function(){return Mb(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||p){p=te.T,te.T=null,b=oe.p,oe.p=2,M=Wn,Wn|=4;try{h6(i,o,f)}finally{Wn=M,oe.p=b,te.T=p}}Ea=1,Rb(),kb(),Db()}}function Rb(){if(Ea===1){Ea=0;var i=lu,o=Zc,f=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||f){f=te.T,te.T=null;var p=oe.p;oe.p=2;var b=Wn;Wn|=4;try{hb(o,i);var S=z0,M=al(i.containerInfo),Q=S.focusedElem,me=S.selectionRange;if(M!==Q&&Q&&Q.ownerDocument&&Gl(Q.ownerDocument.documentElement,Q)){if(me!==null&&Fs(Q)){var Oe=me.start,$e=me.end;if($e===void 0&&($e=Oe),"selectionStart"in Q)Q.selectionStart=Oe,Q.selectionEnd=Math.min($e,Q.value.length);else{var Ge=Q.ownerDocument||document,ke=Ge&&Ge.defaultView||window;if(ke.getSelection){var Me=ke.getSelection(),yt=Q.textContent.length,Vt=Math.min(me.start,yt),or=me.end===void 0?Vt:Math.min(me.end,yt);!Me.extend&&Vt>or&&(M=or,or=Vt,Vt=M);var Ae=Vl(Q,Vt),we=Vl(Q,or);if(Ae&&we&&(Me.rangeCount!==1||Me.anchorNode!==Ae.node||Me.anchorOffset!==Ae.offset||Me.focusNode!==we.node||Me.focusOffset!==we.offset)){var je=Ge.createRange();je.setStart(Ae.node,Ae.offset),Me.removeAllRanges(),Vt>or?(Me.addRange(je),Me.extend(we.node,we.offset)):(je.setEnd(we.node,we.offset),Me.addRange(je))}}}}for(Ge=[],Me=Q;Me=Me.parentNode;)Me.nodeType===1&&Ge.push({element:Me,left:Me.scrollLeft,top:Me.scrollTop});for(typeof Q.focus=="function"&&Q.focus(),Q=0;Q<Ge.length;Q++){var He=Ge[Q];He.element.scrollLeft=He.left,He.element.scrollTop=He.top}}Np=!!$0,z0=$0=null}finally{Wn=b,oe.p=p,te.T=f}}i.current=o,Ea=2}}function kb(){if(Ea===2){Ea=0;var i=lu,o=Zc,f=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||f){f=te.T,te.T=null;var p=oe.p;oe.p=2;var b=Wn;Wn|=4;try{ob(i,o.alternate,o)}finally{Wn=b,oe.p=p,te.T=f}}Ea=3}}function Db(){if(Ea===4||Ea===3){Ea=0,Ct();var i=lu,o=Zc,f=Sl,p=wb;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Ea=5:(Ea=0,Zc=lu=null,Pb(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(ou=null),Ee(f),o=o.stateNode,Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(fn,o,void 0,(o.current.flags&128)===128)}catch{}if(p!==null){o=te.T,b=oe.p,oe.p=2,te.T=null;try{for(var S=i.onRecoverableError,M=0;M<p.length;M++){var Q=p[M];S(Q.value,{componentStack:Q.stack})}}finally{te.T=o,oe.p=b}}(Sl&3)!==0&&pp(),To(i),b=i.pendingLanes,(f&261930)!==0&&(b&42)!==0?i===T0?Sh++:(Sh=0,T0=i):Sh=0,_h(0)}}function Pb(i,o){(i.pooledCacheLanes&=o)===0&&(o=i.pooledCache,o!=null&&(i.pooledCache=null,Gu(o)))}function pp(){return Rb(),kb(),Db(),Mb()}function Mb(){if(Ea!==5)return!1;var i=lu,o=N0;N0=0;var f=Ee(Sl),p=te.T,b=oe.p;try{oe.p=32>f?32:f,te.T=null,f=C0,C0=null;var S=lu,M=Sl;if(Ea=0,Zc=lu=null,Sl=0,(Wn&6)!==0)throw Error(r(331));var Q=Wn;if(Wn|=4,vb(S.current),pb(S,S.current,M,f),Wn=Q,_h(0,!1),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(fn,S)}catch{}return!0}finally{oe.p=b,te.T=p,Pb(i,o)}}function Ib(i,o,f){o=Ni(f,o),o=s0(i.stateNode,o,2),i=dn(i,o,2),i!==null&&(At(i,2),To(i))}function nr(i,o,f){if(i.tag===3)Ib(i,i,f);else for(;o!==null;){if(o.tag===3){Ib(o,i,f);break}else if(o.tag===1){var p=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(ou===null||!ou.has(p))){i=Ni(f,i),f=F2(2),p=dn(o,f,2),p!==null&&(U2(f,p,o,i),At(p,2),To(p));break}}o=o.return}}function O0(i,o,f){var p=i.pingCache;if(p===null){p=i.pingCache=new m6;var b=new Set;p.set(o,b)}else b=p.get(o),b===void 0&&(b=new Set,p.set(o,b));b.has(f)||(_0=!0,b.add(f),i=w6.bind(null,i,o,f),o.then(i,i))}function w6(i,o,f){var p=i.pingCache;p!==null&&p.delete(o),i.pingedLanes|=i.suspendedLanes&f,i.warmLanes&=~f,dr===i&&(Ln&f)===f&&(Gr===4||Gr===3&&(Ln&62914560)===Ln&&300>en()-lp?(Wn&2)===0&&Qc(i,0):E0|=f,Xc===Ln&&(Xc=0)),To(i)}function Fb(i,o){o===0&&(o=ci()),i=Us(i,o),i!==null&&(At(i,o),To(i))}function x6(i){var o=i.memoizedState,f=0;o!==null&&(f=o.retryLane),Fb(i,f)}function S6(i,o){var f=0;switch(i.tag){case 31:case 13:var p=i.stateNode,b=i.memoizedState;b!==null&&(f=b.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(o),Fb(i,f)}function _6(i,o){return gt(i,o)}var mp=null,tf=null,R0=!1,gp=!1,k0=!1,cu=0;function To(i){i!==tf&&i.next===null&&(tf===null?mp=tf=i:tf=tf.next=i),gp=!0,R0||(R0=!0,A6())}function _h(i,o){if(!k0&&gp){k0=!0;do for(var f=!1,p=mp;p!==null;){if(i!==0){var b=p.pendingLanes;if(b===0)var S=0;else{var M=p.suspendedLanes,Q=p.pingedLanes;S=(1<<31-mn(42|i)+1)-1,S&=b&~(M&~Q),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(f=!0,zb(p,S))}else S=Ln,S=Sn(p,p===dr?S:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(S&3)===0||Xa(p,S)||(f=!0,zb(p,S));p=p.next}while(f);k0=!1}}function E6(){Ub()}function Ub(){gp=R0=!1;var i=0;cu!==0&&P6()&&(i=cu);for(var o=en(),f=null,p=mp;p!==null;){var b=p.next,S=Bb(p,o);S===0?(p.next=null,f===null?mp=b:f.next=b,b===null&&(tf=f)):(f=p,(i!==0||(S&3)!==0)&&(gp=!0)),p=b}Ea!==0&&Ea!==5||_h(i),cu!==0&&(cu=0)}function Bb(i,o){for(var f=i.suspendedLanes,p=i.pingedLanes,b=i.expirationTimes,S=i.pendingLanes&-62914561;0<S;){var M=31-mn(S),Q=1<<M,me=b[M];me===-1?((Q&f)===0||(Q&p)!==0)&&(b[M]=sa(Q,o)):me<=o&&(i.expiredLanes|=Q),S&=~Q}if(o=dr,f=Ln,f=Sn(i,i===o?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,f===0||i===o&&(tr===2||tr===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&&ut(p),i.callbackNode=null,i.callbackPriority=0;if((f&3)===0||Xa(i,f)){if(o=f&-f,o===i.callbackPriority)return o;switch(p!==null&&ut(p),Ee(f)){case 2:case 8:f=pn;break;case 32:f=an;break;case 268435456:f=kt;break;default:f=an}return p=$b.bind(null,i),f=gt(f,p),i.callbackPriority=o,i.callbackNode=f,o}return p!==null&&p!==null&&ut(p),i.callbackPriority=2,i.callbackNode=null,2}function $b(i,o){if(Ea!==0&&Ea!==5)return i.callbackNode=null,i.callbackPriority=0,null;var f=i.callbackNode;if(pp()&&i.callbackNode!==f)return null;var p=Ln;return p=Sn(i,i===dr?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(Sb(i,p,o),Bb(i,en()),i.callbackNode!=null&&i.callbackNode===f?$b.bind(null,i):null)}function zb(i,o){if(pp())return null;Sb(i,o,!0)}function A6(){I6(function(){(Wn&6)!==0?gt(Bt,E6):Ub()})}function D0(){if(cu===0){var i=v;i===0&&(i=qt,qt<<=1,(qt&261888)===0&&(qt=256)),cu=i}return cu}function qb(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Vi(""+i)}function Hb(i,o){var f=o.ownerDocument.createElement("input");return f.name=o.name,f.value=o.value,i.id&&f.setAttribute("form",i.id),o.parentNode.insertBefore(f,o),i=new FormData(i),f.parentNode.removeChild(f),i}function N6(i,o,f,p,b){if(o==="submit"&&f&&f.stateNode===b){var S=qb((b[ct]||null).action),M=p.submitter;M&&(o=(o=M[ct]||null)?qb(o.formAction):M.getAttribute("formAction"),o!==null&&(S=o,M=null));var Q=new Ki("action","action",null,p,b);i.push({event:Q,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(cu!==0){var me=M?Hb(b,M):new FormData(b);e0(f,{pending:!0,data:me,method:b.method,action:S},null,me)}}else typeof S=="function"&&(Q.preventDefault(),me=M?Hb(b,M):new FormData(b),e0(f,{pending:!0,data:me,method:b.method,action:S},S,me))},currentTarget:b}]})}}for(var P0=0;P0<ol.length;P0++){var M0=ol[P0],C6=M0.toLowerCase(),T6=M0[0].toUpperCase()+M0.slice(1);Ei(C6,"on"+T6)}Ei(ds,"onAnimationEnd"),Ei(Wl,"onAnimationIteration"),Ei(sl,"onAnimationStart"),Ei("dblclick","onDoubleClick"),Ei("focusin","onFocus"),Ei("focusout","onBlur"),Ei(Nc,"onTransitionRun"),Ei(zd,"onTransitionStart"),Ei(qd,"onTransitionCancel"),Ei(Qf,"onTransitionEnd"),la("onMouseEnter",["mouseout","mouseover"]),la("onMouseLeave",["mouseout","mouseover"]),la("onPointerEnter",["pointerout","pointerover"]),la("onPointerLeave",["pointerout","pointerover"]),oa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oa("onBeforeInput",["compositionend","keypress","textInput","paste"]),oa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Eh="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),L6=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Eh));function Vb(i,o){o=(o&4)!==0;for(var f=0;f<i.length;f++){var p=i[f],b=p.event;p=p.listeners;e:{var S=void 0;if(o)for(var M=p.length-1;0<=M;M--){var Q=p[M],me=Q.instance,Oe=Q.currentTarget;if(Q=Q.listener,me!==S&&b.isPropagationStopped())break e;S=Q,b.currentTarget=Oe;try{S(b)}catch($e){Uu($e)}b.currentTarget=null,S=me}else for(M=0;M<p.length;M++){if(Q=p[M],me=Q.instance,Oe=Q.currentTarget,Q=Q.listener,me!==S&&b.isPropagationStopped())break e;S=Q,b.currentTarget=Oe;try{S(b)}catch($e){Uu($e)}b.currentTarget=null,S=me}}}}function Tn(i,o){var f=o[st];f===void 0&&(f=o[st]=new Set);var p=i+"__bubble";f.has(p)||(Gb(o,i,2,!1),f.add(p))}function I0(i,o,f){var p=0;o&&(p|=4),Gb(f,i,p,o)}var vp="_reactListening"+Math.random().toString(36).slice(2);function F0(i){if(!i[vp]){i[vp]=!0,zi.forEach(function(f){f!=="selectionchange"&&(L6.has(f)||I0(f,!1,i),I0(f,!0,i))});var o=i.nodeType===9?i:i.ownerDocument;o===null||o[vp]||(o[vp]=!0,I0("selectionchange",!1,o))}}function Gb(i,o,f,p){switch(x5(o)){case 2:var b=rN;break;case 8:b=aN;break;default:b=Q0}f=b.bind(null,o,f,i),b=void 0,!Wi||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(b=!0),p?b!==void 0?i.addEventListener(o,f,{capture:!0,passive:b}):i.addEventListener(o,f,!0):b!==void 0?i.addEventListener(o,f,{passive:b}):i.addEventListener(o,f,!1)}function U0(i,o,f,p,b){var S=p;if((o&1)===0&&(o&2)===0&&p!==null)e:for(;;){if(p===null)return;var M=p.tag;if(M===3||M===4){var Q=p.stateNode.containerInfo;if(Q===b)break;if(M===4)for(M=p.return;M!==null;){var me=M.tag;if((me===3||me===4)&&M.stateNode.containerInfo===b)return;M=M.return}for(;Q!==null;){if(M=Bn(Q),M===null)return;if(me=M.tag,me===5||me===6||me===26||me===27){p=S=M;continue e}Q=Q.parentNode}}p=p.return}Sc(function(){var Oe=S,$e=Ru(f),Ge=[];e:{var ke=eh.get(i);if(ke!==void 0){var Me=Ki,yt=i;switch(i){case"keypress":if(hi(f)===0)break e;case"keydown":case"keyup":Me=Xt;break;case"focusin":yt="focus",Me=ql;break;case"focusout":yt="blur",Me=ql;break;case"beforeblur":case"afterblur":Me=ql;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Me=Pu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Me=Ds;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Me=Qn;break;case ds:case Wl:case sl:Me=Ko;break;case Qf:Me=ur;break;case"scroll":case"scrollend":Me=Wo;break;case"wheel":Me=br;break;case"copy":case"cut":case"paste":Me=C;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Me=An;break;case"toggle":case"beforetoggle":Me=Ps}var Vt=(o&4)!==0,or=!Vt&&(i==="scroll"||i==="scrollend"),Ae=Vt?ke!==null?ke+"Capture":null:ke;Vt=[];for(var we=Oe,je;we!==null;){var He=we;if(je=He.stateNode,He=He.tag,He!==5&&He!==26&&He!==27||je===null||Ae===null||(He=Vo(we,Ae),He!=null&&Vt.push(Ah(we,He,je))),or)break;we=we.return}0<Vt.length&&(ke=new Me(ke,yt,null,f,$e),Ge.push({event:ke,listeners:Vt}))}}if((o&7)===0){e:{if(ke=i==="mouseover"||i==="pointerover",Me=i==="mouseout"||i==="pointerout",ke&&f!==cs&&(yt=f.relatedTarget||f.fromElement)&&(Bn(yt)||yt[Qe]))break e;if((Me||ke)&&(ke=$e.window===$e?$e:(ke=$e.ownerDocument)?ke.defaultView||ke.parentWindow:window,Me?(yt=f.relatedTarget||f.toElement,Me=Oe,yt=yt?Bn(yt):null,yt!==null&&(or=s(yt),Vt=yt.tag,yt!==or||Vt!==5&&Vt!==27&&Vt!==6)&&(yt=null)):(Me=null,yt=Oe),Me!==yt)){if(Vt=Pu,He="onMouseLeave",Ae="onMouseEnter",we="mouse",(i==="pointerout"||i==="pointerover")&&(Vt=An,He="onPointerLeave",Ae="onPointerEnter",we="pointer"),or=Me==null?ke:En(Me),je=yt==null?ke:En(yt),ke=new Vt(He,we+"leave",Me,f,$e),ke.target=or,ke.relatedTarget=je,He=null,Bn($e)===Oe&&(Vt=new Vt(Ae,we+"enter",yt,f,$e),Vt.target=je,Vt.relatedTarget=or,He=Vt),or=He,Me&&yt)t:{for(Vt=j6,Ae=Me,we=yt,je=0,He=Ae;He;He=Vt(He))je++;He=0;for(var Mt=we;Mt;Mt=Vt(Mt))He++;for(;0<je-He;)Ae=Vt(Ae),je--;for(;0<He-je;)we=Vt(we),He--;for(;je--;){if(Ae===we||we!==null&&Ae===we.alternate){Vt=Ae;break t}Ae=Vt(Ae),we=Vt(we)}Vt=null}else Vt=null;Me!==null&&Wb(Ge,ke,Me,Vt,!1),yt!==null&&or!==null&&Wb(Ge,or,yt,Vt,!0)}}e:{if(ke=Oe?En(Oe):window,Me=ke.nodeName&&ke.nodeName.toLowerCase(),Me==="select"||Me==="input"&&ke.type==="file")var $n=el;else if(Fu(ke))if(fo)$n=Br;else{$n=Hl;var Nt=ho}else Me=ke.nodeName,!Me||Me.toLowerCase()!=="input"||ke.type!=="checkbox"&&ke.type!=="radio"?Oe&&Ou(Oe.elementType)&&($n=el):$n=rl;if($n&&($n=$n(i,Oe))){Zo(Ge,$n,f,$e);break e}Nt&&Nt(i,ke,Oe),i==="focusout"&&Oe&&ke.type==="number"&&Oe.memoizedProps.value!=null&&ju(ke,"number",ke.value)}switch(Nt=Oe?En(Oe):window,i){case"focusin":(Fu(Nt)||Nt.contentEditable==="true")&&(di=Nt,Xi=Oe,_i=null);break;case"focusout":_i=Xi=di=null;break;case"mousedown":mo=!0;break;case"contextmenu":case"mouseup":case"dragend":mo=!1,ya(Ge,f,$e);break;case"selectionchange":if(il)break;case"keydown":case"keyup":ya(Ge,f,$e)}var gn;if(Ms)e:{switch(i){case"compositionstart":var jn="onCompositionStart";break e;case"compositionend":jn="onCompositionEnd";break e;case"compositionupdate":jn="onCompositionUpdate";break e}jn=void 0}else Si?ga(i,f)&&(jn="onCompositionEnd"):i==="keydown"&&f.keyCode===229&&(jn="onCompositionStart");jn&&(oo&&f.locale!=="ko"&&(Si||jn!=="onCompositionStart"?jn==="onCompositionEnd"&&Si&&(gn=$l()):(fs=$e,Du="value"in fs?fs.value:fs.textContent,Si=!0)),Nt=yp(Oe,jn),0<Nt.length&&(jn=new ue(jn,i,null,f,$e),Ge.push({event:jn,listeners:Nt}),gn?jn.data=gn:(gn=lo(f),gn!==null&&(jn.data=gn)))),(gn=so?Iu(i,f):hs(i,f))&&(jn=yp(Oe,"onBeforeInput"),0<jn.length&&(Nt=new ue("onBeforeInput","beforeinput",null,f,$e),Ge.push({event:Nt,listeners:jn}),Nt.data=gn)),N6(Ge,i,Oe,f,$e)}Vb(Ge,o)})}function Ah(i,o,f){return{instance:i,listener:o,currentTarget:f}}function yp(i,o){for(var f=o+"Capture",p=[];i!==null;){var b=i,S=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||S===null||(b=Vo(i,f),b!=null&&p.unshift(Ah(i,b,S)),b=Vo(i,o),b!=null&&p.push(Ah(i,b,S))),i.tag===3)return p;i=i.return}return[]}function j6(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Wb(i,o,f,p,b){for(var S=o._reactName,M=[];f!==null&&f!==p;){var Q=f,me=Q.alternate,Oe=Q.stateNode;if(Q=Q.tag,me!==null&&me===p)break;Q!==5&&Q!==26&&Q!==27||Oe===null||(me=Oe,b?(Oe=Vo(f,S),Oe!=null&&M.unshift(Ah(f,Oe,me))):b||(Oe=Vo(f,S),Oe!=null&&M.push(Ah(f,Oe,me)))),f=f.return}M.length!==0&&i.push({event:o,listeners:M})}var O6=/\r\n?/g,R6=/\u0000|\uFFFD/g;function Yb(i){return(typeof i=="string"?i:""+i).replace(O6,`
|
|
49
|
+
`).replace(R6,"")}function Kb(i,o){return o=Yb(o),Yb(i)===o}function sr(i,o,f,p,b,S){switch(f){case"children":typeof p=="string"?o==="body"||o==="textarea"&&p===""||Ts(i,p):(typeof p=="number"||typeof p=="bigint")&&o!=="body"&&Ts(i,""+p);break;case"className":Qa(i,"class",p);break;case"tabIndex":Qa(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Qa(i,f,p);break;case"style":Bl(i,p,S);break;case"data":if(o!=="object"){Qa(i,"data",p);break}case"src":case"href":if(p===""&&(o!=="a"||f!=="href")){i.removeAttribute(f);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(f);break}p=Vi(""+p),i.setAttribute(f,p);break;case"action":case"formAction":if(typeof p=="function"){i.setAttribute(f,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(f==="formAction"?(o!=="input"&&sr(i,o,"name",b.name,b,null),sr(i,o,"formEncType",b.formEncType,b,null),sr(i,o,"formMethod",b.formMethod,b,null),sr(i,o,"formTarget",b.formTarget,b,null)):(sr(i,o,"encType",b.encType,b,null),sr(i,o,"method",b.method,b,null),sr(i,o,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(f);break}p=Vi(""+p),i.setAttribute(f,p);break;case"onClick":p!=null&&(i.onclick=wi);break;case"onScroll":p!=null&&Tn("scroll",i);break;case"onScrollEnd":p!=null&&Tn("scrollend",i);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=f}}break;case"multiple":i.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":i.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){i.removeAttribute("xlink:href");break}f=Vi(""+p),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",f);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(f,""+p):i.removeAttribute(f);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(f,""):i.removeAttribute(f);break;case"capture":case"download":p===!0?i.setAttribute(f,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(f,p):i.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?i.setAttribute(f,p):i.removeAttribute(f);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?i.removeAttribute(f):i.setAttribute(f,p);break;case"popover":Tn("beforetoggle",i),Tn("toggle",i),ua(i,"popover",p);break;case"xlinkActuate":Kt(i,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Kt(i,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Kt(i,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Kt(i,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Kt(i,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Kt(i,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Kt(i,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Kt(i,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Kt(i,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":ua(i,"is",p);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=Jf.get(f)||f,ua(i,f,p))}}function B0(i,o,f,p,b,S){switch(f){case"style":Bl(i,p,S);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(f=p.__html,f!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=f}}break;case"children":typeof p=="string"?Ts(i,p):(typeof p=="number"||typeof p=="bigint")&&Ts(i,""+p);break;case"onScroll":p!=null&&Tn("scroll",i);break;case"onScrollEnd":p!=null&&Tn("scrollend",i);break;case"onClick":p!=null&&(i.onclick=wi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Nr.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(b=f.endsWith("Capture"),o=f.slice(2,b?f.length-7:void 0),S=i[ct]||null,S=S!=null?S[f]:null,typeof S=="function"&&i.removeEventListener(o,S,b),typeof p=="function")){typeof S!="function"&&S!==null&&(f in i?i[f]=null:i.hasAttribute(f)&&i.removeAttribute(f)),i.addEventListener(o,p,b);break e}f in i?i[f]=p:p===!0?i.setAttribute(f,""):ua(i,f,p)}}}function Wa(i,o,f){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tn("error",i),Tn("load",i);var p=!1,b=!1,S;for(S in f)if(f.hasOwnProperty(S)){var M=f[S];if(M!=null)switch(S){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:sr(i,o,S,M,f,null)}}b&&sr(i,o,"srcSet",f.srcSet,f,null),p&&sr(i,o,"src",f.src,f,null);return;case"input":Tn("invalid",i);var Q=S=M=b=null,me=null,Oe=null;for(p in f)if(f.hasOwnProperty(p)){var $e=f[p];if($e!=null)switch(p){case"name":b=$e;break;case"type":M=$e;break;case"checked":me=$e;break;case"defaultChecked":Oe=$e;break;case"value":S=$e;break;case"defaultValue":Q=$e;break;case"children":case"dangerouslySetInnerHTML":if($e!=null)throw Error(r(137,o));break;default:sr(i,o,p,$e,f,null)}}Lu(i,S,Q,me,Oe,M,b,!1);return;case"select":Tn("invalid",i),p=M=S=null;for(b in f)if(f.hasOwnProperty(b)&&(Q=f[b],Q!=null))switch(b){case"value":S=Q;break;case"defaultValue":M=Q;break;case"multiple":p=Q;default:sr(i,o,b,Q,f,null)}o=S,f=M,i.multiple=!!p,o!=null?ao(i,!!p,o,!1):f!=null&&ao(i,!!p,f,!0);return;case"textarea":Tn("invalid",i),S=b=p=null;for(M in f)if(f.hasOwnProperty(M)&&(Q=f[M],Q!=null))switch(M){case"value":p=Q;break;case"defaultValue":b=Q;break;case"children":S=Q;break;case"dangerouslySetInnerHTML":if(Q!=null)throw Error(r(91));break;default:sr(i,o,M,Q,f,null)}Hi(i,p,b,S);return;case"option":for(me in f)if(f.hasOwnProperty(me)&&(p=f[me],p!=null))switch(me){case"selected":i.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:sr(i,o,me,p,f,null)}return;case"dialog":Tn("beforetoggle",i),Tn("toggle",i),Tn("cancel",i),Tn("close",i);break;case"iframe":case"object":Tn("load",i);break;case"video":case"audio":for(p=0;p<Eh.length;p++)Tn(Eh[p],i);break;case"image":Tn("error",i),Tn("load",i);break;case"details":Tn("toggle",i);break;case"embed":case"source":case"link":Tn("error",i),Tn("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Oe in f)if(f.hasOwnProperty(Oe)&&(p=f[Oe],p!=null))switch(Oe){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,o));default:sr(i,o,Oe,p,f,null)}return;default:if(Ou(o)){for($e in f)f.hasOwnProperty($e)&&(p=f[$e],p!==void 0&&B0(i,o,$e,p,f,void 0));return}}for(Q in f)f.hasOwnProperty(Q)&&(p=f[Q],p!=null&&sr(i,o,Q,p,f,null))}function k6(i,o,f,p){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,S=null,M=null,Q=null,me=null,Oe=null,$e=null;for(Me in f){var Ge=f[Me];if(f.hasOwnProperty(Me)&&Ge!=null)switch(Me){case"checked":break;case"value":break;case"defaultValue":me=Ge;default:p.hasOwnProperty(Me)||sr(i,o,Me,null,p,Ge)}}for(var ke in p){var Me=p[ke];if(Ge=f[ke],p.hasOwnProperty(ke)&&(Me!=null||Ge!=null))switch(ke){case"type":S=Me;break;case"name":b=Me;break;case"checked":Oe=Me;break;case"defaultChecked":$e=Me;break;case"value":M=Me;break;case"defaultValue":Q=Me;break;case"children":case"dangerouslySetInnerHTML":if(Me!=null)throw Error(r(137,o));break;default:Me!==Ge&&sr(i,o,ke,Me,p,Ge)}}Dr(i,M,Q,me,Oe,$e,S,b);return;case"select":Me=M=Q=ke=null;for(S in f)if(me=f[S],f.hasOwnProperty(S)&&me!=null)switch(S){case"value":break;case"multiple":Me=me;default:p.hasOwnProperty(S)||sr(i,o,S,null,p,me)}for(b in p)if(S=p[b],me=f[b],p.hasOwnProperty(b)&&(S!=null||me!=null))switch(b){case"value":ke=S;break;case"defaultValue":Q=S;break;case"multiple":M=S;default:S!==me&&sr(i,o,b,S,p,me)}o=Q,f=M,p=Me,ke!=null?ao(i,!!f,ke,!1):!!p!=!!f&&(o!=null?ao(i,!!f,o,!0):ao(i,!!f,f?[]:"",!1));return;case"textarea":Me=ke=null;for(Q in f)if(b=f[Q],f.hasOwnProperty(Q)&&b!=null&&!p.hasOwnProperty(Q))switch(Q){case"value":break;case"children":break;default:sr(i,o,Q,null,p,b)}for(M in p)if(b=p[M],S=f[M],p.hasOwnProperty(M)&&(b!=null||S!=null))switch(M){case"value":ke=b;break;case"defaultValue":Me=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==S&&sr(i,o,M,b,p,S)}wc(i,ke,Me);return;case"option":for(var yt in f)if(ke=f[yt],f.hasOwnProperty(yt)&&ke!=null&&!p.hasOwnProperty(yt))switch(yt){case"selected":i.selected=!1;break;default:sr(i,o,yt,null,p,ke)}for(me in p)if(ke=p[me],Me=f[me],p.hasOwnProperty(me)&&ke!==Me&&(ke!=null||Me!=null))switch(me){case"selected":i.selected=ke&&typeof ke!="function"&&typeof ke!="symbol";break;default:sr(i,o,me,ke,p,Me)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Vt in f)ke=f[Vt],f.hasOwnProperty(Vt)&&ke!=null&&!p.hasOwnProperty(Vt)&&sr(i,o,Vt,null,p,ke);for(Oe in p)if(ke=p[Oe],Me=f[Oe],p.hasOwnProperty(Oe)&&ke!==Me&&(ke!=null||Me!=null))switch(Oe){case"children":case"dangerouslySetInnerHTML":if(ke!=null)throw Error(r(137,o));break;default:sr(i,o,Oe,ke,p,Me)}return;default:if(Ou(o)){for(var or in f)ke=f[or],f.hasOwnProperty(or)&&ke!==void 0&&!p.hasOwnProperty(or)&&B0(i,o,or,void 0,p,ke);for($e in p)ke=p[$e],Me=f[$e],!p.hasOwnProperty($e)||ke===Me||ke===void 0&&Me===void 0||B0(i,o,$e,ke,p,Me);return}}for(var Ae in f)ke=f[Ae],f.hasOwnProperty(Ae)&&ke!=null&&!p.hasOwnProperty(Ae)&&sr(i,o,Ae,null,p,ke);for(Ge in p)ke=p[Ge],Me=f[Ge],!p.hasOwnProperty(Ge)||ke===Me||ke==null&&Me==null||sr(i,o,Ge,ke,p,Me)}function Jb(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function D6(){if(typeof performance.getEntriesByType=="function"){for(var i=0,o=0,f=performance.getEntriesByType("resource"),p=0;p<f.length;p++){var b=f[p],S=b.transferSize,M=b.initiatorType,Q=b.duration;if(S&&Q&&Jb(M)){for(M=0,Q=b.responseEnd,p+=1;p<f.length;p++){var me=f[p],Oe=me.startTime;if(Oe>Q)break;var $e=me.transferSize,Ge=me.initiatorType;$e&&Jb(Ge)&&(me=me.responseEnd,M+=$e*(me<Q?1:(Q-Oe)/(me-Oe)))}if(--p,o+=8*(S+M)/(b.duration/1e3),i++,10<i)break}}if(0<i)return o/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var $0=null,z0=null;function bp(i){return i.nodeType===9?i:i.ownerDocument}function Xb(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Zb(i,o){if(i===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&o==="foreignObject"?0:i}function q0(i,o){return i==="textarea"||i==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var H0=null;function P6(){var i=window.event;return i&&i.type==="popstate"?i===H0?!1:(H0=i,!0):(H0=null,!1)}var Qb=typeof setTimeout=="function"?setTimeout:void 0,M6=typeof clearTimeout=="function"?clearTimeout:void 0,e5=typeof Promise=="function"?Promise:void 0,I6=typeof queueMicrotask=="function"?queueMicrotask:typeof e5<"u"?function(i){return e5.resolve(null).then(i).catch(F6)}:Qb;function F6(i){setTimeout(function(){throw i})}function fu(i){return i==="head"}function t5(i,o){var f=o,p=0;do{var b=f.nextSibling;if(i.removeChild(f),b&&b.nodeType===8)if(f=b.data,f==="/$"||f==="/&"){if(p===0){i.removeChild(b),sf(o);return}p--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")p++;else if(f==="html")Nh(i.ownerDocument.documentElement);else if(f==="head"){f=i.ownerDocument.head,Nh(f);for(var S=f.firstChild;S;){var M=S.nextSibling,Q=S.nodeName;S[Yt]||Q==="SCRIPT"||Q==="STYLE"||Q==="LINK"&&S.rel.toLowerCase()==="stylesheet"||f.removeChild(S),S=M}}else f==="body"&&Nh(i.ownerDocument.body);f=b}while(f);sf(o)}function n5(i,o){var f=i;i=0;do{var p=f.nextSibling;if(f.nodeType===1?o?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(o?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),p&&p.nodeType===8)if(f=p.data,f==="/$"){if(i===0)break;i--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||i++;f=p}while(f)}function V0(i){var o=i.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var f=o;switch(o=o.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":V0(f),bn(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}i.removeChild(f)}}function U6(i,o,f,p){for(;i.nodeType===1;){var b=f;if(i.nodeName.toLowerCase()!==o.toLowerCase()){if(!p&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(p){if(!i[Yt])switch(o){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(S=i.getAttribute("rel"),S==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(S!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(S=i.getAttribute("src"),(S!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&S&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(o==="input"&&i.type==="hidden"){var S=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===S)return i}else return i;if(i=vs(i.nextSibling),i===null)break}return null}function B6(i,o,f){if(o==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!f||(i=vs(i.nextSibling),i===null))return null;return i}function r5(i,o){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=vs(i.nextSibling),i===null))return null;return i}function G0(i){return i.data==="$?"||i.data==="$~"}function W0(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function $6(i,o){var f=i.ownerDocument;if(i.data==="$~")i._reactRetry=o;else if(i.data!=="$?"||f.readyState!=="loading")o();else{var p=function(){o(),f.removeEventListener("DOMContentLoaded",p)};f.addEventListener("DOMContentLoaded",p),i._reactRetry=p}}function vs(i){for(;i!=null;i=i.nextSibling){var o=i.nodeType;if(o===1||o===3)break;if(o===8){if(o=i.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return i}var Y0=null;function a5(i){i=i.nextSibling;for(var o=0;i;){if(i.nodeType===8){var f=i.data;if(f==="/$"||f==="/&"){if(o===0)return vs(i.nextSibling);o--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||o++}i=i.nextSibling}return null}function i5(i){i=i.previousSibling;for(var o=0;i;){if(i.nodeType===8){var f=i.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(o===0)return i;o--}else f!=="/$"&&f!=="/&"||o++}i=i.previousSibling}return null}function s5(i,o,f){switch(o=bp(f),i){case"html":if(i=o.documentElement,!i)throw Error(r(452));return i;case"head":if(i=o.head,!i)throw Error(r(453));return i;case"body":if(i=o.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Nh(i){for(var o=i.attributes;o.length;)i.removeAttributeNode(o[0]);bn(i)}var ys=new Map,o5=new Set;function wp(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var _l=oe.d;oe.d={f:z6,r:q6,D:H6,C:V6,L:G6,m:W6,X:K6,S:Y6,M:J6};function z6(){var i=_l.f(),o=fp();return i||o}function q6(i){var o=_n(i);o!==null&&o.tag===5&&o.type==="form"?E2(o):_l.r(i)}var nf=typeof document>"u"?null:document;function l5(i,o,f){var p=nf;if(p&&typeof o=="string"&&o){var b=vr(o);b='link[rel="'+i+'"][href="'+b+'"]',typeof f=="string"&&(b+='[crossorigin="'+f+'"]'),o5.has(b)||(o5.add(b),i={rel:i,crossOrigin:f,href:o},p.querySelector(b)===null&&(o=p.createElement("link"),Wa(o,"link",i),wn(o),p.head.appendChild(o)))}}function H6(i){_l.D(i),l5("dns-prefetch",i,null)}function V6(i,o){_l.C(i,o),l5("preconnect",i,o)}function G6(i,o,f){_l.L(i,o,f);var p=nf;if(p&&i&&o){var b='link[rel="preload"][as="'+vr(o)+'"]';o==="image"&&f&&f.imageSrcSet?(b+='[imagesrcset="'+vr(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(b+='[imagesizes="'+vr(f.imageSizes)+'"]')):b+='[href="'+vr(i)+'"]';var S=b;switch(o){case"style":S=rf(i);break;case"script":S=af(i)}ys.has(S)||(i=m({rel:"preload",href:o==="image"&&f&&f.imageSrcSet?void 0:i,as:o},f),ys.set(S,i),p.querySelector(b)!==null||o==="style"&&p.querySelector(Ch(S))||o==="script"&&p.querySelector(Th(S))||(o=p.createElement("link"),Wa(o,"link",i),wn(o),p.head.appendChild(o)))}}function W6(i,o){_l.m(i,o);var f=nf;if(f&&i){var p=o&&typeof o.as=="string"?o.as:"script",b='link[rel="modulepreload"][as="'+vr(p)+'"][href="'+vr(i)+'"]',S=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=af(i)}if(!ys.has(S)&&(i=m({rel:"modulepreload",href:i},o),ys.set(S,i),f.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Th(S)))return}p=f.createElement("link"),Wa(p,"link",i),wn(p),f.head.appendChild(p)}}}function Y6(i,o,f){_l.S(i,o,f);var p=nf;if(p&&i){var b=lr(p).hoistableStyles,S=rf(i);o=o||"default";var M=b.get(S);if(!M){var Q={loading:0,preload:null};if(M=p.querySelector(Ch(S)))Q.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":o},f),(f=ys.get(S))&&K0(i,f);var me=M=p.createElement("link");wn(me),Wa(me,"link",i),me._p=new Promise(function(Oe,$e){me.onload=Oe,me.onerror=$e}),me.addEventListener("load",function(){Q.loading|=1}),me.addEventListener("error",function(){Q.loading|=2}),Q.loading|=4,xp(M,o,p)}M={type:"stylesheet",instance:M,count:1,state:Q},b.set(S,M)}}}function K6(i,o){_l.X(i,o);var f=nf;if(f&&i){var p=lr(f).hoistableScripts,b=af(i),S=p.get(b);S||(S=f.querySelector(Th(b)),S||(i=m({src:i,async:!0},o),(o=ys.get(b))&&J0(i,o),S=f.createElement("script"),wn(S),Wa(S,"link",i),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(b,S))}}function J6(i,o){_l.M(i,o);var f=nf;if(f&&i){var p=lr(f).hoistableScripts,b=af(i),S=p.get(b);S||(S=f.querySelector(Th(b)),S||(i=m({src:i,async:!0,type:"module"},o),(o=ys.get(b))&&J0(i,o),S=f.createElement("script"),wn(S),Wa(S,"link",i),f.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},p.set(b,S))}}function u5(i,o,f,p){var b=(b=z.current)?wp(b):null;if(!b)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(o=rf(f.href),f=lr(b).hoistableStyles,p=f.get(o),p||(p={type:"style",instance:null,count:0,state:null},f.set(o,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){i=rf(f.href);var S=lr(b).hoistableStyles,M=S.get(i);if(M||(b=b.ownerDocument||b,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(i,M),(S=b.querySelector(Ch(i)))&&!S._p&&(M.instance=S,M.state.loading=5),ys.has(i)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},ys.set(i,f),S||X6(b,i,f,M.state))),o&&p===null)throw Error(r(528,""));return M}if(o&&p!==null)throw Error(r(529,""));return null;case"script":return o=f.async,f=f.src,typeof f=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=af(f),f=lr(b).hoistableScripts,p=f.get(o),p||(p={type:"script",instance:null,count:0,state:null},f.set(o,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function rf(i){return'href="'+vr(i)+'"'}function Ch(i){return'link[rel="stylesheet"]['+i+"]"}function c5(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function X6(i,o,f,p){i.querySelector('link[rel="preload"][as="style"]['+o+"]")?p.loading=1:(o=i.createElement("link"),p.preload=o,o.addEventListener("load",function(){return p.loading|=1}),o.addEventListener("error",function(){return p.loading|=2}),Wa(o,"link",f),wn(o),i.head.appendChild(o))}function af(i){return'[src="'+vr(i)+'"]'}function Th(i){return"script[async]"+i}function f5(i,o,f){if(o.count++,o.instance===null)switch(o.type){case"style":var p=i.querySelector('style[data-href~="'+vr(f.href)+'"]');if(p)return o.instance=p,wn(p),p;var b=m({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),wn(p),Wa(p,"style",b),xp(p,f.precedence,i),o.instance=p;case"stylesheet":b=rf(f.href);var S=i.querySelector(Ch(b));if(S)return o.state.loading|=4,o.instance=S,wn(S),S;p=c5(f),(b=ys.get(b))&&K0(p,b),S=(i.ownerDocument||i).createElement("link"),wn(S);var M=S;return M._p=new Promise(function(Q,me){M.onload=Q,M.onerror=me}),Wa(S,"link",p),o.state.loading|=4,xp(S,f.precedence,i),o.instance=S;case"script":return S=af(f.src),(b=i.querySelector(Th(S)))?(o.instance=b,wn(b),b):(p=f,(b=ys.get(S))&&(p=m({},f),J0(p,b)),i=i.ownerDocument||i,b=i.createElement("script"),wn(b),Wa(b,"link",p),i.head.appendChild(b),o.instance=b);case"void":return null;default:throw Error(r(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(p=o.instance,o.state.loading|=4,xp(p,f.precedence,i));return o.instance}function xp(i,o,f){for(var p=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,S=b,M=0;M<p.length;M++){var Q=p[M];if(Q.dataset.precedence===o)S=Q;else if(S!==b)break}S?S.parentNode.insertBefore(i,S.nextSibling):(o=f.nodeType===9?f.head:f,o.insertBefore(i,o.firstChild))}function K0(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.title==null&&(i.title=o.title)}function J0(i,o){i.crossOrigin==null&&(i.crossOrigin=o.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=o.referrerPolicy),i.integrity==null&&(i.integrity=o.integrity)}var Sp=null;function h5(i,o,f){if(Sp===null){var p=new Map,b=Sp=new Map;b.set(f,p)}else b=Sp,p=b.get(f),p||(p=new Map,b.set(f,p));if(p.has(i))return p;for(p.set(i,null),f=f.getElementsByTagName(i),b=0;b<f.length;b++){var S=f[b];if(!(S[Yt]||S[et]||i==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var M=S.getAttribute(o)||"";M=i+M;var Q=p.get(M);Q?Q.push(S):p.set(M,[S])}}return p}function d5(i,o,f){i=i.ownerDocument||i,i.head.insertBefore(f,o==="title"?i.querySelector("head > title"):null)}function Z6(i,o,f){if(f===1||o.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return i=o.disabled,typeof o.precedence=="string"&&i==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function p5(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function Q6(i,o,f,p){if(f.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var b=rf(p.href),S=o.querySelector(Ch(b));if(S){o=S._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(i.count++,i=_p.bind(i),o.then(i,i)),f.state.loading|=4,f.instance=S,wn(S);return}S=o.ownerDocument||o,p=c5(p),(b=ys.get(b))&&K0(p,b),S=S.createElement("link"),wn(S);var M=S;M._p=new Promise(function(Q,me){M.onload=Q,M.onerror=me}),Wa(S,"link",p),f.instance=S}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(f,o),(o=f.state.preload)&&(f.state.loading&3)===0&&(i.count++,f=_p.bind(i),o.addEventListener("load",f),o.addEventListener("error",f))}}var X0=0;function eN(i,o){return i.stylesheets&&i.count===0&&Ap(i,i.stylesheets),0<i.count||0<i.imgCount?function(f){var p=setTimeout(function(){if(i.stylesheets&&Ap(i,i.stylesheets),i.unsuspend){var S=i.unsuspend;i.unsuspend=null,S()}},6e4+o);0<i.imgBytes&&X0===0&&(X0=62500*D6());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Ap(i,i.stylesheets),i.unsuspend)){var S=i.unsuspend;i.unsuspend=null,S()}},(i.imgBytes>X0?50:800)+o);return i.unsuspend=f,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function _p(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ap(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Ep=null;function Ap(i,o){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Ep=new Map,o.forEach(tN,i),Ep=null,_p.call(i))}function tN(i,o){if(!(o.state.loading&4)){var f=Ep.get(i);if(f)var p=f.get(null);else{f=new Map,Ep.set(i,f);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<b.length;S++){var M=b[S];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(f.set(M.dataset.precedence,M),p=M)}p&&f.set(null,p)}b=o.instance,M=b.getAttribute("data-precedence"),S=f.get(M)||p,S===p&&f.set(null,b),f.set(M,b),this.count++,p=_p.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),S?S.parentNode.insertBefore(b,S.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),o.state.loading|=4}}var Lh={$$typeof:L,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function nN(i,o,f,p,b,S,M,Q,me){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ma(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ma(0),this.hiddenUpdates=ma(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=S,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=me,this.incompleteTransitions=new Map}function m5(i,o,f,p,b,S,M,Q,me,Oe,$e,Ge){return i=new nN(i,o,f,M,me,Oe,$e,Ge,Q),o=1,S===!0&&(o|=24),S=Da(3,null,null,o),i.current=S,S.stateNode=i,o=Ql(),o.refCount++,i.pooledCache=o,o.refCount++,S.memoizedState={element:p,isDehydrated:f,cache:o},nt(S),i}function g5(i){return i?(i=ba,i):ba}function v5(i,o,f,p,b,S){b=g5(b),p.context===null?p.context=b:p.pendingContext=b,p=$t(o),p.payload={element:f},S=S===void 0?null:S,S!==null&&(p.callback=S),f=dn(i,p,o),f!==null&&(Ii(f,i,o),Vn(f,i,o))}function y5(i,o){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var f=i.retryLane;i.retryLane=f!==0&&f<o?f:o}}function Z0(i,o){y5(i,o),(i=i.alternate)&&y5(i,o)}function b5(i){if(i.tag===13||i.tag===31){var o=Us(i,67108864);o!==null&&Ii(o,i,67108864),Z0(i,67108864)}}function w5(i){if(i.tag===13||i.tag===31){var o=ts();o=ve(o);var f=Us(i,o);f!==null&&Ii(f,i,o),Z0(i,o)}}var Np=!0;function rN(i,o,f,p){var b=te.T;te.T=null;var S=oe.p;try{oe.p=2,Q0(i,o,f,p)}finally{oe.p=S,te.T=b}}function aN(i,o,f,p){var b=te.T;te.T=null;var S=oe.p;try{oe.p=8,Q0(i,o,f,p)}finally{oe.p=S,te.T=b}}function Q0(i,o,f,p){if(Np){var b=e1(p);if(b===null)U0(i,o,p,Cp,f),S5(i,p);else if(sN(b,i,o,f,p))p.stopPropagation();else if(S5(i,p),o&4&&-1<iN.indexOf(i)){for(;b!==null;){var S=_n(b);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var M=_t(S.pendingLanes);if(M!==0){var Q=S;for(Q.pendingLanes|=2,Q.entangledLanes|=2;M;){var me=1<<31-mn(M);Q.entanglements[1]|=me,M&=~me}To(S),(Wn&6)===0&&(up=en()+500,_h(0))}}break;case 31:case 13:Q=Us(S,2),Q!==null&&Ii(Q,S,2),fp(),Z0(S,2)}if(S=e1(p),S===null&&U0(i,o,p,Cp,f),S===b)break;b=S}b!==null&&p.stopPropagation()}else U0(i,o,p,null,f)}}function e1(i){return i=Ru(i),t1(i)}var Cp=null;function t1(i){if(Cp=null,i=Bn(i),i!==null){var o=s(i);if(o===null)i=null;else{var f=o.tag;if(f===13){if(i=l(o),i!==null)return i;i=null}else if(f===31){if(i=u(o),i!==null)return i;i=null}else if(f===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;i=null}else o!==i&&(i=null)}}return Cp=i,null}function x5(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(tn()){case Bt:return 2;case pn:return 8;case an:case lt:return 32;case kt:return 268435456;default:return 32}default:return 32}}var n1=!1,hu=null,du=null,pu=null,jh=new Map,Oh=new Map,mu=[],iN="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function S5(i,o){switch(i){case"focusin":case"focusout":hu=null;break;case"dragenter":case"dragleave":du=null;break;case"mouseover":case"mouseout":pu=null;break;case"pointerover":case"pointerout":jh.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oh.delete(o.pointerId)}}function Rh(i,o,f,p,b,S){return i===null||i.nativeEvent!==S?(i={blockedOn:o,domEventName:f,eventSystemFlags:p,nativeEvent:S,targetContainers:[b]},o!==null&&(o=_n(o),o!==null&&b5(o)),i):(i.eventSystemFlags|=p,o=i.targetContainers,b!==null&&o.indexOf(b)===-1&&o.push(b),i)}function sN(i,o,f,p,b){switch(o){case"focusin":return hu=Rh(hu,i,o,f,p,b),!0;case"dragenter":return du=Rh(du,i,o,f,p,b),!0;case"mouseover":return pu=Rh(pu,i,o,f,p,b),!0;case"pointerover":var S=b.pointerId;return jh.set(S,Rh(jh.get(S)||null,i,o,f,p,b)),!0;case"gotpointercapture":return S=b.pointerId,Oh.set(S,Rh(Oh.get(S)||null,i,o,f,p,b)),!0}return!1}function _5(i){var o=Bn(i.target);if(o!==null){var f=s(o);if(f!==null){if(o=f.tag,o===13){if(o=l(f),o!==null){i.blockedOn=o,Je(i.priority,function(){w5(f)});return}}else if(o===31){if(o=u(f),o!==null){i.blockedOn=o,Je(i.priority,function(){w5(f)});return}}else if(o===3&&f.stateNode.current.memoizedState.isDehydrated){i.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Tp(i){if(i.blockedOn!==null)return!1;for(var o=i.targetContainers;0<o.length;){var f=e1(i.nativeEvent);if(f===null){f=i.nativeEvent;var p=new f.constructor(f.type,f);cs=p,f.target.dispatchEvent(p),cs=null}else return o=_n(f),o!==null&&b5(o),i.blockedOn=f,!1;o.shift()}return!0}function E5(i,o,f){Tp(i)&&f.delete(o)}function oN(){n1=!1,hu!==null&&Tp(hu)&&(hu=null),du!==null&&Tp(du)&&(du=null),pu!==null&&Tp(pu)&&(pu=null),jh.forEach(E5),Oh.forEach(E5)}function Lp(i,o){i.blockedOn===o&&(i.blockedOn=null,n1||(n1=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,oN)))}var jp=null;function A5(i){jp!==i&&(jp=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===i&&(jp=null);for(var o=0;o<i.length;o+=3){var f=i[o],p=i[o+1],b=i[o+2];if(typeof p!="function"){if(t1(p||f)===null)continue;break}var S=_n(f);S!==null&&(i.splice(o,3),o-=3,e0(S,{pending:!0,data:b,method:f.method,action:p},p,b))}}))}function sf(i){function o(me){return Lp(me,i)}hu!==null&&Lp(hu,i),du!==null&&Lp(du,i),pu!==null&&Lp(pu,i),jh.forEach(o),Oh.forEach(o);for(var f=0;f<mu.length;f++){var p=mu[f];p.blockedOn===i&&(p.blockedOn=null)}for(;0<mu.length&&(f=mu[0],f.blockedOn===null);)_5(f),f.blockedOn===null&&mu.shift();if(f=(i.ownerDocument||i).$$reactFormReplay,f!=null)for(p=0;p<f.length;p+=3){var b=f[p],S=f[p+1],M=b[ct]||null;if(typeof S=="function")M||A5(f);else if(M){var Q=null;if(S&&S.hasAttribute("formAction")){if(b=S,M=S[ct]||null)Q=M.formAction;else if(t1(b)!==null)continue}else Q=M.action;typeof Q=="function"?f[p+1]=Q:(f.splice(p,3),p-=3),A5(f)}}}function N5(){function i(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(M){return b=M})},focusReset:"manual",scroll:"manual"})}function o(){b!==null&&(b(),b=null),p||setTimeout(f,20)}function f(){if(!p&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(f,100),function(){p=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),b!==null&&(b(),b=null)}}}function r1(i){this._internalRoot=i}Op.prototype.render=r1.prototype.render=function(i){var o=this._internalRoot;if(o===null)throw Error(r(409));var f=o.current,p=ts();v5(f,p,i,o,null,null)},Op.prototype.unmount=r1.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var o=i.containerInfo;v5(i.current,2,null,i,null,null),fp(),o[Qe]=null}};function Op(i){this._internalRoot=i}Op.prototype.unstable_scheduleHydration=function(i){if(i){var o=Be();i={blockedOn:null,target:i,priority:o};for(var f=0;f<mu.length&&o!==0&&o<mu[f].priority;f++);mu.splice(f,0,i),f===0&&_5(i)}};var C5=e.version;if(C5!=="19.2.7")throw Error(r(527,C5,"19.2.7"));oe.findDOMNode=function(i){var o=i._reactInternals;if(o===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(o),i=i!==null?d(i):null,i=i===null?null:i.stateNode,i};var lN={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:te,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Rp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Rp.isDisabled&&Rp.supportsFiber)try{fn=Rp.inject(lN),Dt=Rp}catch{}}return Dh.createRoot=function(i,o){if(!a(i))throw Error(r(299));var f=!1,p="",b=D2,S=P2,M=M2;return o!=null&&(o.unstable_strictMode===!0&&(f=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(b=o.onUncaughtError),o.onCaughtError!==void 0&&(S=o.onCaughtError),o.onRecoverableError!==void 0&&(M=o.onRecoverableError)),o=m5(i,1,!1,null,null,f,p,null,b,S,M,N5),i[Qe]=o.current,F0(i),new r1(o)},Dh.hydrateRoot=function(i,o,f){if(!a(i))throw Error(r(299));var p=!1,b="",S=D2,M=P2,Q=M2,me=null;return f!=null&&(f.unstable_strictMode===!0&&(p=!0),f.identifierPrefix!==void 0&&(b=f.identifierPrefix),f.onUncaughtError!==void 0&&(S=f.onUncaughtError),f.onCaughtError!==void 0&&(M=f.onCaughtError),f.onRecoverableError!==void 0&&(Q=f.onRecoverableError),f.formState!==void 0&&(me=f.formState)),o=m5(i,1,!0,o,f??null,p,b,me,S,M,Q,N5),o.context=g5(null),f=o.current,p=ts(),p=ve(p),b=$t(p),b.callback=null,dn(f,b,p),f=p,o.current.lanes=f,At(o,f),To(o),i[Qe]=o.current,F0(i),new Op(o)},Dh.version="19.2.7",Dh}var I5;function wN(){if(I5)return s1.exports;I5=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),s1.exports=bN(),s1.exports}var xN=wN();/**
|
|
50
|
+
* react-router v7.17.0
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Remix Software Inc.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
56
|
+
*
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/var Z_=t=>{throw TypeError(t)},Q_=(t,e,n)=>e.has(t)||Z_("Cannot "+n),ws=(t,e,n)=>(Q_(t,e,"read from private field"),n?n.call(t):e.get(t)),Gh=(t,e,n)=>e.has(t)?Z_("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Lo=(t,e,n,r)=>(Q_(t,e,"write to private field"),e.set(t,n),n),F5="popstate";function U5(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function SN(t={}){function e(r,a){var h;let s=(h=a.state)==null?void 0:h.masked,{pathname:l,search:u,hash:c}=s||r.location;return od("",{pathname:l,search:u,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:Bo(a)}return EN(e,n,null,t)}function cn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Kr(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function _N(){return Math.random().toString(36).substring(2,10)}function B5(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function od(t,e,n=null,r,a){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?to(e):e,state:n,key:e&&e.key||r||_N(),mask:a}}function Bo({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function to(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substring(r),t=t.substring(0,r)),t&&(e.pathname=t)}return e}function EN(t,e,n,r={}){let{window:a=document.defaultView,v5Compat:s=!1}=r,l=a.history,u="POP",c=null,h=d();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function d(){return(l.state||{idx:null}).idx}function m(){u="POP";let N=d(),A=N==null?null:N-h;h=N,c&&c({action:u,location:_.location,delta:A})}function y(N,A){u="PUSH";let j=U5(N)?N:od(_.location,N,A);h=d()+1;let L=B5(j,h),R=_.createHref(j.mask||j);try{l.pushState(L,"",R)}catch(I){if(I instanceof DOMException&&I.name==="DataCloneError")throw I;a.location.assign(R)}s&&c&&c({action:u,location:_.location,delta:1})}function g(N,A){u="REPLACE";let j=U5(N)?N:od(_.location,N,A);h=d();let L=B5(j,h),R=_.createHref(j.mask||j);l.replaceState(L,"",R),s&&c&&c({action:u,location:_.location,delta:0})}function x(N){return e4(a,N)}let _={get action(){return u},get location(){return t(a,l)},listen(N){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(F5,m),c=N,()=>{a.removeEventListener(F5,m),c=null}},createHref(N){return e(a,N)},createURL:x,encodeLocation(N){let A=x(N);return{pathname:A.pathname,search:A.search,hash:A.hash}},push:y,replace:g,go(N){return l.go(N)}};return _}function e4(t,e,n=!1){let r="http://localhost";t&&(r=t.location.origin!=="null"?t.location.origin:t.location.href),cn(r,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Bo(e);return a=a.replace(/ $/,"%20"),!n&&a.startsWith("//")&&(a=r+a),new URL(a,r)}var Wh,$5=class{constructor(t){if(Gh(this,Wh,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(ws(this,Wh).has(t))return ws(this,Wh).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){ws(this,Wh).set(t,e)}};Wh=new WeakMap;var AN=new Set(["lazy","caseSensitive","path","id","index","children"]);function NN(t){return AN.has(t)}var CN=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function TN(t){return CN.has(t)}function LN(t){return t.index===!0}function ld(t,e,n=[],r={},a=!1){return t.map((s,l)=>{let u=[...n,String(l)],c=typeof s.id=="string"?s.id:u.join("-");if(cn(s.index!==!0||!s.children,"Cannot specify children on an index route"),cn(a||!r[c],`Found a route id collision on id "${c}". Route id's must be globally unique within Data Router usages`),LN(s)){let h={...s,id:c};return r[c]=z5(h,e(h)),h}else{let h={...s,id:c,children:void 0};return r[c]=z5(h,e(h)),s.children&&(h.children=ld(s.children,e,u,r,a)),h}})}function z5(t,e){return Object.assign(t,{...e,...typeof e.lazy=="object"&&e.lazy!=null?{lazy:{...t.lazy,...e.lazy}}:{}})}function t4(t,e,n="/"){return Ks(t,e,n,!1)}function Ks(t,e,n,r,a){let s=typeof e=="string"?to(e):e,l=_s(s.pathname||"/",n);if(l==null)return null;let u=a??vm(t),c=null,h=zN(l);for(let d=0;c==null&&d<u.length;++d)c=BN(u[d],h,r);return c}function jN(t,e){let{route:n,pathname:r,params:a}=t;return{id:n.id,pathname:r,params:a,data:e[n.id],loaderData:e[n.id],handle:n.handle}}function vm(t){let e=n4(t);return ON(e),e}function n4(t,e=[],n=[],r="",a=!1){let s=(l,u,c=a,h)=>{let d={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:u,route:l};if(d.relativePath.startsWith("/")){if(!d.relativePath.startsWith(r)&&c)return;cn(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length)}let m=Ss([r,d.relativePath]),y=n.concat(d);l.children&&l.children.length>0&&(cn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),n4(l.children,e,y,m,c)),!(l.path==null&&!l.index)&&e.push({path:m,score:FN(m,l.index),routesMeta:y})};return t.forEach((l,u)=>{var c;if(l.path===""||!((c=l.path)!=null&&c.includes("?")))s(l,u);else for(let h of r4(l.path))s(l,u,!0,h)}),e}function r4(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return a?[s,""]:[s];let l=r4(r.join("/")),u=[];return u.push(...l.map(c=>c===""?s:[s,c].join("/"))),a&&u.push(...l),u.map(c=>t.startsWith("/")&&c===""?"/":c)}function ON(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:UN(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var RN=/^:[\w-]+$/,kN=3,DN=2,PN=1,MN=10,IN=-2,q5=t=>t==="*";function FN(t,e){let n=t.split("/"),r=n.length;return n.some(q5)&&(r+=IN),e&&(r+=DN),n.filter(a=>!q5(a)).reduce((a,s)=>a+(RN.test(s)?kN:s===""?PN:MN),r)}function UN(t,e){return t.length===e.length&&t.slice(0,-1).every((r,a)=>r===e[a])?t[t.length-1]-e[e.length-1]:0}function BN(t,e,n=!1){let{routesMeta:r}=t,a={},s="/",l=[];for(let u=0;u<r.length;++u){let c=r[u],h=u===r.length-1,d=s==="/"?e:e.slice(s.length)||"/",m=Dm({path:c.relativePath,caseSensitive:c.caseSensitive,end:h},d),y=c.route;if(!m&&h&&n&&!r[r.length-1].route.index&&(m=Dm({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!m)return null;Object.assign(a,m.params),l.push({params:a,pathname:Ss([s,m.pathname]),pathnameBase:VN(Ss([s,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(s=Ss([s,m.pathnameBase]))}return l}function Dm(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,r]=$N(t.path,t.caseSensitive,t.end),a=e.match(n);if(!a)return null;let s=a[0],l=s.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:r.reduce((h,{paramName:d,isOptional:m},y)=>{if(d==="*"){let x=u[y]||"";l=s.slice(0,s.length-x.length).replace(/(.)\/+$/,"$1")}const g=u[y];return m&&!g?h[d]=void 0:h[d]=(g||"").replace(/%2F/g,"/"),h},{}),pathname:s,pathnameBase:l,pattern:t}}function $N(t,e=!1,n=!0){Kr(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let r=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,c,h,d)=>{if(r.push({paramName:u,isOptional:c!=null}),c){let m=d.charAt(h+l.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(r.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),r]}function zN(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Kr(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function _s(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function qN({basename:t,pathname:e}){return e==="/"?t:Ss([t,e])}var a4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ly=t=>a4.test(t);function HN(t,e="/"){let{pathname:n,search:r="",hash:a=""}=typeof t=="string"?to(t):t,s;return n?(n=jy(n),n.startsWith("/")?s=H5(n.substring(1),"/"):s=H5(n,e)):s=e,{pathname:s,search:GN(r),hash:WN(a)}}function H5(t,e){let n=Pm(e).split("/");return t.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function c1(t,e,n,r){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function i4(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function bg(t){let e=i4(t);return e.map((n,r)=>r===e.length-1?n.pathname:n.pathnameBase)}function Ed(t,e,n,r=!1){let a;typeof t=="string"?a=to(t):(a={...t},cn(!a.pathname||!a.pathname.includes("?"),c1("?","pathname","search",a)),cn(!a.pathname||!a.pathname.includes("#"),c1("#","pathname","hash",a)),cn(!a.search||!a.search.includes("#"),c1("#","search","hash",a)));let s=t===""||a.pathname==="",l=s?"/":a.pathname,u;if(l==null)u=n;else{let m=e.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),m-=1;a.pathname=y.join("/")}u=m>=0?e[m]:"/"}let c=HN(a,u),h=l&&l!=="/"&&l.endsWith("/"),d=(s||l===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(h||d)&&(c.pathname+="/"),c}var jy=t=>t.replace(/\/\/+/g,"/"),Ss=t=>jy(t.join("/")),Pm=t=>t.replace(/\/+$/,""),VN=t=>Pm(t).replace(/^\/*/,"/"),GN=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,WN=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Ad=class{constructor(t,e,n,r=!1){this.status=t,this.statusText=e||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ud(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Nd(t){let e=t.map(n=>n.route.path).filter(Boolean);return Ss(e)||"/"}var s4=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function o4(t,e){let n=t;if(typeof n!="string"||!a4.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(s4)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),u=_s(l.pathname,e);l.origin===s.origin&&u!=null?n=u+l.search+l.hash:a=!0}catch{Kr(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var Au=Symbol("Uninstrumented");function YN(t,e){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(a=>a({id:e.id,index:e.index,path:e.path,instrument(s){let l=Object.keys(n);for(let u of l)s[u]&&n[u].push(s[u])}}));let r={};if(typeof e.lazy=="function"&&n.lazy.length>0){let a=Nf(n.lazy,e.lazy,()=>{});a&&(r.lazy=a)}if(typeof e.lazy=="object"){let a=e.lazy;["middleware","loader","action"].forEach(s=>{let l=a[s],u=n[`lazy.${s}`];if(typeof l=="function"&&u.length>0){let c=Nf(u,l,()=>{});c&&(r.lazy=Object.assign(r.lazy||{},{[s]:c}))}})}return["loader","action"].forEach(a=>{let s=e[a];if(typeof s=="function"&&n[a].length>0){let l=s[Au]??s,u=Nf(n[a],l,(...c)=>V5(c[0]));u&&(a==="loader"&&l.hydrate===!0&&(u.hydrate=!0),u[Au]=l,r[a]=u)}}),e.middleware&&e.middleware.length>0&&n.middleware.length>0&&(r.middleware=e.middleware.map(a=>{let s=a[Au]??a,l=Nf(n.middleware,s,(...u)=>V5(u[0]));return l?(l[Au]=s,l):a})),r}function KN(t,e){let n={navigate:[],fetch:[]};if(e.forEach(r=>r({instrument(a){let s=Object.keys(a);for(let l of s)a[l]&&n[l].push(a[l])}})),n.navigate.length>0){let r=t.navigate[Au]??t.navigate,a=Nf(n.navigate,r,(...s)=>{let[l,u]=s;return{to:typeof l=="number"||typeof l=="string"?l:l?Bo(l):".",...G5(t,u??{})}});a&&(a[Au]=r,t.navigate=a)}if(n.fetch.length>0){let r=t.fetch[Au]??t.fetch,a=Nf(n.fetch,r,(...s)=>{let[l,,u,c]=s;return{href:u??".",fetcherKey:l,...G5(t,c??{})}});a&&(a[Au]=r,t.fetch=a)}return t}function Nf(t,e,n){return t.length===0?null:async(...r)=>{let a=await l4(t,n(...r),()=>e(...r),t.length-1);if(a.type==="error")throw a.value;return a.value}}async function l4(t,e,n,r){let a=t[r],s;if(a){let l,u=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=l4(t,e,n,r-1),s=await l,cn(s,"Expected a result"),s.type==="error"&&s.value instanceof Error?{status:"error",error:s.value}:{status:"success",error:void 0});try{await a(u,e)}catch(c){console.error("An instrumentation function threw an error:",c)}l||await u(),await l}else try{s={type:"success",value:await n()}}catch(l){s={type:"error",value:l}}return s||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function V5(t){let{request:e,context:n,params:r,pattern:a}=t;return{request:JN(e),params:{...r},pattern:a,context:XN(n)}}function G5(t,e){return{currentUrl:Bo(t.state.location),..."formMethod"in e?{formMethod:e.formMethod}:{},..."formEncType"in e?{formEncType:e.formEncType}:{},..."formData"in e?{formData:e.formData}:{},..."body"in e?{body:e.body}:{}}}function JN(t){return{method:t.method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}}}function XN(t){if(QN(t)){let e={...t};return Object.freeze(e),e}else return{get:e=>t.get(e)}}var ZN=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function QN(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===ZN}var u4=["POST","PUT","PATCH","DELETE"],eC=new Set(u4),tC=["GET",...u4],nC=new Set(tC),c4=new Set([301,302,303,307,308]),rC=new Set([307,308]),f1={state:"idle",location:void 0,matches:void 0,historyAction:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},aC={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ph={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},iC=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),f4="remix-router-transitions",h4=Symbol("ResetLoaderData"),nc,yf,wu,bf,sC=class{constructor(t){Gh(this,nc),Gh(this,yf),Gh(this,wu),Gh(this,bf),Lo(this,nc,t),Lo(this,yf,vm(t))}get stableRoutes(){return ws(this,nc)}get activeRoutes(){return ws(this,wu)??ws(this,nc)}get branches(){return ws(this,bf)??ws(this,yf)}get hasHMRRoutes(){return ws(this,wu)!=null}setRoutes(t){Lo(this,nc,t),Lo(this,yf,vm(t))}setHmrRoutes(t){Lo(this,wu,t),Lo(this,bf,vm(t))}commitHmrRoutes(){ws(this,wu)&&(Lo(this,nc,ws(this,wu)),Lo(this,yf,ws(this,bf)),Lo(this,wu,void 0),Lo(this,bf,void 0))}};nc=new WeakMap;yf=new WeakMap;wu=new WeakMap;bf=new WeakMap;function oC(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";cn(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=t.hydrationRouteProperties||[],a=t.mapRouteProperties||iC,s=a;if(t.instrumentations){let de=t.instrumentations;s=ve=>({...a(ve),...YN(de.map(Ee=>Ee.route).filter(Boolean),ve)})}let l={},u=new sC(ld(t.routes,s,void 0,l)),c=t.basename||"/";c.startsWith("/")||(c=`/${c}`);let h=t.dataStrategy||hC,d={...t.future},m=null,y=new Set,g=null,x=null,_=null,N=null,A=t.hydrationData!=null,j=Ks(u.activeRoutes,t.history.location,c,!1,u.branches),L=!1,R=null,I,ee;if(j==null&&!t.patchRoutesOnNavigation){let de=xs(404,{pathname:t.history.location.pathname}),{matches:ve,route:Ee}=kp(u.activeRoutes);I=!0,ee=!I,j=ve,R={[Ee.id]:de}}else if(j&&!t.hydrationData&&ma(j,u.activeRoutes,t.history.location.pathname).active&&(j=null),j)if(j.some(de=>de.route.lazy))I=!1,ee=!I;else if(!j.some(de=>Oy(de.route)))I=!0,ee=!I;else{let de=t.hydrationData?t.hydrationData.loaderData:null,ve=t.hydrationData?t.hydrationData.errors:null,Ee=j;if(ve){let Be=j.findIndex(Je=>ve[Je.route.id]!==void 0);Ee=Ee.slice(0,Be+1)}ee=!1,I=!0,Ee.forEach(Be=>{let Je=d4(Be.route,de,ve);ee=ee||Je.renderFallback,I=I&&!Je.shouldLoad})}else{I=!1,ee=!I,j=[];let de=ma(null,u.activeRoutes,t.history.location.pathname);de.active&&de.matches&&(L=!0,j=de.matches)}let G,P={historyAction:t.history.action,location:t.history.location,matches:j,initialized:I,renderFallback:ee,navigation:f1,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||R,fetchers:new Map,blockers:new Map},B="POP",X=null,F=!1,$,K=!1,Y=new Map,he=null,te=!1,oe=!1,le=new Set,pe=new Map,Ne=0,U=-1,O=new Map,V=new Set,Z=new Map,ie=new Map,z=new Set,se=new Map,ge,xe=null;function Re(){if(m=t.history.listen(({action:de,location:ve,delta:Ee})=>{if(ge){ge(),ge=void 0;return}Kr(se.size===0||Ee!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let Be=nn({currentLocation:P.location,nextLocation:ve,historyAction:de});if(Be&&Ee!=null){let Je=new Promise(at=>{ge=at});t.history.go(Ee*-1),kn(Be,{state:"blocked",location:ve,proceed(){kn(Be,{state:"proceeding",proceed:void 0,reset:void 0,location:ve}),Je.then(()=>t.history.go(Ee))},reset(){let at=new Map(P.blockers);at.set(Be,Ph),Pe({blockers:at})}}),X==null||X.resolve(),X=null;return}return it(de,ve)}),n){jC(e,Y);let de=()=>OC(e,Y);e.addEventListener("pagehide",de),he=()=>e.removeEventListener("pagehide",de)}return P.initialized||it("POP",P.location,{initialHydration:!0}),G}function De(){m&&m(),he&&he(),y.clear(),$&&$.abort(),P.fetchers.forEach((de,ve)=>fn(P.fetchers,ve)),P.blockers.forEach((de,ve)=>qt(ve))}function qe(de){if(y.add(de),g){let{newErrors:ve}=g;g=null,de(P,{deletedFetchers:[],newErrors:ve,viewTransitionOpts:void 0,flushSync:!1})}return()=>y.delete(de)}function Pe(de,ve={}){de.matches&&(de.matches=de.matches.map(Je=>{let at=l[Je.route.id],et=Je.route;return et.element!==at.element||et.errorElement!==at.errorElement||et.hydrateFallbackElement!==at.hydrateFallbackElement?{...Je,route:at}:Je})),P={...P,...de};let Ee=[],Be=[];P.fetchers.forEach((Je,at)=>{Je.state==="idle"&&(z.has(at)?Ee.push(at):Be.push(at))}),z.forEach(Je=>{!P.fetchers.has(Je)&&!pe.has(Je)&&Ee.push(Je)}),y.size===0&&(g={newErrors:de.errors??null}),[...y].forEach(Je=>Je(P,{deletedFetchers:Ee,newErrors:de.errors??null,viewTransitionOpts:ve.viewTransitionOpts,flushSync:ve.flushSync===!0})),Ee.forEach(Je=>fn(P.fetchers,Je)),Be.forEach(Je=>P.fetchers.delete(Je))}function Ke(de,ve,{flushSync:Ee}={}){var St,Ht;let Be=P.actionData!=null&&P.navigation.formMethod!=null&&ui(P.navigation.formMethod)&&P.navigation.state==="loading"&&((St=de.state)==null?void 0:St._isRedirect)!==!0,Je;ve.actionData?Object.keys(ve.actionData).length>0?Je=ve.actionData:Je=null:Be?Je=P.actionData:Je=null;let at=ve.loaderData?rw(P.loaderData,ve.loaderData,ve.matches||[],ve.errors):P.loaderData,et=P.blockers;et.size>0&&(et=new Map(et),et.forEach((dt,Yt)=>et.set(Yt,Ph)));let ct=te?!1:ci(de,ve.matches||P.matches),Qe=F===!0||P.navigation.formMethod!=null&&ui(P.navigation.formMethod)&&((Ht=de.state)==null?void 0:Ht._isRedirect)!==!0;u.commitHmrRoutes(),te||B==="POP"||(B==="PUSH"?t.history.push(de,de.state):B==="REPLACE"&&t.history.replace(de,de.state));let st;if(B==="POP"){let dt=Y.get(P.location.pathname);dt&&dt.has(de.pathname)?st={currentLocation:P.location,nextLocation:de}:Y.has(de.pathname)&&(st={currentLocation:de,nextLocation:P.location})}else if(K){let dt=Y.get(P.location.pathname);dt?dt.add(de.pathname):(dt=new Set([de.pathname]),Y.set(P.location.pathname,dt)),st={currentLocation:P.location,nextLocation:de}}Pe({...ve,actionData:Je,loaderData:at,historyAction:B,location:de,initialized:!0,renderFallback:!1,navigation:f1,revalidation:"idle",restoreScrollPosition:ct,preventScrollReset:Qe,blockers:et},{viewTransitionOpts:st,flushSync:Ee===!0}),B="POP",F=!1,K=!1,te=!1,oe=!1,X==null||X.resolve(),X=null,xe==null||xe.resolve(),xe=null}async function ne(de,ve){if(X==null||X.resolve(),X=null,typeof de=="number"){X||(X=ow());let bn=X.promise;return t.history.go(de),bn}let Ee=_v(P.location,P.matches,c,de,ve==null?void 0:ve.fromRouteId,ve==null?void 0:ve.relative),{path:Be,submission:Je,error:at}=W5(!1,Ee,ve),et;ve!=null&&ve.mask&&(et={pathname:"",search:"",hash:"",...typeof ve.mask=="string"?to(ve.mask):{...P.location.mask,...ve.mask}});let ct=P.location,Qe=od(ct,Be,ve&&ve.state,void 0,et);Qe={...Qe,...t.history.encodeLocation(Qe)};let st=ve&&ve.replace!=null?ve.replace:void 0,St="PUSH";st===!0?St="REPLACE":st===!1||Je!=null&&ui(Je.formMethod)&&Je.formAction===P.location.pathname+P.location.search&&(St="REPLACE");let Ht=ve&&"preventScrollReset"in ve?ve.preventScrollReset===!0:void 0,dt=(ve&&ve.flushSync)===!0,Yt=nn({currentLocation:ct,nextLocation:Qe,historyAction:St});if(Yt){kn(Yt,{state:"blocked",location:Qe,proceed(){kn(Yt,{state:"proceeding",proceed:void 0,reset:void 0,location:Qe}),ne(de,ve)},reset(){let bn=new Map(P.blockers);bn.set(Yt,Ph),Pe({blockers:bn})}});return}await it(St,Qe,{submission:Je,pendingError:at,preventScrollReset:Ht,replace:ve&&ve.replace,enableViewTransition:ve&&ve.viewTransition,flushSync:dt,callSiteDefaultShouldRevalidate:ve&&ve.defaultShouldRevalidate})}function We(){xe||(xe=ow()),an(),Pe({revalidation:"loading"});let de=xe.promise;return P.navigation.state==="submitting"?de:P.navigation.state==="idle"?(it(P.historyAction,P.location,{startUninterruptedRevalidation:!0}),de):(it(B||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,enableViewTransition:K===!0}),de)}async function it(de,ve,Ee){$&&$.abort(),$=null,B=de,te=(Ee&&Ee.startUninterruptedRevalidation)===!0,sa(P.location,P.matches),F=(Ee&&Ee.preventScrollReset)===!0,K=(Ee&&Ee.enableViewTransition)===!0;let Be=u.activeRoutes,Je=Ee!=null&&Ee.initialHydration&&P.matches&&P.matches.length>0&&!L?P.matches:Ks(Be,ve,c,!1,u.branches),at=(Ee&&Ee.flushSync)===!0;if(Je&&P.initialized&&!oe&&wC(P.location,ve)&&!(Ee&&Ee.submission&&ui(Ee.submission.formMethod))){Ke(ve,{matches:Je},{flushSync:at});return}let et=ma(Je,Be,ve.pathname);if(et.active&&et.matches&&(Je=et.matches),!Je){let{error:_n,notFoundMatches:En,route:lr}=_t(ve.pathname);Ke(ve,{matches:En,loaderData:{},errors:{[lr.id]:_n}},{flushSync:at});return}let ct=Ee&&Ee.overrideNavigation?{...Ee.overrideNavigation,matches:Je,historyAction:de}:void 0;$=new AbortController;let Qe=wf(t.history,ve,$.signal,Ee&&Ee.submission),st=t.getContext?await t.getContext():new $5,St;if(Ee&&Ee.pendingError)St=[Su(Je).route.id,{type:"error",error:Ee.pendingError}];else if(Ee&&Ee.submission&&ui(Ee.submission.formMethod)){let _n=await tt(Qe,ve,Ee.submission,Je,de,st,et.active,Ee&&Ee.initialHydration===!0,{replace:Ee.replace,flushSync:at});if(_n.shortCircuited)return;if(_n.pendingActionResult){let[En,lr]=_n.pendingActionResult;if(rs(lr)&&ud(lr.error)&&lr.error.status===404){$=null,Ke(ve,{matches:_n.matches,loaderData:{},errors:{[En]:lr.error}});return}}Je=_n.matches||Je,St=_n.pendingActionResult,ct=h1(ve,Je,de,Ee.submission),at=!1,et.active=!1,Qe=wf(t.history,Qe.url,Qe.signal)}let{shortCircuited:Ht,matches:dt,loaderData:Yt,errors:bn,workingFetchers:Bn}=await Ve(Qe,ve,Je,de,st,et.active,ct,Ee&&Ee.submission,Ee&&Ee.fetcherSubmission,Ee&&Ee.replace,Ee&&Ee.initialHydration===!0,at,St,Ee&&Ee.callSiteDefaultShouldRevalidate);Ht||($=null,Ke(ve,{matches:dt||Je,...aw(St),loaderData:Yt,errors:bn,...Bn?{fetchers:Bn}:{}}))}async function tt(de,ve,Ee,Be,Je,at,et,ct,Qe={}){an();let st=TC(ve,Be,Je,Ee);if(Pe({navigation:st},{flushSync:Qe.flushSync===!0}),et){let dt=await At(Be,ve.pathname,de.signal);if(dt.type==="aborted")return{shortCircuited:!0};if(dt.type==="error"){if(dt.partialMatches.length===0){let{matches:bn,route:Bn}=kp(u.activeRoutes);return{matches:bn,pendingActionResult:[Bn.id,{type:"error",error:dt.error}]}}let Yt=Su(dt.partialMatches).route.id;return{matches:dt.partialMatches,pendingActionResult:[Yt,{type:"error",error:dt.error}]}}else if(dt.matches)Be=dt.matches;else{let{notFoundMatches:Yt,error:bn,route:Bn}=_t(ve.pathname);return{matches:Yt,pendingActionResult:[Bn.id,{type:"error",error:bn}]}}}let St,Ht=ym(Be,ve);if(!Ht.route.action&&!Ht.route.lazy)St={type:"error",error:xs(405,{method:de.method,pathname:ve.pathname,routeId:Ht.route.id})};else{let dt=Lf(s,l,de,ve,Be,Ht,ct?[]:r,at),Yt=await Bt(de,ve,dt,at,null);if(St=Yt[Ht.route.id],!St){for(let bn of Be)if(Yt[bn.route.id]){St=Yt[bn.route.id];break}}if(de.signal.aborted)return{shortCircuited:!0}}if(sc(St)){let dt;return Qe&&Qe.replace!=null?dt=Qe.replace:dt=ew(St.response.headers.get("Location"),new URL(de.url),c,t.history)===P.location.pathname+P.location.search,await tn(de,St,!0,{submission:Ee,replace:dt}),{shortCircuited:!0}}if(rs(St)){let dt=Su(Be,Ht.route.id);return(Qe&&Qe.replace)!==!0&&(B="PUSH"),{matches:Be,pendingActionResult:[dt.route.id,St,Ht.route.id]}}return{matches:Be,pendingActionResult:[Ht.route.id,St]}}async function Ve(de,ve,Ee,Be,Je,at,et,ct,Qe,st,St,Ht,dt,Yt){let bn=et||h1(ve,Ee,Be,ct),Bn=ct||Qe||sw(bn),_n=!te&&!St;if(at){if(_n){let Jt=gt(dt);Pe({navigation:bn,...Jt!==void 0?{actionData:Jt}:{}},{flushSync:Ht})}let Kt=await At(Ee,ve.pathname,de.signal);if(Kt.type==="aborted")return{shortCircuited:!0};if(Kt.type==="error"){if(Kt.partialMatches.length===0){let{matches:Ta,route:Fr}=kp(u.activeRoutes);return{matches:Ta,loaderData:{},errors:{[Fr.id]:Kt.error}}}let Jt=Su(Kt.partialMatches).route.id;return{matches:Kt.partialMatches,loaderData:{},errors:{[Jt]:Kt.error}}}else if(Kt.matches)Ee=Kt.matches;else{let{error:Jt,notFoundMatches:Ta,route:Fr}=_t(ve.pathname);return{matches:Ta,loaderData:{},errors:{[Fr.id]:Jt}}}}let En=u.activeRoutes,{dsMatches:lr,revalidatingFetchers:wn}=Y5(de,Je,s,l,t.history,P,Ee,Bn,ve,St?[]:r,St===!0,oe,le,z,Z,V,En,c,t.patchRoutesOnNavigation!=null,u.branches,dt,Yt);if(U=++Ne,!t.dataStrategy&&!lr.some(Kt=>Kt.shouldLoad)&&!lr.some(Kt=>Kt.route.middleware&&Kt.route.middleware.length>0)&&wn.length===0){let Kt=new Map(P.fetchers),Jt=Lt(Kt);return Ke(ve,{matches:Ee,loaderData:{},errors:dt&&rs(dt[1])?{[dt[0]]:dt[1].error}:null,...aw(dt),...Jt?{fetchers:Kt}:{}},{flushSync:Ht}),{shortCircuited:!0}}if(_n){let Kt={};if(!at){Kt.navigation=bn;let Jt=gt(dt);Jt!==void 0&&(Kt.actionData=Jt)}wn.length>0&&(Kt.fetchers=ut(wn)),Pe(Kt,{flushSync:Ht})}wn.forEach(Kt=>{Tt(Kt.key),Kt.controller&&pe.set(Kt.key,Kt.controller)});let zi=()=>wn.forEach(Kt=>Tt(Kt.key));$&&$.signal.addEventListener("abort",zi);let{loaderResults:Nr,fetcherResults:oa}=await pn(lr,wn,de,ve,Je);if(de.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",zi),wn.forEach(Kt=>pe.delete(Kt.key));let la=Dp(Nr);if(la)return await tn(de,la.result,!0,{replace:st}),{shortCircuited:!0};if(la=Dp(oa),la)return V.add(la.key),await tn(de,la.result,!0,{replace:st}),{shortCircuited:!0};let Ca=new Map(P.fetchers),{loaderData:Ns,errors:Za}=nw(P,Ee,Nr,dt,wn,oa,Ca);St&&P.errors&&(Za={...P.errors,...Za});let Cs=Lt(Ca),ua=Hn(U,Ca),Qa=Cs||ua||wn.length>0;return{matches:Ee,loaderData:Ns,errors:Za,...Qa?{workingFetchers:Ca}:{}}}function gt(de){if(de&&!rs(de[1]))return{[de[0]]:de[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function ut(de){let ve=new Map(P.fetchers);return de.forEach(Ee=>{let Be=ve.get(Ee.key),Je=Mh(void 0,Be?Be.data:void 0);ve.set(Ee.key,Je)}),ve}async function Ot(de,ve,Ee,Be){Tt(de);let Je=(Be&&Be.flushSync)===!0,at=u.activeRoutes,et=_v(P.location,P.matches,c,Ee,ve,Be==null?void 0:Be.relative),ct=Ks(at,et,c,!1,u.branches),Qe=ma(ct,at,et);if(Qe.active&&Qe.matches&&(ct=Qe.matches),!ct){kt(de,ve,xs(404,{pathname:et}),{flushSync:Je});return}let{path:st,submission:St,error:Ht}=W5(!0,et,Be);if(Ht){kt(de,ve,Ht,{flushSync:Je});return}let dt=t.getContext?await t.getContext():new $5,Yt=(Be&&Be.preventScrollReset)===!0;if(St&&ui(St.formMethod)){await Ct(de,ve,st,ct,dt,Qe.active,Je,Yt,St,Be&&Be.defaultShouldRevalidate);return}Z.set(de,{routeId:ve,path:st}),await en(de,ve,st,ct,dt,Qe.active,Je,Yt,St)}async function Ct(de,ve,Ee,Be,Je,at,et,ct,Qe,st){an(),Z.delete(de);let St=P.fetchers.get(de);lt(de,LC(Qe,St),{flushSync:et});let Ht=new AbortController,dt=wf(t.history,Ee,Ht.signal,Qe);if(at){let hn=await At(Be,new URL(dt.url).pathname,dt.signal,de);if(hn.type==="aborted")return;if(hn.type==="error"){kt(de,ve,hn.error,{flushSync:et});return}else if(hn.matches)Be=hn.matches;else{kt(de,ve,xs(404,{pathname:Ee}),{flushSync:et});return}}let Yt=ym(Be,Ee);if(!Yt.route.action&&!Yt.route.lazy){let hn=xs(405,{method:Qe.formMethod,pathname:Ee,routeId:ve});kt(de,ve,hn,{flushSync:et});return}pe.set(de,Ht);let bn=Ne,Bn=Lf(s,l,dt,Ee,Be,Yt,r,Je),_n=await Bt(dt,Ee,Bn,Je,de),En=_n[Yt.route.id];if(!En){for(let hn of Bn)if(_n[hn.route.id]){En=_n[hn.route.id];break}}if(dt.signal.aborted){pe.get(de)===Ht&&pe.delete(de);return}if(z.has(de)){if(sc(En)||rs(En)){lt(de,Oo(void 0));return}}else{if(sc(En))if(pe.delete(de),U>bn){lt(de,Oo(void 0));return}else return V.add(de),lt(de,Mh(Qe)),tn(dt,En,!1,{fetcherSubmission:Qe,preventScrollReset:ct});if(rs(En)){kt(de,ve,En.error);return}}let lr=P.navigation.location||P.location,wn=wf(t.history,lr,Ht.signal),zi=u.activeRoutes,Nr=P.navigation.state!=="idle"?Ks(zi,P.navigation.location,c,!1,u.branches):P.matches;cn(Nr,"Didn't find any matches after fetcher action");let oa=++Ne;O.set(de,oa);let{dsMatches:la,revalidatingFetchers:Ca}=Y5(wn,Je,s,l,t.history,P,Nr,Qe,lr,r,!1,oe,le,z,Z,V,zi,c,t.patchRoutesOnNavigation!=null,u.branches,[Yt.route.id,En],st),Ns=Mh(Qe,En.data),Za=new Map(P.fetchers);Za.set(de,Ns),Ca.filter(hn=>hn.key!==de).forEach(hn=>{let ei=hn.key,vr=Za.get(ei),Dr=Mh(void 0,vr?vr.data:void 0);Za.set(ei,Dr),Tt(ei),hn.controller&&pe.set(ei,hn.controller)}),Pe({fetchers:Za});let Cs=()=>Ca.forEach(hn=>Tt(hn.key));Ht.signal.addEventListener("abort",Cs);let{loaderResults:ua,fetcherResults:Qa}=await pn(la,Ca,wn,lr,Je);if(Ht.signal.aborted)return;Ht.signal.removeEventListener("abort",Cs),O.delete(de),pe.delete(de),Ca.forEach(hn=>pe.delete(hn.key));let Kt=P.fetchers.has(de),Jt=hn=>{if(!Kt)return hn;let ei=new Map(hn.fetchers);return ei.set(de,Oo(En.data)),{...hn,fetchers:ei}},Ta=Dp(ua);if(Ta)return P=Jt(P),tn(wn,Ta.result,!1,{preventScrollReset:ct});if(Ta=Dp(Qa),Ta)return V.add(Ta.key),P=Jt(P),tn(wn,Ta.result,!1,{preventScrollReset:ct});let Fr=new Map(P.fetchers);Kt&&Fr.set(de,Oo(En.data));let{loaderData:qi,errors:us}=nw(P,Nr,ua,void 0,Ca,Qa,Fr);Hn(oa,Fr),P.navigation.state==="loading"&&oa>U?(cn(B,"Expected pending action"),$&&$.abort(),Ke(P.navigation.location,{matches:Nr,loaderData:qi,errors:us,fetchers:Fr})):(Pe({errors:us,loaderData:rw(P.loaderData,qi,Nr,us),fetchers:Fr}),oe=!1)}async function en(de,ve,Ee,Be,Je,at,et,ct,Qe){let st=P.fetchers.get(de);lt(de,Mh(Qe,st?st.data:void 0),{flushSync:et});let St=new AbortController,Ht=wf(t.history,Ee,St.signal);if(at){let En=await At(Be,new URL(Ht.url).pathname,Ht.signal,de);if(En.type==="aborted")return;if(En.type==="error"){kt(de,ve,En.error,{flushSync:et});return}else if(En.matches)Be=En.matches;else{kt(de,ve,xs(404,{pathname:Ee}),{flushSync:et});return}}let dt=ym(Be,Ee);pe.set(de,St);let Yt=Ne,bn=Lf(s,l,Ht,Ee,Be,dt,r,Je),Bn=await Bt(Ht,Ee,bn,Je,de),_n=Bn[dt.route.id];if(!_n){for(let En of Be)if(Bn[En.route.id]){_n=Bn[En.route.id];break}}if(pe.get(de)===St&&pe.delete(de),!Ht.signal.aborted){if(z.has(de)){lt(de,Oo(void 0));return}if(sc(_n))if(U>Yt){lt(de,Oo(void 0));return}else{V.add(de),await tn(Ht,_n,!1,{preventScrollReset:ct});return}if(rs(_n)){kt(de,ve,_n.error);return}lt(de,Oo(_n.data))}}async function tn(de,ve,Ee,{submission:Be,fetcherSubmission:Je,preventScrollReset:at,replace:et}={}){Ee||(X==null||X.resolve(),X=null),ve.response.headers.has("X-Remix-Revalidate")&&(oe=!0);let ct=ve.response.headers.get("Location");cn(ct,"Expected a Location header on the redirect Response"),ct=ew(ct,new URL(de.url),c,t.history);let Qe=od(P.location,ct,{_isRedirect:!0});if(n){let bn=!1;if(ve.response.headers.has("X-Remix-Reload-Document"))bn=!0;else if(Ly(ct)){const Bn=e4(e,ct,!0);bn=Bn.origin!==e.location.origin||_s(Bn.pathname,c)==null}if(bn){et?e.location.replace(ct):e.location.assign(ct);return}}$=null;let st=et===!0||ve.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:St,formAction:Ht,formEncType:dt}=P.navigation;!Be&&!Je&&St&&Ht&&dt&&(Be=sw(P.navigation));let Yt=Be||Je;if(rC.has(ve.response.status)&&Yt&&ui(Yt.formMethod))await it(st,Qe,{submission:{...Yt,formAction:ct},preventScrollReset:at||F,enableViewTransition:Ee?K:void 0});else{let bn=h1(Qe,[],st,Be);await it(st,Qe,{overrideNavigation:bn,fetcherSubmission:Je,preventScrollReset:at||F,enableViewTransition:Ee?K:void 0})}}async function Bt(de,ve,Ee,Be,Je){var ct;let at,et={};try{at=await pC(h,de,ve,Ee,Je,Be,!1)}catch(Qe){return Ee.filter(st=>st.shouldLoad).forEach(st=>{et[st.route.id]={type:"error",error:Qe}}),et}if(de.signal.aborted)return et;if(!ui(de.method))for(let Qe of Ee){if(((ct=at[Qe.route.id])==null?void 0:ct.type)==="error")break;!at.hasOwnProperty(Qe.route.id)&&!P.loaderData.hasOwnProperty(Qe.route.id)&&(!P.errors||!P.errors.hasOwnProperty(Qe.route.id))&&Qe.shouldCallHandler()&&(at[Qe.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Qe.route.id}`)})}for(let[Qe,st]of Object.entries(at))if(EC(st)){let St=st.result;et[Qe]={type:"redirect",response:yC(St,de,Qe,Ee,c)}}else et[Qe]=await vC(st);return et}async function pn(de,ve,Ee,Be,Je){let at=Bt(Ee,Be,de,Je,null),et=Promise.all(ve.map(async st=>{if(st.matches&&st.match&&st.request&&st.controller){let Ht=(await Bt(st.request,st.path,st.matches,Je,st.key))[st.match.route.id];return{[st.key]:Ht}}else return Promise.resolve({[st.key]:{type:"error",error:xs(404,{pathname:st.path})}})})),ct=await at,Qe=(await et).reduce((st,St)=>Object.assign(st,St),{});return{loaderResults:ct,fetcherResults:Qe}}function an(){oe=!0,Z.forEach((de,ve)=>{pe.has(ve)&&le.add(ve),Tt(ve)})}function lt(de,ve,Ee={}){let Be=new Map(P.fetchers);Be.set(de,ve),Pe({fetchers:Be},{flushSync:(Ee&&Ee.flushSync)===!0})}function kt(de,ve,Ee,Be={}){let Je=Su(P.matches,ve),at=new Map(P.fetchers);fn(at,de),Pe({errors:{[Je.route.id]:Ee},fetchers:at},{flushSync:(Be&&Be.flushSync)===!0})}function Et(de){return ie.set(de,(ie.get(de)||0)+1),z.has(de)&&z.delete(de),P.fetchers.get(de)||aC}function gr(de,ve){Tt(de,ve==null?void 0:ve.reason),lt(de,Oo(null))}function fn(de,ve){let Ee=P.fetchers.get(ve);pe.has(ve)&&!(Ee&&Ee.state==="loading"&&O.has(ve))&&Tt(ve),Z.delete(ve),O.delete(ve),V.delete(ve),z.delete(ve),le.delete(ve),de.delete(ve)}function Dt(de){let ve=(ie.get(de)||0)-1;ve<=0?(ie.delete(de),z.add(de)):ie.set(de,ve),Pe({fetchers:new Map(P.fetchers)})}function Tt(de,ve){let Ee=pe.get(de);Ee&&(Ee.abort(ve),pe.delete(de))}function mn(de,ve){for(let Ee of de){let Be=ve.get(Ee);cn(Be,`Expected fetcher: ${Ee}`);let Je=Oo(Be.data);ve.set(Ee,Je)}}function Lt(de){let ve=[],Ee=!1;for(let Be of V){let Je=de.get(Be);cn(Je,`Expected fetcher: ${Be}`),Je.state==="loading"&&(V.delete(Be),ve.push(Be),Ee=!0)}return mn(ve,de),Ee}function Hn(de,ve){let Ee=[];for(let[Be,Je]of O)if(Je<de){let at=ve.get(Be);cn(at,`Expected fetcher: ${Be}`),at.state==="loading"&&(Tt(Be),O.delete(Be),Ee.push(Be))}return mn(Ee,ve),Ee.length>0}function Ut(de,ve){let Ee=P.blockers.get(de)||Ph;return se.get(de)!==ve&&se.set(de,ve),Ee}function qt(de){P.blockers.delete(de),se.delete(de)}function kn(de,ve){let Ee=P.blockers.get(de)||Ph;cn(Ee.state==="unblocked"&&ve.state==="blocked"||Ee.state==="blocked"&&ve.state==="blocked"||Ee.state==="blocked"&&ve.state==="proceeding"||Ee.state==="blocked"&&ve.state==="unblocked"||Ee.state==="proceeding"&&ve.state==="unblocked",`Invalid blocker state transition: ${Ee.state} -> ${ve.state}`);let Be=new Map(P.blockers);Be.set(de,ve),Pe({blockers:Be})}function nn({currentLocation:de,nextLocation:ve,historyAction:Ee}){if(se.size===0)return;se.size>1&&Kr(!1,"A router only supports one blocker at a time");let Be=Array.from(se.entries()),[Je,at]=Be[Be.length-1],et=P.blockers.get(Je);if(!(et&&et.state==="proceeding")&&at({currentLocation:de,nextLocation:ve,historyAction:Ee}))return Je}function _t(de){let ve=xs(404,{pathname:de}),Ee=u.activeRoutes,{matches:Be,route:Je}=kp(Ee);return{notFoundMatches:Be,route:Je,error:ve}}function Sn(de,ve,Ee){if(x=de,N=ve,_=Ee||null,!A&&P.navigation===f1){A=!0;let Be=ci(P.location,P.matches);Be!=null&&Pe({restoreScrollPosition:Be})}return()=>{x=null,N=null,_=null}}function Xa(de,ve){return _&&_(de,ve.map(Be=>jN(Be,P.loaderData)))||de.key}function sa(de,ve){if(x&&N){let Ee=Xa(de,ve);x[Ee]=N()}}function ci(de,ve){if(x){let Ee=Xa(de,ve),Be=x[Ee];if(typeof Be=="number")return Be}return null}function ma(de,ve,Ee){if(t.patchRoutesOnNavigation){let Be=u.branches;if(de){if(Object.keys(de[0].params).length>0)return{active:!0,matches:Ks(ve,Ee,c,!0,Be)}}else return{active:!0,matches:Ks(ve,Ee,c,!0,Be)||[]}}return{active:!1,matches:null}}async function At(de,ve,Ee,Be){if(!t.patchRoutesOnNavigation)return{type:"success",matches:de};let Je=de;for(;;){let at=l;try{await t.patchRoutesOnNavigation({signal:Ee,path:ve,matches:Je,fetcherKey:Be,patch:(st,St)=>{Ee.aborted||K5(st,St,u,at,s,!1)}})}catch(st){return{type:"error",error:st,partialMatches:Je}}if(Ee.aborted)return{type:"aborted"};let et=u.branches,ct=Ks(u.activeRoutes,ve,c,!1,et),Qe=null;if(ct){if(Object.keys(ct[0].params).length===0)return{type:"success",matches:ct};if(Qe=Ks(u.activeRoutes,ve,c,!0,et),!(Qe&&Je.length<Qe.length&&yi(Je,Qe.slice(0,Je.length))))return{type:"success",matches:ct}}if(Qe||(Qe=Ks(u.activeRoutes,ve,c,!0,et)),!Qe||yi(Je,Qe))return{type:"success",matches:null};Je=Qe}}function yi(de,ve){return de.length===ve.length&&de.every((Ee,Be)=>Ee.route.id===ve[Be].route.id)}function bi(de){l={},u.setHmrRoutes(ld(de,s,void 0,l))}function Ba(de,ve,Ee=!1){K5(de,ve,u,l,s,Ee),u.hasHMRRoutes||Pe({})}return G={get basename(){return c},get future(){return d},get state(){return P},get routes(){return u.stableRoutes},get branches(){return u.branches},get manifest(){return l},get window(){return e},initialize:Re,subscribe:qe,enableScrollRestoration:Sn,navigate:ne,fetch:Ot,revalidate:We,createHref:de=>t.history.createHref(de),encodeLocation:de=>t.history.encodeLocation(de),getFetcher:Et,resetFetcher:gr,deleteFetcher:Dt,dispose:De,getBlocker:Ut,deleteBlocker:qt,patchRoutes:Ba,_internalFetchControllers:pe,_internalSetRoutes:bi,_internalSetStateDoNotUseOrYouWillBreakYourApp(de){Pe(de)}},t.instrumentations&&(G=KN(G,t.instrumentations.map(de=>de.router).filter(Boolean))),G}function lC(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function _v(t,e,n,r,a,s){let l,u;if(a){l=[];for(let h of e)if(l.push(h),h.route.id===a){u=h;break}}else l=e,u=e[e.length-1];let c=Ed(r||".",bg(l),_s(t.pathname,n)||t.pathname,s==="path");if(r==null&&(c.search=t.search,c.hash=t.hash),(r==null||r===""||r===".")&&u){let h=ky(c.search);if(u.route.index&&!h)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&h){let d=new URLSearchParams(c.search),m=d.getAll("index");d.delete("index"),m.filter(g=>g).forEach(g=>d.append("index",g));let y=d.toString();c.search=y?`?${y}`:""}}return n!=="/"&&(c.pathname=qN({basename:n,pathname:c.pathname})),Bo(c)}function W5(t,e,n){if(!n||!lC(n))return{path:e};if(n.formMethod&&!CC(n.formMethod))return{path:e,error:xs(405,{method:n.formMethod})};let r=()=>({path:e,error:xs(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),l=w4(e);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!ui(s))return r();let m=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[g,x])=>`${y}${g}=${x}
|
|
59
|
+
`,""):String(n.body);return{path:e,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:m}}}else if(n.formEncType==="application/json"){if(!ui(s))return r();try{let m=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:s,formAction:l,formEncType:n.formEncType,formData:void 0,json:m,text:void 0}}}catch{return r()}}}cn(typeof FormData=="function","FormData is not available in this environment");let u,c;if(n.formData)u=Av(n.formData),c=n.formData;else if(n.body instanceof FormData)u=Av(n.body),c=n.body;else if(n.body instanceof URLSearchParams)u=n.body,c=tw(u);else if(n.body==null)u=new URLSearchParams,c=new FormData;else try{u=new URLSearchParams(n.body),c=tw(u)}catch{return r()}let h={formMethod:s,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(ui(h.formMethod))return{path:e,submission:h};let d=to(e);return t&&d.search&&ky(d.search)&&u.append("index",""),d.search=`?${u}`,{path:Bo(d),submission:h}}function Y5(t,e,n,r,a,s,l,u,c,h,d,m,y,g,x,_,N,A,j,L,R,I){var te;let ee=R?rs(R[1])?R[1].error:R[1].data:void 0,G=a.createURL(s.location),P=a.createURL(c),B;if(d&&s.errors){let oe=Object.keys(s.errors)[0];B=l.findIndex(le=>le.route.id===oe)}else if(R&&rs(R[1])){let oe=R[0];B=l.findIndex(le=>le.route.id===oe)-1}let X=R?R[1].statusCode:void 0,F=X&&X>=400,$={currentUrl:G,currentParams:((te=s.matches[0])==null?void 0:te.params)||{},nextUrl:P,nextParams:l[0].params,...u,actionResult:ee,actionStatus:X},K=Nd(l),Y=l.map((oe,le)=>{let{route:pe}=oe,Ne=null;if(B!=null&&le>B)Ne=!1;else if(pe.lazy)Ne=!0;else if(!Oy(pe))Ne=!1;else if(d){let{shouldLoad:Z}=d4(pe,s.loaderData,s.errors);Ne=Z}else uC(s.loaderData,s.matches[le],oe)&&(Ne=!0);if(Ne!==null)return Ev(n,r,t,c,K,oe,h,e,Ne);let U=!1;typeof I=="boolean"?U=I:F?U=!1:(m||G.pathname+G.search===P.pathname+P.search||G.search!==P.search||cC(s.matches[le],oe))&&(U=!0);let O={...$,defaultShouldRevalidate:U},V=Zh(oe,O);return Ev(n,r,t,c,K,oe,h,e,V,O,I)}),he=[];return x.forEach((oe,le)=>{if(d||!l.some(z=>z.route.id===oe.routeId)||g.has(le))return;let pe=s.fetchers.get(le),Ne=pe&&pe.state!=="idle"&&pe.data===void 0,U=Ks(N,oe.path,A??"/",!1,L);if(!U){if(j&&Ne)return;he.push({key:le,routeId:oe.routeId,path:oe.path,matches:null,match:null,request:null,controller:null});return}if(_.has(le))return;let O=ym(U,oe.path),V=new AbortController,Z=wf(a,oe.path,V.signal),ie=null;if(y.has(le))y.delete(le),ie=Lf(n,r,Z,oe.path,U,O,h,e);else if(Ne)m&&(ie=Lf(n,r,Z,oe.path,U,O,h,e));else{let z;typeof I=="boolean"?z=I:F?z=!1:z=m;let se={...$,defaultShouldRevalidate:z};Zh(O,se)&&(ie=Lf(n,r,Z,oe.path,U,O,h,e,se))}ie&&he.push({key:le,routeId:oe.routeId,path:oe.path,matches:ie,match:O,request:Z,controller:V})}),{dsMatches:Y,revalidatingFetchers:he}}function Oy(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function d4(t,e,n){if(t.lazy)return{shouldLoad:!0,renderFallback:!0};if(!Oy(t))return{shouldLoad:!1,renderFallback:!1};let r=e!=null&&t.id in e,a=n!=null&&n[t.id]!==void 0;if(!r&&a)return{shouldLoad:!1,renderFallback:!1};if(typeof t.loader=="function"&&t.loader.hydrate===!0)return{shouldLoad:!0,renderFallback:!r};let s=!r&&!a;return{shouldLoad:s,renderFallback:s}}function uC(t,e,n){let r=!e||n.route.id!==e.route.id,a=!t.hasOwnProperty(n.route.id);return r||a}function cC(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function Zh(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function K5(t,e,n,r,a,s){let l;if(t){let h=r[t];cn(h,`No route found to patch children into: routeId = ${t}`),h.children||(h.children=[]),l=h.children}else l=n.activeRoutes;let u=[],c=[];if(e.forEach(h=>{let d=l.find(m=>p4(h,m));d?c.push({existingRoute:d,newRoute:h}):u.push(h)}),u.length>0){let h=ld(u,a,[t||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...h)}if(s&&c.length>0)for(let h=0;h<c.length;h++){let{existingRoute:d,newRoute:m}=c[h],y=d,[g]=ld([m],a,[],{},!0);Object.assign(y,{element:g.element?g.element:y.element,errorElement:g.errorElement?g.errorElement:y.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:y.hydrateFallbackElement})}n.hasHMRRoutes||n.setRoutes([...n.activeRoutes])}function p4(t,e){var n;return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:((n=t.children)==null?void 0:n.every((r,a)=>{var s;return(s=e.children)==null?void 0:s.some(l=>p4(r,l))}))??!1:!1}var J5=new WeakMap,m4=({key:t,route:e,manifest:n,mapRouteProperties:r})=>{let a=n[e.id];if(cn(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let s=a.lazy[t];if(!s)return;let l=J5.get(a);l||(l={},J5.set(a,l));let u=l[t];if(u)return u;let c=(async()=>{let h=NN(t),m=a[t]!==void 0&&t!=="hasErrorBoundary";if(h)Kr(!h,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),l[t]=Promise.resolve();else if(m)Kr(!1,`Route "${a.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let y=await s();y!=null&&(Object.assign(a,{[t]:y}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[t]=void 0,Object.values(a.lazy).every(y=>y===void 0)&&(a.lazy=void 0))})();return l[t]=c,c},X5=new WeakMap;function fC(t,e,n,r,a){let s=n[t.id];if(cn(s,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let d=X5.get(s);if(d)return{lazyRoutePromise:d,lazyHandlerPromise:d};let m=(async()=>{cn(typeof t.lazy=="function","No lazy route function found");let y=await t.lazy(),g={};for(let x in y){let _=y[x];if(_===void 0)continue;let N=TN(x),j=s[x]!==void 0&&x!=="hasErrorBoundary";N?Kr(!N,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):j?Kr(!j,`Route "${s.id}" has a static property "${x}" defined but its lazy function is also returning a value for this property. The lazy route property "${x}" will be ignored.`):g[x]=_}Object.assign(s,g),Object.assign(s,{...r(s),lazy:void 0})})();return X5.set(s,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let l=Object.keys(t.lazy),u=[],c;for(let d of l){if(a&&a.includes(d))continue;let m=m4({key:d,route:t,manifest:n,mapRouteProperties:r});m&&(u.push(m),d===e&&(c=m))}let h=u.length>0?Promise.all(u).then(()=>{}):void 0;return h==null||h.catch(()=>{}),c==null||c.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:c}}async function Z5(t){let e=t.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(e.map(a=>a.resolve()))).forEach((a,s)=>{n[e[s].route.id]=a}),n}async function hC(t){return t.matches.some(e=>e.route.middleware)?g4(t,()=>Z5(t)):Z5(t)}function g4(t,e){return dC(t,e,r=>{if(NC(r))throw r;return r},SC,n);function n(r,a,s){if(s)return Promise.resolve(Object.assign(s.value,{[a]:{type:"error",result:r}}));{let{matches:l}=t,u=Math.min(Math.max(l.findIndex(h=>h.route.id===a),0),Math.max(l.findIndex(h=>h.shouldCallHandler()),0)),c=Su(l,l[u].route.id).route.id;return Promise.resolve({[c]:{type:"error",result:r}})}}}async function dC(t,e,n,r,a){let{matches:s,...l}=t,u=s.flatMap(h=>h.route.middleware?h.route.middleware.map(d=>[h.route.id,d]):[]);return await v4(l,u,e,n,r,a)}async function v4(t,e,n,r,a,s,l=0){let{request:u}=t;if(u.signal.aborted)throw u.signal.reason??new Error(`Request aborted: ${u.method} ${u.url}`);let c=e[l];if(!c)return await n();let[h,d]=c,m,y=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");try{return m={value:await v4(t,e,n,r,a,s,l+1)},m.value}catch(g){return m={value:await s(g,h,m)},m.value}};try{let g=await d(t,y),x=g!=null?r(g):void 0;return a(x)?x:m?x??m.value:(m={value:await y()},m.value)}catch(g){return await s(g,h,m)}}function y4(t,e,n,r,a){let s=m4({key:"middleware",route:r.route,manifest:e,mapRouteProperties:t}),l=fC(r.route,ui(n.method)?"action":"loader",e,t,a);return{middleware:s,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function Ev(t,e,n,r,a,s,l,u,c,h=null,d){let m=!1,y=y4(t,e,n,s,l);return{...s,_lazyPromises:y,shouldLoad:c,shouldRevalidateArgs:h,shouldCallHandler(g){return m=!0,h?typeof d=="boolean"?Zh(s,{...h,defaultShouldRevalidate:d}):typeof g=="boolean"?Zh(s,{...h,defaultShouldRevalidate:g}):Zh(s,h):c},resolve(g){let{lazy:x,loader:_,middleware:N}=s.route,A=m||c||g&&!ui(n.method)&&(x||_),j=N&&N.length>0&&!_&&!x;return A&&(ui(n.method)||!j)?mC({request:n,path:r,pattern:a,match:s,lazyHandlerPromise:y==null?void 0:y.handler,lazyRoutePromise:y==null?void 0:y.route,handlerOverride:g,scopedContext:u}):Promise.resolve({type:"data",result:void 0})}}}function Lf(t,e,n,r,a,s,l,u,c=null){return a.map(h=>h.route.id!==s.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:y4(t,e,n,h,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ev(t,e,n,r,Nd(a),h,l,u,!0,c))}async function pC(t,e,n,r,a,s,l){r.some(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(r.map(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware}));let u={request:e,url:b4(e,n),pattern:Nd(r),params:r[0].params,context:s,matches:r},h=await t({...u,fetcherKey:a,runClientMiddleware:d=>{let m=u;return g4(m,()=>d({...m,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(r.flatMap(d=>{var m,y;return[(m=d._lazyPromises)==null?void 0:m.handler,(y=d._lazyPromises)==null?void 0:y.route]}))}catch{}return h}async function mC({request:t,path:e,pattern:n,match:r,lazyHandlerPromise:a,lazyRoutePromise:s,handlerOverride:l,scopedContext:u}){let c,h,d=ui(t.method),m=d?"action":"loader",y=g=>{let x,_=new Promise((j,L)=>x=L);h=()=>x(),t.signal.addEventListener("abort",h);let N=j=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${r.route.id}]`)):g({request:t,url:b4(t,e),pattern:n,params:r.params,context:u},...j!==void 0?[j]:[]),A=(async()=>{try{return{type:"data",result:await(l?l(L=>N(L)):N())}}catch(j){return{type:"error",result:j}}})();return Promise.race([A,_])};try{let g=d?r.route.action:r.route.loader;if(a||s)if(g){let x,[_]=await Promise.all([y(g).catch(N=>{x=N}),a,s]);if(x!==void 0)throw x;c=_}else{await a;let x=d?r.route.action:r.route.loader;if(x)[c]=await Promise.all([y(x),s]);else if(m==="action"){let _=new URL(t.url),N=_.pathname+_.search;throw xs(405,{method:t.method,pathname:N,routeId:r.route.id})}else return{type:"data",result:void 0}}else if(g)c=await y(g);else{let x=new URL(t.url),_=x.pathname+x.search;throw xs(404,{pathname:_})}}catch(g){return{type:"error",result:g}}finally{h&&t.signal.removeEventListener("abort",h)}return c}async function gC(t){let e=t.headers.get("Content-Type");return e&&/\bapplication\/json\b/.test(e)?t.body==null?null:t.json():t.text()}async function vC(t){var r,a,s,l,u;let{result:e,type:n}=t;if(Ry(e)){let c;try{c=await gC(e)}catch(h){return{type:"error",error:h}}return n==="error"?{type:"error",error:new Ad(e.status,e.statusText,c),statusCode:e.status,headers:e.headers}:{type:"data",data:c,statusCode:e.status,headers:e.headers}}return n==="error"?iw(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:(r=e.init)==null?void 0:r.status,headers:(a=e.init)!=null&&a.headers?new Headers(e.init.headers):void 0}:{type:"error",error:xC(e),statusCode:ud(e)?e.status:void 0,headers:(s=e.init)!=null&&s.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:ud(e)?e.status:void 0}:iw(e)?{type:"data",data:e.data,statusCode:(l=e.init)==null?void 0:l.status,headers:(u=e.init)!=null&&u.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function yC(t,e,n,r,a){let s=t.headers.get("Location");if(cn(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ly(s)){let l=r.slice(0,r.findIndex(u=>u.route.id===n)+1);s=_v(new URL(e.url),l,a,s),t.headers.set("Location",s)}return t}var Q5=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function ew(t,e,n,r){if(Ly(t)){let a=t,s=a.startsWith("//")?new URL(e.protocol+a):new URL(a);if(Q5.includes(s.protocol))throw new Error("Invalid redirect location");let l=_s(s.pathname,n)!=null;if(s.origin===e.origin&&l)return jy(s.pathname)+s.search+s.hash}try{let a=r.createURL(t);if(Q5.includes(a.protocol))throw new Error("Invalid redirect location")}catch{}return t}function wf(t,e,n,r){let a=t.createURL(w4(e)).toString(),s={signal:n};if(r&&ui(r.formMethod)){let{formMethod:l,formEncType:u}=r;s.method=l.toUpperCase(),u==="application/json"?(s.headers=new Headers({"Content-Type":u}),s.body=JSON.stringify(r.json)):u==="text/plain"?s.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?s.body=Av(r.formData):s.body=r.formData}return new Request(a,s)}function b4(t,e){let n=new URL(t.url),r=typeof e=="string"?to(e):e;if(n.pathname=r.pathname||"/",r.search){let a=new URLSearchParams(r.search),s=a.getAll("index");a.delete("index");for(let l of s.filter(Boolean))a.append("index",l);n.search=a.size?`?${a.toString()}`:""}else n.search="";return n.hash=r.hash||"",n}function Av(t){let e=new URLSearchParams;for(let[n,r]of t.entries())e.append(n,typeof r=="string"?r:r.name);return e}function tw(t){let e=new FormData;for(let[n,r]of t.entries())e.append(n,r);return e}function bC(t,e,n,r=!1,a=!1){let s={},l=null,u,c=!1,h={},d=n&&rs(n[1])?n[1].error:void 0;return t.forEach(m=>{if(!(m.route.id in e))return;let y=m.route.id,g=e[y];if(cn(!sc(g),"Cannot handle redirect results in processLoaderData"),rs(g)){let x=g.error;if(d!==void 0&&(x=d,d=void 0),l=l||{},a)l[y]=x;else{let _=Su(t,y);l[_.route.id]==null&&(l[_.route.id]=x)}r||(s[y]=h4),c||(c=!0,u=ud(g.error)?g.error.status:500),g.headers&&(h[y]=g.headers)}else s[y]=g.data,g.statusCode&&g.statusCode!==200&&!c&&(u=g.statusCode),g.headers&&(h[y]=g.headers)}),d!==void 0&&n&&(l={[n[0]]:d},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:l,statusCode:u||200,loaderHeaders:h}}function nw(t,e,n,r,a,s,l){let{loaderData:u,errors:c}=bC(e,n,r);return a.filter(h=>!h.matches||h.matches.some(d=>d.shouldLoad)).forEach(h=>{let{key:d,match:m,controller:y}=h;if(y&&y.signal.aborted)return;let g=s[d];if(cn(g,"Did not find corresponding fetcher result"),rs(g)){let x=Su(t.matches,m==null?void 0:m.route.id);c&&c[x.route.id]||(c={...c,[x.route.id]:g.error}),l.delete(d)}else if(sc(g))cn(!1,"Unhandled fetcher revalidation redirect");else{let x=Oo(g.data);l.set(d,x)}}),{loaderData:u,errors:c}}function rw(t,e,n,r){let a=Object.entries(e).filter(([,s])=>s!==h4).reduce((s,[l,u])=>(s[l]=u,s),{});for(let s of n){let l=s.route.id;if(!e.hasOwnProperty(l)&&t.hasOwnProperty(l)&&s.route.loader&&(a[l]=t[l]),r&&r.hasOwnProperty(l))break}return a}function aw(t){return t?rs(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Su(t,e){return(e?t.slice(0,t.findIndex(r=>r.route.id===e)+1):[...t]).reverse().find(r=>r.route.hasErrorBoundary===!0)||t[0]}function kp(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function xs(t,{pathname:e,routeId:n,method:r,type:a,message:s}={}){let l="Unknown Server Error",u="Unknown @remix-run/router error";return t===400?(l="Bad Request",r&&e&&n?u=`You made a ${r} request to "${e}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):t===403?(l="Forbidden",u=`Route "${n}" does not match URL "${e}"`):t===404?(l="Not Found",u=`No route matches URL "${e}"`):t===405&&(l="Method Not Allowed",r&&e&&n?u=`You made a ${r.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new Ad(t||500,l,new Error(u),!0)}function Dp(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[r,a]=e[n];if(sc(a))return{key:r,result:a}}}function w4(t){let e=typeof t=="string"?to(t):t;return Bo({...e,hash:""})}function wC(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function xC(t){var e,n;return new Ad(((e=t.init)==null?void 0:e.status)??500,((n=t.init)==null?void 0:n.statusText)??"Internal Server Error",t.data)}function SC(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([e,n])=>typeof e=="string"&&_C(n))}function _C(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function EC(t){return Ry(t.result)&&c4.has(t.result.status)}function rs(t){return t.type==="error"}function sc(t){return(t&&t.type)==="redirect"}function iw(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function Ry(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function AC(t){return c4.has(t)}function NC(t){return Ry(t)&&AC(t.status)&&t.headers.has("Location")}function CC(t){return nC.has(t.toUpperCase())}function ui(t){return eC.has(t.toUpperCase())}function ky(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function ym(t,e){let n=typeof e=="string"?to(e).search:e.search;if(t[t.length-1].route.index&&ky(n||""))return t[t.length-1];let r=i4(t);return r[r.length-1]}function sw(t){let{formMethod:e,formAction:n,formEncType:r,text:a,formData:s,json:l}=t;if(!(!e||!n||!r)){if(a!=null)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(s!=null)return{formMethod:e,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(l!==void 0)return{formMethod:e,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function h1(t,e,n,r){return r?{state:"loading",location:t,matches:e,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}:{state:"loading",location:t,matches:e,historyAction:n,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function TC(t,e,n,r){return{state:"submitting",location:t,matches:e,historyAction:n,formMethod:r.formMethod,formAction:r.formAction,formEncType:r.formEncType,formData:r.formData,json:r.json,text:r.text}}function Mh(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function LC(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function Oo(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function jC(t,e){try{let n=t.sessionStorage.getItem(f4);if(n){let r=JSON.parse(n);for(let[a,s]of Object.entries(r||{}))s&&Array.isArray(s)&&e.set(a,new Set(s||[]))}}catch{}}function OC(t,e){if(e.size>0){let n={};for(let[r,a]of e)n[r]=[...a];try{t.sessionStorage.setItem(f4,JSON.stringify(n))}catch(r){Kr(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function ow(){let t,e,n=new Promise((r,a)=>{t=async s=>{r(s);try{await n}catch{}},e=async s=>{a(s);try{await n}catch{}}});return{promise:n,resolve:t,reject:e}}var vc=D.createContext(null);vc.displayName="DataRouter";var Cd=D.createContext(null);Cd.displayName="DataRouterState";var x4=D.createContext(!1);function S4(){return D.useContext(x4)}var Dy=D.createContext({isTransitioning:!1});Dy.displayName="ViewTransition";var _4=D.createContext(new Map);_4.displayName="Fetchers";var RC=D.createContext(null);RC.displayName="Await";var os=D.createContext(null);os.displayName="Navigation";var Td=D.createContext(null);Td.displayName="Location";var As=D.createContext({outlet:null,matches:[],isDataRoute:!1});As.displayName="Route";var Py=D.createContext(null);Py.displayName="RouteError";var E4="REACT_ROUTER_ERROR",kC="REDIRECT",DC="ROUTE_ERROR_RESPONSE";function PC(t){if(t.startsWith(`${E4}:${kC}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function MC(t){if(t.startsWith(`${E4}:${DC}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new Ad(e.status,e.statusText,e.data)}catch{}}function IC(t,{relative:e}={}){cn(Gf(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=D.useContext(os),{hash:a,pathname:s,search:l}=Ld(t,{relative:e}),u=s;return n!=="/"&&(u=s==="/"?n:Ss([n,s])),r.createHref({pathname:u,search:l,hash:a})}function Gf(){return D.useContext(Td)!=null}function ls(){return cn(Gf(),"useLocation() may be used only in the context of a <Router> component."),D.useContext(Td).location}var A4="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function N4(t){D.useContext(os).static||D.useLayoutEffect(t)}function Bi(){let{isDataRoute:t}=D.useContext(As);return t?ZC():FC()}function FC(){cn(Gf(),"useNavigate() may be used only in the context of a <Router> component.");let t=D.useContext(vc),{basename:e,navigator:n}=D.useContext(os),{matches:r}=D.useContext(As),{pathname:a}=ls(),s=JSON.stringify(bg(r)),l=D.useRef(!1);return N4(()=>{l.current=!0}),D.useCallback((c,h={})=>{if(Kr(l.current,A4),!l.current)return;if(typeof c=="number"){n.go(c);return}let d=Ed(c,JSON.parse(s),a,h.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Ss([e,d.pathname])),(h.replace?n.replace:n.push)(d,h.state,h)},[e,n,s,a,t])}var UC=D.createContext(null);function BC(t){let e=D.useContext(As).outlet;return D.useMemo(()=>e&&D.createElement(UC.Provider,{value:t},e),[e,t])}function ia(){let{matches:t}=D.useContext(As),e=t[t.length-1];return(e==null?void 0:e.params)??{}}function Ld(t,{relative:e}={}){let{matches:n}=D.useContext(As),{pathname:r}=ls(),a=JSON.stringify(bg(n));return D.useMemo(()=>Ed(t,JSON.parse(a),r,e==="path"),[t,a,r,e])}function $C(t,e){return C4(t,e)}function C4(t,e,n){var N;cn(Gf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=D.useContext(os),{matches:a}=D.useContext(As),s=a[a.length-1],l=s?s.params:{},u=s?s.pathname:"/",c=s?s.pathnameBase:"/",h=s&&s.route;{let A=h&&h.path||"";L4(u,!h||A.endsWith("*")||A.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${A}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
+
|
|
61
|
+
Please change the parent <Route path="${A}"> to <Route path="${A==="/"?"*":`${A}/*`}">.`)}let d=ls(),m;if(e){let A=typeof e=="string"?to(e):e;cn(c==="/"||((N=A.pathname)==null?void 0:N.startsWith(c)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${A.pathname}" was given in the \`location\` prop.`),m=A}else m=d;let y=m.pathname||"/",g=y;if(c!=="/"){let A=c.replace(/^\//,"").split("/");g="/"+y.replace(/^\//,"").split("/").slice(A.length).join("/")}let x=n&&n.state.matches.length?n.state.matches.map(A=>Object.assign(A,{route:n.manifest[A.route.id]||A.route})):t4(t,{pathname:g});Kr(h||x!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Kr(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${m.pathname}${m.search}${m.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let _=GC(x&&x.map(A=>Object.assign({},A,{params:Object.assign({},l,A.params),pathname:Ss([c,r.encodeLocation?r.encodeLocation(A.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathname]),pathnameBase:A.pathnameBase==="/"?c:Ss([c,r.encodeLocation?r.encodeLocation(A.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:A.pathnameBase])})),a,n);return e&&_?D.createElement(Td.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...m},navigationType:"POP"}},_):_}function zC(){let t=XC(),e=ud(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=D.createElement(D.Fragment,null,D.createElement("p",null,"💿 Hey developer 👋"),D.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",D.createElement("code",{style:s},"ErrorBoundary")," or"," ",D.createElement("code",{style:s},"errorElement")," prop on your route.")),D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},e),n?D.createElement("pre",{style:a},n):null,l)}var qC=D.createElement(zC,null),T4=class extends D.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=MC(t.digest);n&&(t=n)}let e=t!==void 0?D.createElement(As.Provider,{value:this.props.routeContext},D.createElement(Py.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?D.createElement(HC,{error:t},e):e}};T4.contextType=x4;var d1=new WeakMap;function HC({children:t,error:e}){let{basename:n}=D.useContext(os);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let r=PC(e.digest);if(r){let a=d1.get(e);if(a)throw a;let s=o4(r.location,n);if(s4&&!d1.get(e))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw d1.set(e,l),l}return D.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function VC({routeContext:t,match:e,children:n}){let r=D.useContext(vc);return r&&r.static&&r.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=e.route.id),D.createElement(As.Provider,{value:t},n)}function GC(t,e=[],n){let r=n==null?void 0:n.state;if(t==null){if(!r)return null;if(r.errors)t=r.matches;else if(e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let a=t,s=r==null?void 0:r.errors;if(s!=null){let d=a.findIndex(m=>m.route.id&&(s==null?void 0:s[m.route.id])!==void 0);cn(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),a=a.slice(0,Math.min(a.length,d+1))}let l=!1,u=-1;if(n&&r){l=r.renderFallback;for(let d=0;d<a.length;d++){let m=a[d];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(u=d),m.route.id){let{loaderData:y,errors:g}=r,x=m.route.loader&&!y.hasOwnProperty(m.route.id)&&(!g||g[m.route.id]===void 0);if(m.route.lazy||x){n.isStatic&&(l=!0),u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}}let c=n==null?void 0:n.onError,h=r&&c?(d,m)=>{var y,g;c(d,{location:r.location,params:((g=(y=r.matches)==null?void 0:y[0])==null?void 0:g.params)??{},pattern:Nd(r.matches),errorInfo:m})}:void 0;return a.reduceRight((d,m,y)=>{let g,x=!1,_=null,N=null;r&&(g=s&&m.route.id?s[m.route.id]:void 0,_=m.route.errorElement||qC,l&&(u<0&&y===0?(L4("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,N=null):u===y&&(x=!0,N=m.route.hydrateFallbackElement||null)));let A=e.concat(a.slice(0,y+1)),j=()=>{let L;return g?L=_:x?L=N:m.route.Component?L=D.createElement(m.route.Component,null):m.route.element?L=m.route.element:L=d,D.createElement(VC,{match:m,routeContext:{outlet:d,matches:A,isDataRoute:r!=null},children:L})};return r&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?D.createElement(T4,{location:r.location,revalidation:r.revalidation,component:_,error:g,children:j(),routeContext:{outlet:null,matches:A,isDataRoute:!0},onError:h}):j()},null)}function My(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function WC(t){let e=D.useContext(vc);return cn(e,My(t)),e}function YC(t){let e=D.useContext(Cd);return cn(e,My(t)),e}function KC(t){let e=D.useContext(As);return cn(e,My(t)),e}function Iy(t){let e=KC(t),n=e.matches[e.matches.length-1];return cn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function JC(){return Iy("useRouteId")}function XC(){var r;let t=D.useContext(Py),e=YC("useRouteError"),n=Iy("useRouteError");return t!==void 0?t:(r=e.errors)==null?void 0:r[n]}function ZC(){let{router:t}=WC("useNavigate"),e=Iy("useNavigate"),n=D.useRef(!1);return N4(()=>{n.current=!0}),D.useCallback(async(a,s={})=>{Kr(n.current,A4),n.current&&(typeof a=="number"?await t.navigate(a):await t.navigate(a,{fromRouteId:e,...s}))},[t,e])}var lw={};function L4(t,e,n){!e&&!lw[t]&&(lw[t]=!0,Kr(!1,n))}var uw={};function cw(t,e){!t&&!uw[e]&&(uw[e]=!0,console.warn(e))}var QC="useOptimistic",fw=Sv[QC],eT=()=>{};function tT(t){return fw?fw(t):[t,eT]}function nT(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&Kr(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:D.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&Kr(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:D.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&Kr(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:D.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var rT=["HydrateFallback","hydrateFallbackElement"],aT=class{constructor(){this.status="pending",this.promise=new Promise((e,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",e(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}};function iT({router:t,flushSync:e,onError:n,useTransitions:r}){r=S4()||r;let[s,l]=D.useState(t.state),[u,c]=tT(s),[h,d]=D.useState(),[m,y]=D.useState({isTransitioning:!1}),[g,x]=D.useState(),[_,N]=D.useState(),[A,j]=D.useState(),L=D.useRef(new Map),R=D.useCallback((P,{deletedFetchers:B,newErrors:X,flushSync:F,viewTransitionOpts:$})=>{X&&n&&Object.values(X).forEach(Y=>{var he;return n(Y,{location:P.location,params:((he=P.matches[0])==null?void 0:he.params)??{},pattern:Nd(P.matches)})}),P.fetchers.forEach((Y,he)=>{Y.data!==void 0&&L.current.set(he,Y.data)}),B.forEach(Y=>L.current.delete(Y)),cw(F===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let K=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(cw($==null||K,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!$||!K){e&&F?e(()=>l(P)):r===!1?l(P):D.startTransition(()=>{r===!0&&c(Y=>hw(Y,P)),l(P)});return}if(e&&F){e(()=>{_&&(g==null||g.resolve(),_.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:$.currentLocation,nextLocation:$.nextLocation})});let Y=t.window.document.startViewTransition(()=>{e(()=>l(P))});Y.finished.finally(()=>{e(()=>{x(void 0),N(void 0),d(void 0),y({isTransitioning:!1})})}),e(()=>N(Y));return}_?(g==null||g.resolve(),_.skipTransition(),j({state:P,currentLocation:$.currentLocation,nextLocation:$.nextLocation})):(d(P),y({isTransitioning:!0,flushSync:!1,currentLocation:$.currentLocation,nextLocation:$.nextLocation}))},[t.window,e,_,g,r,c,n]);D.useLayoutEffect(()=>t.subscribe(R),[t,R]),D.useEffect(()=>{m.isTransitioning&&!m.flushSync&&x(new aT)},[m]),D.useEffect(()=>{if(g&&h&&t.window){let P=h,B=g.promise,X=t.window.document.startViewTransition(async()=>{r===!1?l(P):D.startTransition(()=>{r===!0&&c(F=>hw(F,P)),l(P)}),await B});X.finished.finally(()=>{x(void 0),N(void 0),d(void 0),y({isTransitioning:!1})}),N(X)}},[h,g,t.window,r,c]),D.useEffect(()=>{g&&h&&u.location.key===h.location.key&&g.resolve()},[g,_,u.location,h]),D.useEffect(()=>{!m.isTransitioning&&A&&(d(A.state),y({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}),j(void 0))},[m.isTransitioning,A]);let I=D.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:P=>t.navigate(P),push:(P,B,X)=>t.navigate(P,{state:B,preventScrollReset:X==null?void 0:X.preventScrollReset}),replace:(P,B,X)=>t.navigate(P,{replace:!0,state:B,preventScrollReset:X==null?void 0:X.preventScrollReset})}),[t]),ee=t.basename||"/",G=D.useMemo(()=>({router:t,navigator:I,static:!1,basename:ee,onError:n}),[t,I,ee,n]);return D.createElement(D.Fragment,null,D.createElement(vc.Provider,{value:G},D.createElement(Cd.Provider,{value:u},D.createElement(_4.Provider,{value:L.current},D.createElement(Dy.Provider,{value:m},D.createElement(lT,{basename:ee,location:u.location,navigationType:u.historyAction,navigator:I,useTransitions:r},D.createElement(sT,{routes:t.routes,manifest:t.manifest,future:t.future,state:u,isStatic:!1,onError:n})))))),null)}function hw(t,e){return{...t,navigation:e.navigation.state!=="idle"?e.navigation:t.navigation,revalidation:e.revalidation!=="idle"?e.revalidation:t.revalidation,actionData:e.navigation.state!=="submitting"?e.actionData:t.actionData,fetchers:e.fetchers}}var sT=D.memo(oT);function oT({routes:t,manifest:e,future:n,state:r,isStatic:a,onError:s}){return C4(t,void 0,{manifest:e,state:r,isStatic:a,onError:s})}function Pp({to:t,replace:e,state:n,relative:r}){cn(Gf(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=D.useContext(os);Kr(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=D.useContext(As),{pathname:l}=ls(),u=Bi(),c=Ed(t,bg(s),l,r==="path"),h=JSON.stringify(c);return D.useEffect(()=>{u(JSON.parse(h),{replace:e,state:n,relative:r})},[u,h,r,e,n]),null}function j4(t){return BC(t.context)}function Ka(t){cn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function lT({basename:t="/",children:e=null,location:n,navigationType:r="POP",navigator:a,static:s=!1,useTransitions:l}){cn(!Gf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let u=t.replace(/^\/*/,"/"),c=D.useMemo(()=>({basename:u,navigator:a,static:s,useTransitions:l,future:{}}),[u,a,s,l]);typeof n=="string"&&(n=to(n));let{pathname:h="/",search:d="",hash:m="",state:y=null,key:g="default",mask:x}=n,_=D.useMemo(()=>{let N=_s(h,u);return N==null?null:{location:{pathname:N,search:d,hash:m,state:y,key:g,mask:x},navigationType:r}},[u,h,d,m,y,g,r,x]);return Kr(_!=null,`<Router basename="${u}"> is not able to match the URL "${h}${d}${m}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:D.createElement(os.Provider,{value:c},D.createElement(Td.Provider,{children:e,value:_}))}function uT({children:t,location:e}){return $C(Nv(t),e)}function Nv(t,e=[]){let n=[];return D.Children.forEach(t,(r,a)=>{if(!D.isValidElement(r))return;let s=[...e,a];if(r.type===D.Fragment){n.push.apply(n,Nv(r.props.children,s));return}cn(r.type===Ka,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),cn(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=Nv(r.props.children,s)),n.push(l)}),n}var bm="get",wm="application/x-www-form-urlencoded";function wg(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function cT(t){return wg(t)&&t.tagName.toLowerCase()==="button"}function fT(t){return wg(t)&&t.tagName.toLowerCase()==="form"}function hT(t){return wg(t)&&t.tagName.toLowerCase()==="input"}function dT(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function pT(t,e){return t.button===0&&(!e||e==="_self")&&!dT(t)}function Cv(t=""){return new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,n)=>{let r=t[n];return e.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function mT(t,e){let n=Cv(t);return e&&e.forEach((r,a)=>{n.has(a)||e.getAll(a).forEach(s=>{n.append(a,s)})}),n}var Mp=null;function gT(){if(Mp===null)try{new FormData(document.createElement("form"),0),Mp=!1}catch{Mp=!0}return Mp}var vT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function p1(t){return t!=null&&!vT.has(t)?(Kr(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wm}"`),null):t}function yT(t,e){let n,r,a,s,l;if(fT(t)){let u=t.getAttribute("action");r=u?_s(u,e):null,n=t.getAttribute("method")||bm,a=p1(t.getAttribute("enctype"))||wm,s=new FormData(t)}else if(cT(t)||hT(t)&&(t.type==="submit"||t.type==="image")){let u=t.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=t.getAttribute("formaction")||u.getAttribute("action");if(r=c?_s(c,e):null,n=t.getAttribute("formmethod")||u.getAttribute("method")||bm,a=p1(t.getAttribute("formenctype"))||p1(u.getAttribute("enctype"))||wm,s=new FormData(u,t),!gT()){let{name:h,type:d,value:m}=t;if(d==="image"){let y=h?`${h}.`:"";s.append(`${y}x`,"0"),s.append(`${y}y`,"0")}else h&&s.append(h,m)}}else{if(wg(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=bm,r=null,a=wm,l=t}return s&&a==="text/plain"&&(l=s,s=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Fy(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function O4(t,e,n,r){let a=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:e&&_s(a.pathname,e)==="/"?a.pathname=`${Pm(e)}/_root.${r}`:a.pathname=`${Pm(a.pathname)}.${r}`,a}async function bT(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function wT(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function xT(t,e,n){let r=await Promise.all(t.map(async a=>{let s=e.routes[a.route.id];if(s){let l=await bT(s,n);return l.links?l.links():[]}return[]}));return AT(r.flat(1).filter(wT).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function dw(t,e,n,r,a,s){let l=(c,h)=>n[h]?c.route.id!==n[h].route.id:!0,u=(c,h)=>{var d;return n[h].pathname!==c.pathname||((d=n[h].route.path)==null?void 0:d.endsWith("*"))&&n[h].params["*"]!==c.params["*"]};return s==="assets"?e.filter((c,h)=>l(c,h)||u(c,h)):s==="data"?e.filter((c,h)=>{var m;let d=r.routes[c.route.id];if(!d||!d.hasLoader)return!1;if(l(c,h)||u(c,h))return!0;if(c.route.shouldRevalidate){let y=c.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(t,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function ST(t,e,{includeHydrateFallback:n}={}){return _T(t.map(r=>{let a=e.routes[r.route.id];if(!a)return[];let s=[a.module];return a.clientActionModule&&(s=s.concat(a.clientActionModule)),a.clientLoaderModule&&(s=s.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(s=s.concat(a.hydrateFallbackModule)),a.imports&&(s=s.concat(a.imports)),s}).flat(1))}function _T(t){return[...new Set(t)]}function ET(t){let e={},n=Object.keys(t).sort();for(let r of n)e[r]=t[r];return e}function AT(t,e){let n=new Set;return new Set(e),t.reduce((r,a)=>{let s=JSON.stringify(ET(a));return n.has(s)||(n.add(s),r.push({key:s,link:a})),r},[])}function Uy(){let t=D.useContext(vc);return Fy(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function NT(){let t=D.useContext(Cd);return Fy(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var By=D.createContext(void 0);By.displayName="FrameworkContext";function $y(){let t=D.useContext(By);return Fy(t,"You must render this element inside a <HydratedRouter> element"),t}function CT(t,e){let n=D.useContext(By),[r,a]=D.useState(!1),[s,l]=D.useState(!1),{onFocus:u,onBlur:c,onMouseEnter:h,onMouseLeave:d,onTouchStart:m}=e,y=D.useRef(null);D.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let _=A=>{A.forEach(j=>{l(j.isIntersecting)})},N=new IntersectionObserver(_,{threshold:.5});return y.current&&N.observe(y.current),()=>{N.disconnect()}}},[t]),D.useEffect(()=>{if(r){let _=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(_)}}},[r]);let g=()=>{a(!0)},x=()=>{a(!1),l(!1)};return n?t!=="intent"?[s,y,{}]:[s,y,{onFocus:Ih(u,g),onBlur:Ih(c,x),onMouseEnter:Ih(h,g),onMouseLeave:Ih(d,x),onTouchStart:Ih(m,g)}]:[!1,y,{}]}function Ih(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function TT({page:t,...e}){let n=S4(),{router:r}=Uy(),a=D.useMemo(()=>t4(r.routes,t,r.basename),[r.routes,t,r.basename]);return a?n?D.createElement(jT,{page:t,matches:a,...e}):D.createElement(OT,{page:t,matches:a,...e}):null}function LT(t){let{manifest:e,routeModules:n}=$y(),[r,a]=D.useState([]);return D.useEffect(()=>{let s=!1;return xT(t,e,n).then(l=>{s||a(l)}),()=>{s=!0}},[t,e,n]),r}function jT({page:t,matches:e,...n}){let r=ls(),{future:a}=$y(),{basename:s}=Uy(),l=D.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let u=O4(t,s,a.v8_trailingSlashAwareDataRequests,"rsc"),c=!1,h=[];for(let d of e)typeof d.route.shouldRevalidate=="function"?c=!0:h.push(d.route.id);return c&&h.length>0&&u.searchParams.set("_routes",h.join(",")),[u.pathname+u.search]},[s,a.v8_trailingSlashAwareDataRequests,t,r,e]);return D.createElement(D.Fragment,null,l.map(u=>D.createElement("link",{key:u,rel:"prefetch",as:"fetch",href:u,...n})))}function OT({page:t,matches:e,...n}){let r=ls(),{future:a,manifest:s,routeModules:l}=$y(),{basename:u}=Uy(),{loaderData:c,matches:h}=NT(),d=D.useMemo(()=>dw(t,e,h,s,r,"data"),[t,e,h,s,r]),m=D.useMemo(()=>dw(t,e,h,s,r,"assets"),[t,e,h,s,r]),y=D.useMemo(()=>{if(t===r.pathname+r.search+r.hash)return[];let _=new Set,N=!1;if(e.forEach(j=>{var R;let L=s.routes[j.route.id];!L||!L.hasLoader||(!d.some(I=>I.route.id===j.route.id)&&j.route.id in c&&((R=l[j.route.id])!=null&&R.shouldRevalidate)||L.hasClientLoader?N=!0:_.add(j.route.id))}),_.size===0)return[];let A=O4(t,u,a.v8_trailingSlashAwareDataRequests,"data");return N&&_.size>0&&A.searchParams.set("_routes",e.filter(j=>_.has(j.route.id)).map(j=>j.route.id).join(",")),[A.pathname+A.search]},[u,a.v8_trailingSlashAwareDataRequests,c,r,s,d,e,t,l]),g=D.useMemo(()=>ST(m,s),[m,s]),x=LT(m);return D.createElement(D.Fragment,null,y.map(_=>D.createElement("link",{key:_,rel:"prefetch",as:"fetch",href:_,...n})),g.map(_=>D.createElement("link",{key:_,rel:"modulepreload",href:_,...n})),x.map(({key:_,link:N})=>D.createElement("link",{key:_,nonce:n.nonce,...N,crossOrigin:N.crossOrigin??n.crossOrigin})))}function RT(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var kT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{kT&&(window.__reactRouterVersion="7.17.0")}catch{}function DT(t,e){return oC({basename:e==null?void 0:e.basename,getContext:e==null?void 0:e.getContext,future:e==null?void 0:e.future,history:SN({window:e==null?void 0:e.window}),hydrationData:PT(),routes:t,mapRouteProperties:nT,hydrationRouteProperties:rT,dataStrategy:e==null?void 0:e.dataStrategy,patchRoutesOnNavigation:e==null?void 0:e.patchRoutesOnNavigation,window:e==null?void 0:e.window,instrumentations:e==null?void 0:e.instrumentations}).initialize()}function PT(){let t=window==null?void 0:window.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:MT(t.errors)}),t}function MT(t){if(!t)return null;let e=Object.entries(t),n={};for(let[r,a]of e)if(a&&a.__type==="RouteErrorResponse")n[r]=new Ad(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let s=window[a.__subType];if(typeof s=="function")try{let l=new s(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let s=new Error(a.message);s.stack="",n[r]=s}}else n[r]=a;return n}var R4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,xg=D.forwardRef(function({onClick:e,discover:n="render",prefetch:r="none",relative:a,reloadDocument:s,replace:l,mask:u,state:c,target:h,to:d,preventScrollReset:m,viewTransition:y,defaultShouldRevalidate:g,...x},_){let{basename:N,navigator:A,useTransitions:j}=D.useContext(os),L=typeof d=="string"&&R4.test(d),R=o4(d,N);d=R.to;let I=IC(d,{relative:a}),ee=ls(),G=null;if(u){let he=Ed(u,[],ee.mask?ee.mask.pathname:"/",!0);N!=="/"&&(he.pathname=he.pathname==="/"?N:Ss([N,he.pathname])),G=A.createHref(he)}let[P,B,X]=CT(r,x),F=BT(d,{replace:l,mask:u,state:c,target:h,preventScrollReset:m,relative:a,viewTransition:y,defaultShouldRevalidate:g,useTransitions:j});function $(he){e&&e(he),he.defaultPrevented||F(he)}let K=!(R.isExternal||s),Y=D.createElement("a",{...x,...X,href:(K?G:void 0)||R.absoluteURL||I,onClick:K?$:e,ref:RT(_,B),target:h,"data-discover":!L&&n==="render"?"true":void 0});return P&&!L?D.createElement(D.Fragment,null,Y,D.createElement(TT,{page:I})):Y});xg.displayName="Link";var IT=D.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:r="",end:a=!1,style:s,to:l,viewTransition:u,children:c,...h},d){let m=Ld(l,{relative:h.relative}),y=ls(),g=D.useContext(Cd),{navigator:x,basename:_}=D.useContext(os),N=g!=null&>(m)&&u===!0,A=x.encodeLocation?x.encodeLocation(m).pathname:m.pathname,j=y.pathname,L=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(j=j.toLowerCase(),L=L?L.toLowerCase():null,A=A.toLowerCase()),L&&_&&(L=_s(L,_)||L);const R=A!=="/"&&A.endsWith("/")?A.length-1:A.length;let I=j===A||!a&&j.startsWith(A)&&j.charAt(R)==="/",ee=L!=null&&(L===A||!a&&L.startsWith(A)&&L.charAt(A.length)==="/"),G={isActive:I,isPending:ee,isTransitioning:N},P=I?e:void 0,B;typeof r=="function"?B=r(G):B=[r,I?"active":null,ee?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let X=typeof s=="function"?s(G):s;return D.createElement(xg,{...h,"aria-current":P,className:B,ref:d,style:X,to:l,viewTransition:u},typeof c=="function"?c(G):c)});IT.displayName="NavLink";var FT=D.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:r,replace:a,state:s,method:l=bm,action:u,onSubmit:c,relative:h,preventScrollReset:d,viewTransition:m,defaultShouldRevalidate:y,...g},x)=>{let{useTransitions:_}=D.useContext(os),N=HT(),A=VT(u,{relative:h}),j=l.toLowerCase()==="get"?"get":"post",L=typeof u=="string"&&R4.test(u),R=I=>{if(c&&c(I),I.defaultPrevented)return;I.preventDefault();let ee=I.nativeEvent.submitter,G=(ee==null?void 0:ee.getAttribute("formmethod"))||l,P=()=>N(ee||I.currentTarget,{fetcherKey:e,method:G,navigate:n,replace:a,state:s,relative:h,preventScrollReset:d,viewTransition:m,defaultShouldRevalidate:y});_&&n!==!1?D.startTransition(()=>P()):P()};return D.createElement("form",{ref:x,method:j,action:A,onSubmit:r?c:R,...g,"data-discover":!L&&t==="render"?"true":void 0})});FT.displayName="Form";function UT(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function k4(t){let e=D.useContext(vc);return cn(e,UT(t)),e}function BT(t,{target:e,replace:n,mask:r,state:a,preventScrollReset:s,relative:l,viewTransition:u,defaultShouldRevalidate:c,useTransitions:h}={}){let d=Bi(),m=ls(),y=Ld(t,{relative:l});return D.useCallback(g=>{if(pT(g,e)){g.preventDefault();let x=n!==void 0?n:Bo(m)===Bo(y),_=()=>d(t,{replace:x,mask:r,state:a,preventScrollReset:s,relative:l,viewTransition:u,defaultShouldRevalidate:c});h?D.startTransition(()=>_()):_()}},[m,d,y,n,r,a,e,t,s,l,u,c,h])}function $T(t){Kr(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let e=D.useRef(Cv(t)),n=D.useRef(!1),r=ls(),a=D.useMemo(()=>mT(r.search,n.current?null:e.current),[r.search]),s=Bi(),l=D.useCallback((u,c)=>{const h=Cv(typeof u=="function"?u(new URLSearchParams(a)):u);n.current=!0,s("?"+h,c)},[s,a]);return[a,l]}var zT=0,qT=()=>`__${String(++zT)}__`;function HT(){let{router:t}=k4("useSubmit"),{basename:e}=D.useContext(os),n=JC(),r=t.fetch,a=t.navigate;return D.useCallback(async(s,l={})=>{let{action:u,method:c,encType:h,formData:d,body:m}=yT(s,e);if(l.navigate===!1){let y=l.fetcherKey||qT();await r(y,n,l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:m,formMethod:l.method||c,formEncType:l.encType||h,flushSync:l.flushSync})}else await a(l.action||u,{defaultShouldRevalidate:l.defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:d,body:m,formMethod:l.method||c,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,e,n])}function VT(t,{relative:e}={}){let{basename:n}=D.useContext(os),r=D.useContext(As);cn(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),s={...Ld(t||".",{relative:e})},l=ls();if(t==null){s.search=l.search;let u=new URLSearchParams(s.search),c=u.getAll("index");if(c.some(d=>d==="")){u.delete("index"),c.filter(m=>m).forEach(m=>u.append("index",m));let d=u.toString();s.search=d?`?${d}`:""}}return(!t||t===".")&&a.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:Ss([n,s.pathname])),Bo(s)}function GT(t,{relative:e}={}){let n=D.useContext(Dy);cn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=k4("useViewTransitionState"),a=Ld(t,{relative:e});if(!n.isTransitioning)return!1;let s=_s(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=_s(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Dm(a.pathname,l)!=null||Dm(a.pathname,s)!=null}var D4=X_();function WT(t){return D.createElement(iT,{flushSync:D4.flushSync,...t})}const YT=(t,e,n,r)=>{var s,l,u,c;const a=[n,{code:e,...r||{}}];if((l=(s=t==null?void 0:t.services)==null?void 0:s.logger)!=null&&l.forward)return t.services.logger.forward(a,"warn","react-i18next::",!0);lc(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(c=(u=t==null?void 0:t.services)==null?void 0:u.logger)!=null&&c.warn?t.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},pw={},Tv=(t,e,n,r)=>{lc(n)&&pw[n]||(lc(n)&&(pw[n]=new Date),YT(t,e,n,r))},P4=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},Lv=(t,e,n)=>{t.loadNamespaces(e,P4(t,n))},mw=(t,e,n,r)=>{if(lc(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Lv(t,n,r);n.forEach(a=>{t.options.ns.indexOf(a)<0&&t.options.ns.push(a)}),t.loadLanguages(e,P4(t,r))},KT=(t,e,n={})=>!e.languages||!e.languages.length?(Tv(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,t))return!1}}),lc=t=>typeof t=="string",JT=t=>typeof t=="object"&&t!==null,XT=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ZT={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},QT=t=>ZT[t],e8=t=>t.replace(XT,QT);let jv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e8};const t8=(t={})=>{jv={...jv,...t}},n8=()=>jv;let M4;const r8=t=>{M4=t},a8=()=>M4,i8={type:"3rdParty",init(t){t8(t.options.react),r8(t)}},s8=D.createContext();class o8{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const l8=(t,e)=>{const n=D.useRef();return D.useEffect(()=>{n.current=t},[t,e]),n.current},I4=(t,e,n,r)=>t.getFixedT(e,n,r),u8=(t,e,n,r)=>D.useCallback(I4(t,e,n,r),[t,e,n,r]),Ar=(t,e={})=>{var R,I,ee,G;const{i18n:n}=e,{i18n:r,defaultNS:a}=D.useContext(s8)||{},s=n||r||a8();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new o8),!s){Tv(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const P=(X,F)=>lc(F)?F:JT(F)&&lc(F.defaultValue)?F.defaultValue:Array.isArray(X)?X[X.length-1]:X,B=[P,{},!1];return B.t=P,B.i18n={},B.ready=!1,B}(R=s.options.react)!=null&&R.wait&&Tv(s,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const l={...n8(),...s.options.react,...e},{useSuspense:u,keyPrefix:c}=l;let h=a||((I=s.options)==null?void 0:I.defaultNS);h=lc(h)?[h]:h||["translation"],(G=(ee=s.reportNamespaces).addUsedNamespaces)==null||G.call(ee,h);const d=(s.isInitialized||s.initializedStoreOnce)&&h.every(P=>KT(P,s,l)),m=u8(s,e.lng||null,l.nsMode==="fallback"?h:h[0],c),y=()=>m,g=()=>I4(s,e.lng||null,l.nsMode==="fallback"?h:h[0],c),[x,_]=D.useState(y);let N=h.join();e.lng&&(N=`${e.lng}${N}`);const A=l8(N),j=D.useRef(!0);D.useEffect(()=>{const{bindI18n:P,bindI18nStore:B}=l;j.current=!0,!d&&!u&&(e.lng?mw(s,e.lng,h,()=>{j.current&&_(g)}):Lv(s,h,()=>{j.current&&_(g)})),d&&A&&A!==N&&j.current&&_(g);const X=()=>{j.current&&_(g)};return P&&(s==null||s.on(P,X)),B&&(s==null||s.store.on(B,X)),()=>{j.current=!1,s&&P&&(P==null||P.split(" ").forEach(F=>s.off(F,X))),B&&s&&B.split(" ").forEach(F=>s.store.off(F,X))}},[s,N]),D.useEffect(()=>{j.current&&d&&_(y)},[s,c,d]);const L=[x,s,d];if(L.t=x,L.i18n=s,L.ready=d,d||!d&&!u)return L;throw new Promise(P=>{e.lng?mw(s,e.lng,h,()=>P()):Lv(s,h,()=>P())})};function F4(t,e){if(!t)return`rgba(255,255,255,${e})`;let n=t.replace("#","");if(n.length===3&&(n=n.split("").map(l=>l+l).join("")),n.length!==6)return`rgba(255,255,255,${e})`;const r=parseInt(n.substring(0,2),16),a=parseInt(n.substring(2,4),16),s=parseInt(n.substring(4,6),16);return`rgba(${r},${a},${s},${e})`}const U4=D.createContext({darkMode:!1,setDarkMode:()=>{}}),c8=({children:t})=>{const[e,n]=D.useState(!1);return D.useEffect(()=>{e?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),E.jsx(U4.Provider,{value:{darkMode:e,setDarkMode:n},children:t})},Aa=()=>D.useContext(U4);var B4={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},gw=vn.createContext&&vn.createContext(B4),f8=["attr","size","title"];function h8(t,e){if(t==null)return{};var n,r,a=d8(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}function d8(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Mm(){return Mm=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Mm.apply(null,arguments)}function vw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function Im(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?vw(Object(n),!0).forEach(function(r){p8(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):vw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function p8(t,e,n){return(e=m8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m8(t){var e=g8(t,"string");return typeof e=="symbol"?e:e+""}function g8(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $4(t){return t&&t.map((e,n)=>vn.createElement(e.tag,Im({key:n},e.attr),$4(e.child)))}function Na(t){return e=>vn.createElement(v8,Mm({attr:Im({},t.attr)},e),$4(t.child))}function v8(t){var e=n=>{var{attr:r,size:a,title:s}=t,l=h8(t,f8),u=a||n.size||"1em",c;return n.className&&(c=n.className),t.className&&(c=(c?c+" ":"")+t.className),vn.createElement("svg",Mm({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,l,{className:c,style:Im(Im({color:t.color||n.color},n.style),t.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),s&&vn.createElement("title",null,s),t.children)};return gw!==void 0?vn.createElement(gw.Consumer,null,n=>e(n)):e(B4)}function jd(t){return Na({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 32l-64 80h32v64h64v-64h32l-64-80zm-9 187v80h18v-80h-18zm-63.992 53.602l-16.631 6.886 15.309 36.955 16.628-6.886-15.306-36.955zm145.984 0l-15.306 36.955 16.628 6.886 15.309-36.955-16.63-6.886zM77.795 284.068l-12.727 12.727 56.569 56.568 12.726-12.726-56.568-56.569zm356.41 0l-56.568 56.569 12.726 12.726 56.569-56.568-12.727-12.727zM256 337.994a118.919 118.919 0 0 0-59.5 15.95c-34.215 19.754-56.177 55.048-59.129 94.056H374.63c-2.952-39.008-24.914-74.302-59.129-94.057a118.919 118.919 0 0 0-59.5-15.949zM66.488 387.377l-6.886 16.63 36.955 15.307 6.886-16.628-36.955-15.309zm379.024 0l-36.955 15.309 6.886 16.628 36.955-15.306-6.886-16.631zM24 466v18h464v-18H24z"},child:[]}]})(t)}function Sg(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n}function y8(t,e,n,r){function a(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function u(d){try{h(r.next(d))}catch(m){l(m)}}function c(d){try{h(r.throw(d))}catch(m){l(m)}}function h(d){d.done?s(d.value):a(d.value).then(u,c)}h((r=r.apply(t,e||[])).next())})}const b8=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);class zy extends Error{constructor(e,n="FunctionsError",r){super(e),this.name=n,this.context=r}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class w8 extends zy{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class yw extends zy{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class bw extends zy{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Ov;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Ov||(Ov={}));class x8{constructor(e,{headers:n={},customFetch:r,region:a=Ov.Any}={}){this.url=e,this.headers=n,this.region=a,this.fetch=b8(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return y8(this,arguments,void 0,function*(n,r={}){var a;let s,l;try{const{headers:u,method:c,body:h,signal:d,timeout:m}=r;let y={},{region:g}=r;g||(g=this.region);const x=new URL(`${this.url}/${n}`);g&&g!=="any"&&(y["x-region"]=g,x.searchParams.set("forceFunctionRegion",g));let _;h&&(u&&!Object.prototype.hasOwnProperty.call(u,"Content-Type")||!u)?typeof Blob<"u"&&h instanceof Blob||h instanceof ArrayBuffer?(y["Content-Type"]="application/octet-stream",_=h):typeof h=="string"?(y["Content-Type"]="text/plain",_=h):typeof FormData<"u"&&h instanceof FormData?_=h:(y["Content-Type"]="application/json",_=JSON.stringify(h)):h&&typeof h!="string"&&!(typeof Blob<"u"&&h instanceof Blob)&&!(h instanceof ArrayBuffer)&&!(typeof FormData<"u"&&h instanceof FormData)?_=JSON.stringify(h):_=h;let N=d;m&&(l=new AbortController,s=setTimeout(()=>l.abort(),m),d?(N=l.signal,d.addEventListener("abort",()=>l.abort())):N=l.signal);const A=yield this.fetch(x.toString(),{method:c||"POST",headers:Object.assign(Object.assign(Object.assign({},y),this.headers),u),body:_,signal:N}).catch(I=>{throw new w8(I)}),j=A.headers.get("x-relay-error");if(j&&j==="true")throw new yw(A);if(!A.ok)throw new bw(A);let L=((a=A.headers.get("Content-Type"))!==null&&a!==void 0?a:"text/plain").split(";")[0].trim(),R;return L==="application/json"?R=yield A.json():L==="application/octet-stream"||L==="application/pdf"?R=yield A.blob():L==="text/event-stream"?R=A:L==="multipart/form-data"?R=yield A.formData():R=yield A.text(),{data:R,error:null,response:A}}catch(u){return{data:null,error:u,response:u instanceof bw||u instanceof yw?u.context:void 0}}finally{s&&clearTimeout(s)}})}}const z4=3,ww=t=>Math.min(1e3*2**t,3e4),S8=[520,503],q4=["GET","HEAD","OPTIONS"];var xw=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.code=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Sw(t,e){return new Promise(n=>{if(e!=null&&e.aborted){n();return}const r=setTimeout(()=>{e==null||e.removeEventListener("abort",a),n()},t);function a(){clearTimeout(r),n()}e==null||e.addEventListener("abort",a)})}function _8(t,e,n,r){return!(!r||n>=z4||!q4.includes(t)||!S8.includes(e))}var E8=class{constructor(t){var e,n,r,a,s;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(n=t.isMaybeSingle)!==null&&n!==void 0?n:!1,this.shouldStripNulls=(r=t.shouldStripNulls)!==null&&r!==void 0?r:!1,this.urlLengthLimit=(a=t.urlLengthLimit)!==null&&a!==void 0?a:8e3,this.retryEnabled=(s=t.retry)!==null&&s!==void 0?s:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var n=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const l=this.headers.get("Accept");l==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!l||l==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const r=this.fetch;let s=(async()=>{let l=0;for(;;){const h={};n.headers.forEach((m,y)=>{h[y]=m}),l>0&&(h["X-Retry-Count"]=String(l));let d;try{d=await r(n.url.toString(),{method:n.method,headers:h,body:JSON.stringify(n.body,(m,y)=>typeof y=="bigint"?y.toString():y),signal:n.signal})}catch(m){if((m==null?void 0:m.name)==="AbortError"||(m==null?void 0:m.code)==="ABORT_ERR"||!q4.includes(n.method))throw m;if(n.retryEnabled&&l<z4){const y=ww(l);l++,await Sw(y,n.signal);continue}throw m}if(_8(n.method,d.status,l,n.retryEnabled)){var u,c;const m=(u=(c=d.headers)===null||c===void 0?void 0:c.get("Retry-After"))!==null&&u!==void 0?u:null,y=m!==null?Math.max(0,parseInt(m,10)||0)*1e3:ww(l);await d.text(),l++,await Sw(y,n.signal);continue}return await n.processResponse(d)}})();return this.shouldThrowOnError||(s=s.catch(l=>{var u;let c="",h="",d="";const m=l==null?void 0:l.cause;if(m){var y,g,x,_;const j=(y=m==null?void 0:m.message)!==null&&y!==void 0?y:"",L=(g=m==null?void 0:m.code)!==null&&g!==void 0?g:"";c=`${(x=l==null?void 0:l.name)!==null&&x!==void 0?x:"FetchError"}: ${l==null?void 0:l.message}`,c+=`
|
|
62
|
+
|
|
63
|
+
Caused by: ${(_=m==null?void 0:m.name)!==null&&_!==void 0?_:"Error"}: ${j}`,L&&(c+=` (${L})`),m!=null&&m.stack&&(c+=`
|
|
64
|
+
${m.stack}`)}else{var N;c=(N=l==null?void 0:l.stack)!==null&&N!==void 0?N:""}const A=this.url.toString().length;return(l==null?void 0:l.name)==="AbortError"||(l==null?void 0:l.code)==="ABORT_ERR"?(d="",h="Request was aborted (timeout or manual cancellation)",A>this.urlLengthLimit&&(h+=`. Note: Your request URL is ${A} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((m==null?void 0:m.name)==="HeadersOverflowError"||(m==null?void 0:m.code)==="UND_ERR_HEADERS_OVERFLOW")&&(d="",h="HTTP headers exceeded server limits (typically 16KB)",A>this.urlLengthLimit&&(h+=`. Your request URL is ${A} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(u=l==null?void 0:l.name)!==null&&u!==void 0?u:"FetchError"}: ${l==null?void 0:l.message}`,details:c,hint:h,code:d},data:null,count:null,status:0,statusText:""}})),s.then(t,e)}async processResponse(t){var e=this;let n=null,r=null,a=null,s=t.status,l=t.statusText;if(t.ok){var u,c;if(e.method!=="HEAD"){var h;const y=await t.text();if(y!=="")if(e.headers.get("Accept")==="text/csv")r=y;else if(e.headers.get("Accept")&&(!((h=e.headers.get("Accept"))===null||h===void 0)&&h.includes("application/vnd.pgrst.plan+text")))r=y;else try{r=JSON.parse(y)}catch{if(n={message:y},r=null,e.shouldThrowOnError)throw new xw({message:y,details:"",hint:"",code:""})}}const d=(u=e.headers.get("Prefer"))===null||u===void 0?void 0:u.match(/count=(exact|planned|estimated)/),m=(c=t.headers.get("content-range"))===null||c===void 0?void 0:c.split("/");d&&m&&m.length>1&&(a=parseInt(m[1])),e.isMaybeSingle&&Array.isArray(r)&&(r.length>1?(n={code:"PGRST116",details:`Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},r=null,a=null,s=406,l="Not Acceptable"):r.length===1?r=r[0]:r=null)}else{const d=await t.text();try{n=JSON.parse(d),Array.isArray(n)&&t.status===404&&(r=[],n=null,s=200,l="OK")}catch{t.status===404&&d===""?(s=204,l="No Content"):n={message:d}}if(n&&e.shouldThrowOnError)throw new xw(n)}return{success:n===null,error:n,data:r,count:a,status:s,statusText:l}}returns(){return this}overrideTypes(){return this}},A8=class extends E8{throwOnError(){return super.throwOnError()}select(t){let e=!1;const n=(t??"*").split("").map(r=>/\s/.test(r)&&!e?"":(r==='"'&&(e=!e),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:n,foreignTable:r,referencedTable:a=r}={}){const s=a?`${a}.order`:"order",l=this.url.searchParams.get(s);return this.url.searchParams.set(s,`${l?`${l},`:""}${t}.${e?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:n=e}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${t}`),this}range(t,e,{foreignTable:n,referencedTable:r=n}={}){const a=typeof r>"u"?"offset":`${r}.offset`,s=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(a,`${t}`),this.url.searchParams.set(s,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:n=!1,buffers:r=!1,wal:a=!1,format:s="text"}={}){var l;const u=[t?"analyze":null,e?"verbose":null,n?"settings":null,r?"buffers":null,a?"wal":null].filter(Boolean).join("|"),c=(l=this.headers.get("Accept"))!==null&&l!==void 0?l:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${s}; for="${c}"; options=${u};`),s==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const _w=new RegExp("[,()]");var xf=class extends A8{throwOnError(){return super.throwOnError()}eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&_w.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`in.(${n})`),this}notIn(t,e){const n=Array.from(new Set(e)).map(r=>typeof r=="string"&&_w.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(t,`not.in.(${n})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:n,type:r}={}){let a="";r==="plain"?a="pl":r==="phrase"?a="ph":r==="websearch"&&(a="w");const s=n===void 0?"":`(${n})`;return this.url.searchParams.append(t,`${a}fts${s}.${e}`),this}match(t){return Object.entries(t).filter(([e,n])=>n!==void 0).forEach(([e,n])=>{this.url.searchParams.append(e,`eq.${n}`)}),this}not(t,e,n){return this.url.searchParams.append(t,`not.${e}.${n}`),this}or(t,{foreignTable:e,referencedTable:n=e}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${t})`),this}filter(t,e,n){return this.url.searchParams.append(t,`${e}.${n}`),this}},N8=class{constructor(t,{headers:e={},schema:n,fetch:r,urlLengthLimit:a=8e3,retry:s}){this.url=t,this.headers=new Headers(e),this.schema=n,this.fetch=r,this.urlLengthLimit=a,this.retry=s}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:n=!1,count:r}=e??{},a=n?"HEAD":"GET";let s=!1;const l=(t??"*").split("").map(h=>/\s/.test(h)&&!s?"":(h==='"'&&(s=!s),h)).join(""),{url:u,headers:c}=this.cloneRequestState();return u.searchParams.set("select",l),r&&c.append("Prefer",`count=${r}`),new xf({method:a,url:u,headers:c,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:n=!0}={}){var r;const a="POST",{url:s,headers:l}=this.cloneRequestState();if(e&&l.append("Prefer",`count=${e}`),n||l.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((c,h)=>c.concat(Object.keys(h)),[]);if(u.length>0){const c=[...new Set(u)].map(h=>`"${h}"`);s.searchParams.set("columns",c.join(","))}}return new xf({method:a,url:s,headers:l,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:n=!1,count:r,defaultToNull:a=!0}={}){var s;const l="POST",{url:u,headers:c}=this.cloneRequestState();if(c.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),e!==void 0&&u.searchParams.set("on_conflict",e),r&&c.append("Prefer",`count=${r}`),a||c.append("Prefer","missing=default"),Array.isArray(t)){const h=t.reduce((d,m)=>d.concat(Object.keys(m)),[]);if(h.length>0){const d=[...new Set(h)].map(m=>`"${m}"`);u.searchParams.set("columns",d.join(","))}}return new xf({method:l,url:u,headers:c,schema:this.schema,body:t,fetch:(s=this.fetch)!==null&&s!==void 0?s:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var n;const r="PATCH",{url:a,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new xf({method:r,url:a,headers:s,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const n="DELETE",{url:r,headers:a}=this.cloneRequestState();return t&&a.append("Prefer",`count=${t}`),new xf({method:n,url:r,headers:a,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function cd(t){"@babel/helpers - typeof";return cd=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},cd(t)}function C8(t,e){if(cd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(cd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function T8(t){var e=C8(t,"string");return cd(e)=="symbol"?e:e+""}function L8(t,e,n){return(e=T8(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Ew(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function Ip(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Ew(Object(n),!0).forEach(function(r){L8(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Ew(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var j8=class H4{constructor(e,{headers:n={},schema:r,fetch:a,timeout:s,urlLengthLimit:l=8e3,retry:u}={}){this.url=e,this.headers=new Headers(n),this.schemaName=r,this.urlLengthLimit=l;const c=a??globalThis.fetch;s!==void 0&&s>0?this.fetch=(h,d)=>{const m=new AbortController,y=setTimeout(()=>m.abort(),s),g=d==null?void 0:d.signal;if(g){if(g.aborted)return clearTimeout(y),c(h,d);const x=()=>{clearTimeout(y),m.abort()};return g.addEventListener("abort",x,{once:!0}),c(h,Ip(Ip({},d),{},{signal:m.signal})).finally(()=>{clearTimeout(y),g.removeEventListener("abort",x)})}return c(h,Ip(Ip({},d),{},{signal:m.signal})).finally(()=>clearTimeout(y))}:this.fetch=c,this.retry=u}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new N8(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new H4(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,n={},{head:r=!1,get:a=!1,count:s}={}){var l;let u;const c=new URL(`${this.url}/rpc/${e}`);let h;const d=g=>g!==null&&typeof g=="object"&&(!Array.isArray(g)||g.some(d)),m=r&&Object.values(n).some(d);m?(u="POST",h=n):r||a?(u=r?"HEAD":"GET",Object.entries(n).filter(([g,x])=>x!==void 0).map(([g,x])=>[g,Array.isArray(x)?`{${x.join(",")}}`:`${x}`]).forEach(([g,x])=>{c.searchParams.append(g,x)})):(u="POST",h=n);const y=new Headers(this.headers);return m?y.set("Prefer",s?`count=${s},return=minimal`:"return=minimal"):s&&y.set("Prefer",`count=${s}`),new xf({method:u,url:c,headers:y,schema:this.schemaName,body:h,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class O8{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const n=globalThis;if(typeof globalThis<"u"&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};const r=typeof global<"u"?global:void 0;if(r&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};if(typeof globalThis<"u"&&typeof n.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&n.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const a=globalThis.process;if(a){const s=a.versions;if(s&&s.node){const l=s.node,u=parseInt(l.replace(/^v/,"").split(".")[0]);return u>=22?typeof globalThis.WebSocket<"u"?{type:"native",wsConstructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${u} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${u} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
65
|
+
import ws from "ws"
|
|
66
|
+
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let n=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(n+=`
|
|
67
|
+
|
|
68
|
+
Suggested solution: ${e.workaround}`),new Error(n)}static isWebSocketSupported(){try{const e=this.detectEnvironment();return e.type==="native"||e.type==="ws"}catch{return!1}}}const R8="2.108.2",k8=`realtime-js/${R8}`,D8="1.0.0",V4="2.0.0",P8=V4,M8=1e4,I8=100,_u={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},G4={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Rv={connecting:"connecting",closing:"closing",closed:"closed"};class F8{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,n){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(e));let r=[e.join_ref,e.ref,e.topic,e.event,e.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(e){var n;return this._isArrayBuffer((n=e.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var n,r;const a=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,a)}_encodeJsonUserBroadcastPush(e){var n,r;const a=(r=(n=e.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},l=new TextEncoder().encode(JSON.stringify(a)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,l)}_encodeUserBroadcastPush(e,n,r){var a,s;const l=e.topic,u=(a=e.ref)!==null&&a!==void 0?a:"",c=(s=e.join_ref)!==null&&s!==void 0?s:"",h=e.payload.event,d=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},m=Object.keys(d).length===0?"":JSON.stringify(d);if(c.length>255)throw new Error(`joinRef length ${c.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`ref length ${u.length} exceeds maximum of 255`);if(l.length>255)throw new Error(`topic length ${l.length} exceeds maximum of 255`);if(h.length>255)throw new Error(`userEvent length ${h.length} exceeds maximum of 255`);if(m.length>255)throw new Error(`metadata length ${m.length} exceeds maximum of 255`);const y=this.USER_BROADCAST_PUSH_META_LENGTH+c.length+u.length+l.length+h.length+m.length,g=new ArrayBuffer(this.HEADER_LENGTH+y);let x=new DataView(g),_=0;x.setUint8(_++,this.KINDS.userBroadcastPush),x.setUint8(_++,c.length),x.setUint8(_++,u.length),x.setUint8(_++,l.length),x.setUint8(_++,h.length),x.setUint8(_++,m.length),x.setUint8(_++,n),Array.from(c,A=>x.setUint8(_++,A.charCodeAt(0))),Array.from(u,A=>x.setUint8(_++,A.charCodeAt(0))),Array.from(l,A=>x.setUint8(_++,A.charCodeAt(0))),Array.from(h,A=>x.setUint8(_++,A.charCodeAt(0))),Array.from(m,A=>x.setUint8(_++,A.charCodeAt(0)));var N=new Uint8Array(g.byteLength+r.byteLength);return N.set(new Uint8Array(g),0),N.set(new Uint8Array(r),g.byteLength),N.buffer}decode(e,n){if(this._isArrayBuffer(e)){let r=this._binaryDecode(e);return n(r)}if(typeof e=="string"){const r=JSON.parse(e),[a,s,l,u,c]=r;return n({join_ref:a,ref:s,topic:l,event:u,payload:c})}return n({})}_binaryDecode(e){const n=new DataView(e),r=n.getUint8(0),a=new TextDecoder;switch(r){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,n,a)}}_decodeUserBroadcast(e,n,r){const a=n.getUint8(1),s=n.getUint8(2),l=n.getUint8(3),u=n.getUint8(4);let c=this.HEADER_LENGTH+4;const h=r.decode(e.slice(c,c+a));c=c+a;const d=r.decode(e.slice(c,c+s));c=c+s;const m=r.decode(e.slice(c,c+l));c=c+l;const y=e.slice(c,e.byteLength),g=u===this.JSON_ENCODING?JSON.parse(r.decode(y)):y,x={type:this.BROADCAST_EVENT,event:d,payload:g};return l>0&&(x.meta=JSON.parse(m)),{join_ref:null,ref:null,topic:h,event:this.BROADCAST_EVENT,payload:x}}_isArrayBuffer(e){var n;return e instanceof ArrayBuffer||((n=e==null?void 0:e.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(e,n){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([r])=>n.includes(r)))}}var mr;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.tsrange="tsrange",t.tstzrange="tstzrange"})(mr||(mr={}));const Aw=(t,e,n={})=>{var r;const a=(r=n.skipTypes)!==null&&r!==void 0?r:[];return e?Object.keys(e).reduce((s,l)=>(s[l]=U8(l,t,e,a),s),{}):{}},U8=(t,e,n,r)=>{const a=e.find(u=>u.name===t),s=a==null?void 0:a.type,l=n[t];return s&&!r.includes(s)?W4(s,l):kv(l)},W4=(t,e)=>{if(t.charAt(0)==="_"){const n=t.slice(1,t.length);return q8(e,n)}switch(t){case mr.bool:return B8(e);case mr.float4:case mr.float8:case mr.int2:case mr.int4:case mr.int8:case mr.numeric:case mr.oid:return $8(e);case mr.json:case mr.jsonb:return z8(e);case mr.timestamp:return H8(e);case mr.abstime:case mr.date:case mr.daterange:case mr.int4range:case mr.int8range:case mr.money:case mr.reltime:case mr.text:case mr.time:case mr.timestamptz:case mr.timetz:case mr.tsrange:case mr.tstzrange:return kv(e);default:return kv(e)}},kv=t=>t,B8=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},$8=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},z8=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},q8=(t,e)=>{if(typeof t!="string")return t;const n=t.length-1,r=t[n];if(t[0]==="{"&&r==="}"){let s;const l=t.slice(1,n);try{s=JSON.parse("["+l+"]")}catch{s=l?l.split(","):[]}return s.map(u=>W4(e,u))}return t},H8=t=>typeof t=="string"?t.replace(" ","T"):t,Y4=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var Qh=t=>typeof t=="function"?t:function(){return t},V8=typeof self<"u"?self:null,Sf=typeof window<"u"?window:null,ko=V8||Sf||globalThis,G8="2.0.0",W8=1e4,Y8=1e3,Do={connecting:0,open:1,closing:2,closed:3},Fi={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Ll={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},Dv={longpoll:"longpoll",websocket:"websocket"},K8={complete:4},Pv="base64url.bearer.phx.",Fp=class{constructor(t,e,n,r){this.channel=t,this.event=e,this.payload=n||function(){return{}},this.receivedResp=null,this.timeout=r,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},K4=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},J8=class{constructor(t,e,n){this.state=Fi.closed,this.topic=t,this.params=Qh(e||{}),this.socket=n,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Fp(this,Ll.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new K4(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Fi.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this.joinPush.receive("error",r=>{this.state=Fi.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Fi.closed,this.socket.remove(this)}),this.onError(r=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,r),this.isJoining()&&this.joinPush.reset(),this.state=Fi.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Fp(this,Ll.leave,Qh({}),this.timeout).send(),this.state=Fi.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Ll.reply,(r,a)=>{this.trigger(this.replyEventName(a),r)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Fi.closed,this.bindings=[]}onClose(t){this.on(Ll.close,t)}onError(t){return this.on(Ll.error,e=>t(e))}on(t,e){let n=this.bindingRef++;return this.bindings.push({event:t,ref:n,callback:e}),n}off(t,e){this.bindings=this.bindings.filter(n=>!(n.event===t&&(typeof e>"u"||e===n.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,n=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let r=new Fp(this,t,function(){return e},n);return this.canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Fi.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Ll.close,"leave")},n=new Fp(this,Ll.leave,Qh({}),t);return n.receive("ok",()=>e()).receive("timeout",()=>e()),n.send(),this.canPush()||n.trigger("ok",{}),n}onMessage(t,e,n){return e}filterBindings(t,e,n){return!0}isMember(t,e,n,r){return this.topic!==t?!1:r&&r!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:n,joinRef:r}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Fi.joining,this.joinPush.resend(t))}trigger(t,e,n,r){let a=this.onMessage(t,e,n,r);if(e&&!a)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let s=this.bindings.filter(l=>l.event===t&&this.filterBindings(l,e,n));for(let l=0;l<s.length;l++)s[l].callback(a,n,r||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Fi.closed}isErrored(){return this.state===Fi.errored}isJoined(){return this.state===Fi.joined}isJoining(){return this.state===Fi.joining}isLeaving(){return this.state===Fi.leaving}},Fm=class{static request(t,e,n,r,a,s,l){if(ko.XDomainRequest){let u=new ko.XDomainRequest;return this.xdomainRequest(u,t,e,r,a,s,l)}else if(ko.XMLHttpRequest){let u=new ko.XMLHttpRequest;return this.xhrRequest(u,t,e,n,r,a,s,l)}else{if(ko.fetch&&ko.AbortController)return this.fetchRequest(t,e,n,r,a,s,l);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,n,r,a,s,l){let u={method:t,headers:n,body:r},c=null;return a&&(c=new AbortController,setTimeout(()=>c.abort(),a),u.signal=c.signal),ko.fetch(e,u).then(h=>h.text()).then(h=>this.parseJSON(h)).then(h=>l&&l(h)).catch(h=>{h.name==="AbortError"&&s?s():l&&l(null)}),c}static xdomainRequest(t,e,n,r,a,s,l){return t.timeout=a,t.open(e,n),t.onload=()=>{let u=this.parseJSON(t.responseText);l&&l(u)},s&&(t.ontimeout=s),t.onprogress=()=>{},t.send(r),t}static xhrRequest(t,e,n,r,a,s,l,u){t.open(e,n,!0),t.timeout=s;for(let[c,h]of Object.entries(r))t.setRequestHeader(c,h);return t.onerror=()=>u&&u(null),t.onreadystatechange=()=>{if(t.readyState===K8.complete&&u){let c=this.parseJSON(t.responseText);u(c)}},l&&(t.ontimeout=l),t.send(a),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let n=[];for(var r in t){if(!Object.prototype.hasOwnProperty.call(t,r))continue;let a=e?`${e}[${r}]`:r,s=t[r];typeof s=="object"?n.push(this.serialize(s,a)):n.push(encodeURIComponent(a)+"="+encodeURIComponent(s))}return n.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let n=t.match(/\?/)?"&":"?";return`${t}${n}${this.serialize(e)}`}},X8=t=>{let e="",n=new Uint8Array(t),r=n.byteLength;for(let a=0;a<r;a++)e+=String.fromCharCode(n[a]);return btoa(e)},of=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(Pv)&&(this.authToken=atob(e[1].slice(Pv.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){},this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=Do.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+Dv.websocket),"$1/"+Dv.longpoll)}endpointURL(){return Fm.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,n){this.close(t,e,n),this.readyState=Do.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===Do.open||this.readyState===Do.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:n,token:r,messages:a}=e;if(n===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=r}else n=0;switch(n){case 200:a.forEach(s=>{setTimeout(()=>this.onmessage({data:s}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=Do.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${n}`)}})}send(t){typeof t!="string"&&(t=X8(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
|
|
69
|
+
`),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,n){for(let a of this.reqs)a.abort();this.readyState=Do.closed;let r=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:n});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",r)):this.onclose(r)}ajax(t,e,n,r,a){let s,l=()=>{this.reqs.delete(s),r()};s=Fm.request(t,this.endpointURL(),e,n,this.timeout,l,u=>{this.reqs.delete(s),this.isActive()&&a(u)}),this.reqs.add(s)}},Z8=class Yh{constructor(e,n={}){let r=n.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(r.state,a=>{let{onJoin:s,onLeave:l,onSync:u}=this.caller;this.joinRef=this.channel.joinRef(),this.state=Yh.syncState(this.state,a,s,l),this.pendingDiffs.forEach(c=>{this.state=Yh.syncDiff(this.state,c,s,l)}),this.pendingDiffs=[],u()}),this.channel.on(r.diff,a=>{let{onJoin:s,onLeave:l,onSync:u}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(a):(this.state=Yh.syncDiff(this.state,a,s,l),u())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return Yh.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,n,r,a){let s=this.clone(e),l={},u={};return this.map(s,(c,h)=>{n[c]||(u[c]=h)}),this.map(n,(c,h)=>{let d=s[c];if(d){let m=h.metas.map(_=>_.phx_ref),y=d.metas.map(_=>_.phx_ref),g=h.metas.filter(_=>y.indexOf(_.phx_ref)<0),x=d.metas.filter(_=>m.indexOf(_.phx_ref)<0);g.length>0&&(l[c]=h,l[c].metas=g),x.length>0&&(u[c]=this.clone(d),u[c].metas=x)}else l[c]=h}),this.syncDiff(s,{joins:l,leaves:u},r,a)}static syncDiff(e,n,r,a){let{joins:s,leaves:l}=this.clone(n);return r||(r=function(){}),a||(a=function(){}),this.map(s,(u,c)=>{let h=e[u];if(e[u]=this.clone(c),h){let d=e[u].metas.map(y=>y.phx_ref),m=h.metas.filter(y=>d.indexOf(y.phx_ref)<0);e[u].metas.unshift(...m)}r(u,h,c)}),this.map(l,(u,c)=>{let h=e[u];if(!h)return;let d=c.metas.map(m=>m.phx_ref);h.metas=h.metas.filter(m=>d.indexOf(m.phx_ref)<0),a(u,h,c),h.metas.length===0&&delete e[u]}),e}static list(e,n){return n||(n=function(r,a){return a}),this.map(e,(r,a)=>n(r,a))}static map(e,n){return Object.getOwnPropertyNames(e).map(r=>n(r,e[r]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Up={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let n=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(n))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[n,r,a,s,l]=JSON.parse(t);return e({join_ref:n,ref:r,topic:a,event:s,payload:l})}},binaryEncode(t){let{join_ref:e,ref:n,event:r,topic:a,payload:s}=t,l=this.META_LENGTH+e.length+n.length+a.length+r.length,u=new ArrayBuffer(this.HEADER_LENGTH+l),c=new DataView(u),h=0;c.setUint8(h++,this.KINDS.push),c.setUint8(h++,e.length),c.setUint8(h++,n.length),c.setUint8(h++,a.length),c.setUint8(h++,r.length),Array.from(e,m=>c.setUint8(h++,m.charCodeAt(0))),Array.from(n,m=>c.setUint8(h++,m.charCodeAt(0))),Array.from(a,m=>c.setUint8(h++,m.charCodeAt(0))),Array.from(r,m=>c.setUint8(h++,m.charCodeAt(0)));var d=new Uint8Array(u.byteLength+s.byteLength);return d.set(new Uint8Array(u),0),d.set(new Uint8Array(s),u.byteLength),d.buffer},binaryDecode(t){let e=new DataView(t),n=e.getUint8(0),r=new TextDecoder;switch(n){case this.KINDS.push:return this.decodePush(t,e,r);case this.KINDS.reply:return this.decodeReply(t,e,r);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,r)}},decodePush(t,e,n){let r=e.getUint8(1),a=e.getUint8(2),s=e.getUint8(3),l=this.HEADER_LENGTH+this.META_LENGTH-1,u=n.decode(t.slice(l,l+r));l=l+r;let c=n.decode(t.slice(l,l+a));l=l+a;let h=n.decode(t.slice(l,l+s));l=l+s;let d=t.slice(l,t.byteLength);return{join_ref:u,ref:null,topic:c,event:h,payload:d}},decodeReply(t,e,n){let r=e.getUint8(1),a=e.getUint8(2),s=e.getUint8(3),l=e.getUint8(4),u=this.HEADER_LENGTH+this.META_LENGTH,c=n.decode(t.slice(u,u+r));u=u+r;let h=n.decode(t.slice(u,u+a));u=u+a;let d=n.decode(t.slice(u,u+s));u=u+s;let m=n.decode(t.slice(u,u+l));u=u+l;let y=t.slice(u,t.byteLength),g={status:m,response:y};return{join_ref:c,ref:h,topic:d,event:Ll.reply,payload:g}},decodeBroadcast(t,e,n){let r=e.getUint8(1),a=e.getUint8(2),s=this.HEADER_LENGTH+2,l=n.decode(t.slice(s,s+r));s=s+r;let u=n.decode(t.slice(s,s+a));s=s+a;let c=t.slice(s,t.byteLength);return{join_ref:null,ref:null,topic:l,event:u,payload:c}}},Q8=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||W8,this.transport=e.transport||ko.WebSocket||of,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let n=null;try{n=ko&&ko.sessionStorage}catch{}this.sessionStore=e.sessionStorage||n,this.establishedConnections=0,this.defaultEncoder=Up.encode.bind(Up),this.defaultDecoder=Up.decode.bind(Up),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==of?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let r=null;Sf&&Sf.addEventListener&&(Sf.addEventListener("pagehide",a=>{this.conn&&(this.disconnect(),r=this.connectClock)}),Sf.addEventListener("pageshow",a=>{r===this.connectClock&&(r=null,this.connect())}),Sf.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=a=>e.rejoinAfterMs?e.rejoinAfterMs(a):[1e3,2e3,5e3][a-1]||1e4,this.reconnectAfterMs=a=>e.reconnectAfterMs?e.reconnectAfterMs(a):[10,50,100,150,200,250,500,1e3,2e3][a-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(a,s,l)=>{console.log(`${a}: ${s}`,l)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Qh(e.params||{}),this.endPoint=`${t}/${Dv.websocket}`,this.vsn=e.vsn||G8,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new K4(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return of}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=Fm.appendParams(Fm.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,n){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,n)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Qh(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==of?this.connectWithFallback(of,this.longPollFallbackMs):this.transportConnect())}log(t,e,n){this.logger&&this.logger(t,e,n)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),n=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let r=this.onMessage(a=>{a.ref===e&&(this.off([r]),t(Date.now()-n))});return!0}transportName(t){switch(t){case of:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${Pv}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let n=!1,r=!0,a,s,l=this.transportName(t),u=c=>{this.log("transport",`falling back to ${l}...`,c),this.off([a,s]),r=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${l}`))return u("memorized");this.fallbackTimer=setTimeout(u,e),s=this.onError(c=>{this.log("transport","error",c),r&&!n&&(clearTimeout(this.fallbackTimer),u(c))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(n=!0,!r){let c=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${c}`,"true"),this.log("transport",`established ${c} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(u,e),this.ping(c=>{this.log("transport","connected to primary after",c),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),Y8,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,n){if(!this.conn)return t&&t();const r=this.conn;this.waitForBufferDone(r,()=>{e?r.close(e,n||""):r.close(),this.waitForSocketClosed(r,()=>{this.conn===r&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,n=1){if(n===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,n+1)},150*n)}waitForSocketClosed(t,e,n=1){if(n===5||t.readyState===Do.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,n+1)},150*n)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,n=this.establishedConnections;this.triggerStateCallbacks("error",t,e,n),(e===this.transport||n>0)&&this.triggerChanError(t)}triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Ll.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case Do.connecting:return"connecting";case Do.open:return"open";case Do.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([n])=>t.indexOf(n)===-1)}channel(t,e={}){let n=new J8(t,e,this);return this.channels.push(n),n}push(t){if(this.hasLogger()){let{topic:e,event:n,payload:r,ref:a,join_ref:s}=t;this.log("push",`${e} ${n} (${s}, ${a})`,r)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:n,event:r,payload:a,ref:s,join_ref:l}=e;if(s&&s===this.pendingHeartbeatRef){const u=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(a.status==="ok"?"ok":"error",u)}catch(c){this.log("error","error in heartbeat callback",c)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${a.status||""} ${n} ${r} ${s&&"("+s+")"||""}`.trim(),a);for(let u=0;u<this.channels.length;u++){const c=this.channels[u];c.isMember(n,r,a,l)&&c.trigger(r,a,s,l)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([n,r])=>{try{r(...e)}catch(a){this.log("error",`error in ${t} callback`,a)}})}catch(n){this.log("error",`error triggering ${t} callbacks`,n)}}leaveOpenTopic(t){let e=this.channels.find(n=>n.topic===t&&(n.isJoined()||n.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class ed{constructor(e,n){const r=tL(n);this.presence=new Z8(e.getChannel(),r),this.presence.onJoin((a,s,l)=>{const u=ed.onJoinPayload(a,s,l);e.getChannel().trigger("presence",u)}),this.presence.onLeave((a,s,l)=>{const u=ed.onLeavePayload(a,s,l);e.getChannel().trigger("presence",u)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return ed.transformState(this.presence.state)}static transformState(e){return e=eL(e),Object.getOwnPropertyNames(e).reduce((n,r)=>{const a=e[r];return n[r]=xm(a),n},{})}static onJoinPayload(e,n,r){const a=Nw(n),s=xm(r);return{event:"join",key:e,currentPresences:a,newPresences:s}}static onLeavePayload(e,n,r){const a=Nw(n),s=xm(r);return{event:"leave",key:e,currentPresences:a,leftPresences:s}}}function xm(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function eL(t){return JSON.parse(JSON.stringify(t))}function tL(t){return(t==null?void 0:t.events)&&{events:t.events}}function Nw(t){return t!=null&&t.metas?xm(t):[]}var Cw;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(Cw||(Cw={}));class nL{get state(){return this.presenceAdapter.state}constructor(e,n){this.channel=e,this.presenceAdapter=new ed(this.channel.channelAdapter,n)}}function rL(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){const e=t;if(typeof e.code=="number"){const n=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${n}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}class aL{constructor(e,n,r){const a=iL(r);this.channel=e.getSocket().channel(n,a),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,n){return this.channel.on(e,n)}off(e,n){this.channel.off(e,n)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,n,r){let a;try{a=this.channel.push(e,n,r)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>I8){const s=this.channel.pushBuffer.shift();s.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${s.event}`,s.payload())}return a}updateJoinPayload(e){const n=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},n),e)}canPush(){return this.socket.isConnected()&&this.state===_u.joined}isJoined(){return this.state===_u.joined}isJoining(){return this.state===_u.joining}isClosed(){return this.state===_u.closed}isLeaving(){return this.state===_u.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function iL(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}var Tw;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(Tw||(Tw={}));var Cf;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(Cf||(Cf={}));var jl;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(jl||(jl={}));class td{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,n={config:{}},r){var a,s;if(this.topic=e,this.params=n,this.socket=r,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.channelAdapter=new aL(this.socket.socketAdapter,e,this.params),this.presence=new nL(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=Y4(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((s=(a=this.params.config)===null||a===void 0?void 0:a.broadcast)===null||s===void 0)&&s.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,n=this.timeout){var r,a,s;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:l,presence:u,private:c}}=this.params,h=(a=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(g=>g.filter))!==null&&a!==void 0?a:[],d=!!this.bindings[Cf.PRESENCE]&&this.bindings[Cf.PRESENCE].length>0||((s=this.params.config.presence)===null||s===void 0?void 0:s.enabled)===!0,m={},y={broadcast:l,presence:Object.assign(Object.assign({},u),{enabled:d}),postgres_changes:h,private:c};this.socket.accessTokenValue&&(m.access_token=this.socket.accessTokenValue),this._onError(g=>{e==null||e(jl.CHANNEL_ERROR,rL(g))}),this._onClose(()=>e==null?void 0:e(jl.CLOSED)),this.updateJoinPayload(Object.assign({config:y},m)),this._updateFilterMessage(),this.channelAdapter.subscribe(n).receive("ok",async({postgres_changes:g})=>{if(this.socket._isManualToken()||this.socket.setAuth(),g===void 0){e==null||e(jl.SUBSCRIBED);return}this._updatePostgresBindings(g,e)}).receive("error",g=>{this.state=_u.errored;const x=Object.values(g).join(", ")||"error";e==null||e(jl.CHANNEL_ERROR,new Error(x,{cause:g}))}).receive("timeout",()=>{e==null||e(jl.TIMED_OUT)})}return this}_updatePostgresBindings(e,n){var r;const a=this.bindings.postgres_changes,s=(r=a==null?void 0:a.length)!==null&&r!==void 0?r:0,l=[];for(let u=0;u<s;u++){const c=a[u],{filter:{event:h,schema:d,table:m,filter:y}}=c,g=e&&e[u];if(g&&g.event===h&&td.isFilterValueEqual(g.schema,d)&&td.isFilterValueEqual(g.table,m)&&td.isFilterValueEqual(g.filter,y))l.push(Object.assign(Object.assign({},c),{id:g.id}));else{this.unsubscribe(),this.state=_u.errored,n==null||n(jl.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=l,this.state!=_u.errored&&n&&n(jl.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,n={}){return await this.send({type:"presence",event:"track",payload:e},n.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,n,r){const a=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),s=e===Cf.PRESENCE||e===Cf.POSTGRES_CHANGES;if(a&&s)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,n,r)}async httpSend(e,n,r={}){var a;if(n==null)return Promise.reject(new Error("Payload is required for httpSend()"));const s=n instanceof ArrayBuffer||ArrayBuffer.isView(n),l={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":s?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(l.Authorization=`Bearer ${this.socket.accessTokenValue}`);const u=new URL(this.broadcastEndpointURL);u.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&u.searchParams.set("private","true");const c={method:"POST",headers:l,body:s?n:JSON.stringify(n)},h=await this._fetchWithTimeout(u.toString(),c,(a=r.timeout)!==null&&a!==void 0?a:this.timeout);if(h.status===202)return{success:!0};if(h.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let d=h.statusText;try{const m=await h.json();d=m.error||m.message||d}catch{}return Promise.reject(new Error(d))}async send(e,n={}){var r,a;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:s,payload:l}=e,u={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(u.Authorization=`Bearer ${this.socket.accessTokenValue}`);const c={method:"POST",headers:u,body:JSON.stringify({messages:[{topic:this.subTopic,event:s,payload:l,private:this.private}]})};try{const h=await this._fetchWithTimeout(this.broadcastEndpointURL,c,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((a=h.body)===null||a===void 0?void 0:a.cancel()),h.ok?"ok":"error"}catch(h){return h instanceof Error&&h.name==="AbortError"?"timed out":"error"}}else return new Promise(s=>{var l,u,c;const h=this.channelAdapter.push(e.type,e,n.timeout||this.timeout);e.type==="broadcast"&&!(!((c=(u=(l=this.params)===null||l===void 0?void 0:l.config)===null||u===void 0?void 0:u.broadcast)===null||c===void 0)&&c.ack)&&s("ok"),h.receive("ok",()=>s("ok")),h.receive("error",()=>s("error")),h.receive("timeout",()=>s("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(n=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>n("ok")).receive("timeout",()=>n("timed out")).receive("error",()=>n("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,n,r){const a=new AbortController,s=setTimeout(()=>a.abort(),r),l=await this.socket.fetch(e,Object.assign(Object.assign({},n),{signal:a.signal}));return clearTimeout(s),l}_on(e,n,r){const a=e.toLocaleLowerCase(),s=this.channelAdapter.on(e,r),l={type:a,filter:n,callback:r,ref:s};return this.bindings[a]?this.bindings[a].push(l):this.bindings[a]=[l],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,n,r)=>{var a,s,l,u,c,h,d;const m=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(m,r))return!1;const y=(a=this.bindings[m])===null||a===void 0?void 0:a.find(g=>g.ref===e.ref);if(!y)return!0;if(["broadcast","presence","postgres_changes"].includes(m))if("id"in y){const g=y.id,x=(s=y.filter)===null||s===void 0?void 0:s.event;return g&&((l=n.ids)===null||l===void 0?void 0:l.includes(g))&&(x==="*"||(x==null?void 0:x.toLocaleLowerCase())===((u=n.data)===null||u===void 0?void 0:u.type.toLocaleLowerCase()))}else{const g=(h=(c=y==null?void 0:y.filter)===null||c===void 0?void 0:c.event)===null||h===void 0?void 0:h.toLocaleLowerCase();return g==="*"||g===((d=n==null?void 0:n.event)===null||d===void 0?void 0:d.toLocaleLowerCase())}else return y.type.toLocaleLowerCase()===m})}_notThisChannelEvent(e,n){const{close:r,error:a,leave:s,join:l}=G4;return n&&[r,a,s,l].includes(e)&&n!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,n,r)=>{if(typeof n=="object"&&"ids"in n){const a=n.data,{schema:s,table:l,commit_timestamp:u,type:c,errors:h}=a;return Object.assign(Object.assign({},{schema:s,table:l,commit_timestamp:u,eventType:c,new:{},old:{},errors:h}),this._getPayloadRecords(a))}return n})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const n in e.bindings)for(const r of e.bindings[n])this._on(r.type,r.filter,r.callback)}static isFilterValueEqual(e,n){return(e??void 0)===(n??void 0)}_getPayloadRecords(e){const n={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(n.new=Aw(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(n.old=Aw(e.columns,e.old_record)),n}}class sL{constructor(e,n){this.socket=new Q8(e,n)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,n,r,a=1e4){return new Promise(s=>{setTimeout(()=>s("timeout"),a),this.socket.disconnect(()=>{e(),s("ok")},n,r)})}push(e){this.socket.push(e)}log(e,n,r){this.socket.log(e,n,r)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Rv.connecting}isDisconnecting(){return this.socket.connectionState()==Rv.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const Lw={HEARTBEAT_INTERVAL:25e3},oL=[1e3,2e3,5e3,1e4],lL=1e4;function uL(){const t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var n;return(n=Array.from(t.keys())[e])!==null&&n!==void 0?n:null},removeItem(e){t.delete(e)},setItem(e,n){t.set(e,String(n))}}}function cL(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return uL()}const fL=`
|
|
70
|
+
addEventListener("message", (e) => {
|
|
71
|
+
if (e.data.event === "start") {
|
|
72
|
+
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
73
|
+
}
|
|
74
|
+
});`;class hL{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,n){var r;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={},this.ref=0,this.serializer=new F8,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=s=>s?(...l)=>s(...l):(...l)=>fetch(...l),!(!((r=n==null?void 0:n.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey;const a=this._initializeOptions(n);this.socketAdapter=new sL(e,a),this.httpEndpoint=Y4(e),this.fetch=this._resolveFetch(n==null?void 0:n.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const n=e.message;throw n.includes("Node.js")?new Error(`${n}
|
|
75
|
+
|
|
76
|
+
To use Realtime in Node.js, you need to provide a WebSocket implementation:
|
|
77
|
+
|
|
78
|
+
Option 1: Use Node.js 22+ which has native WebSocket support
|
|
79
|
+
Option 2: Install and provide the "ws" package:
|
|
80
|
+
|
|
81
|
+
npm install ws
|
|
82
|
+
|
|
83
|
+
import ws from "ws"
|
|
84
|
+
const client = new RealtimeClient(url, {
|
|
85
|
+
...options,
|
|
86
|
+
transport: ws
|
|
87
|
+
})`):new Error(`WebSocket not available: ${n}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,n){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,n)}getChannels(){return this.channels}async removeChannel(e){const n=await e.unsubscribe();return n==="ok"&&e.teardown(),n}async removeAllChannels(){const e=this.channels.map(async r=>{const a=await r.unsubscribe();return r.teardown(),a}),n=await Promise.all(e);return await this.disconnect(),n}log(e,n,r){this.socketAdapter.log(e,n,r)}connectionState(){return this.socketAdapter.connectionState()||Rv.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,n={config:{}}){const r=`realtime:${e}`,a=this.getChannels().find(s=>s.topic===r);if(a)return a;{const s=new td(`realtime:${e}`,n,this);return this._cancelPendingDisconnect(),this.channels.push(s),s}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(n=>n.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let n,r=!1;if(e)n=e,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(a){this.log("error","Error fetching access token from callback",a),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(a=>{const s={access_token:n,version:k8};n&&a.updateJoinPayload(s),a.joinedOnce&&a.channelAdapter.isJoined()&&a.channelAdapter.push(G4.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${e}`,n)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(n=>{this.log("error","error waiting for auth on connect",n)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(n,r)=>{n=="sent"&&this._setAuthSafely(),e&&e(n,r)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let n;if(e)n=e;else{const r=new Blob([fL],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_initializeOptions(e){var n,r,a,s,l,u,c,h,d,m,y,g;this.worker=(n=e==null?void 0:e.worker)!==null&&n!==void 0?n:!1,this.accessToken=(r=e==null?void 0:e.accessToken)!==null&&r!==void 0?r:null;const x={};x.timeout=(a=e==null?void 0:e.timeout)!==null&&a!==void 0?a:M8,x.heartbeatIntervalMs=(s=e==null?void 0:e.heartbeatIntervalMs)!==null&&s!==void 0?s:Lw.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(l=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&l!==void 0?l:2*((u=e==null?void 0:e.heartbeatIntervalMs)!==null&&u!==void 0?u:Lw.HEARTBEAT_INTERVAL),x.transport=(c=e==null?void 0:e.transport)!==null&&c!==void 0?c:O8.getWebSocketConstructor(),x.params=e==null?void 0:e.params,x.logger=e==null?void 0:e.logger,x.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),x.sessionStorage=(h=e==null?void 0:e.sessionStorage)!==null&&h!==void 0?h:cL(),x.reconnectAfterMs=(d=e==null?void 0:e.reconnectAfterMs)!==null&&d!==void 0?d:(j=>oL[j-1]||lL);let _,N;const A=(m=e==null?void 0:e.vsn)!==null&&m!==void 0?m:P8;switch(A){case D8:_=(j,L)=>L(JSON.stringify(j)),N=(j,L)=>L(JSON.parse(j));break;case V4:_=this.serializer.encode.bind(this.serializer),N=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${x.vsn}`)}if(x.vsn=A,x.encode=(y=e==null?void 0:e.encode)!==null&&y!==void 0?y:_,x.decode=(g=e==null?void 0:e.decode)!==null&&g!==void 0?g:N,x.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,x.params=Object.assign(Object.assign({},x.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,x.autoSendHeartbeat=!this.worker}return x}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}var fd=class extends Error{constructor(t,e){var n;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((n=e.icebergType)==null?void 0:n.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function dL(t,e,n){const r=new URL(e,t);if(n)for(const[a,s]of Object.entries(n))s!==void 0&&r.searchParams.set(a,s);return r.toString()}async function pL(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function mL(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:a,body:s,headers:l}){const u=dL(t.baseUrl,r,a),c=await pL(t.auth),h=await e(u,{method:n,headers:{...s?{"Content-Type":"application/json"}:{},...c,...l},body:s?JSON.stringify(s):void 0}),d=await h.text(),m=(h.headers.get("content-type")||"").includes("application/json"),y=m&&d?JSON.parse(d):d;if(!h.ok){const g=m?y:void 0,x=g==null?void 0:g.error;throw new fd((x==null?void 0:x.message)??`Request failed with status ${h.status}`,{status:h.status,icebergType:x==null?void 0:x.type,icebergCode:x==null?void 0:x.code,details:g})}return{status:h.status,headers:h.headers,data:y}}}}function Bp(t){return t.join("")}var gL=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:Bp(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(t,e){const n={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Bp(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Bp(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Bp(t.namespace)}`}),!0}catch(e){if(e instanceof fd&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(n){if(n instanceof fd&&n.status===409)return;throw n}}};function lf(t){return t.join("")}var vL=class{constructor(t,e="",n){this.client=t,this.prefix=e,this.accessDelegation=n}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${lf(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${lf(t.namespace)}/tables`,body:e,headers:n})).data.metadata}async updateTable(t,e){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${lf(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${lf(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${lf(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${lf(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(n){if(n instanceof fd&&n.status===404)return!1;throw n}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(n){if(n instanceof fd&&n.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw n}}},yL=class{constructor(t){var r;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const n=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=mL({baseUrl:n,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(r=t.accessDelegation)==null?void 0:r.join(","),this.namespaceOps=new gL(this.client,e),this.tableOps=new vL(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function hd(t){"@babel/helpers - typeof";return hd=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},hd(t)}function bL(t,e){if(hd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(hd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function wL(t){var e=bL(t,"string");return hd(e)=="symbol"?e:e+""}function xL(t,e,n){return(e=wL(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function jw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function Wt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?jw(Object(n),!0).forEach(function(r){xL(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):jw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var _g=class extends Error{constructor(t,e="storage",n,r){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=n,this.statusCode=r}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Eg(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var Mv=class extends _g{constructor(t,e,n,r="storage"){super(t,r,e,n),this.name=r==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=n}toJSON(){return Wt({},super.toJSON())}},J4=class extends _g{constructor(t,e,n="storage"){super(t,n),this.name=n==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function Um(t,e,n){const r=Wt({},t),a=e.toLowerCase();for(const s of Object.keys(r))s.toLowerCase()===a&&delete r[s];return r[a]=n,r}function SL(t){const e={};for(const[n,r]of Object.entries(t))e[n.toLowerCase()]=r;return e}const _L=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),EL=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},Iv=t=>{if(Array.isArray(t))return t.map(n=>Iv(n));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([n,r])=>{const a=n.replace(/([-_][a-z])/gi,s=>s.toUpperCase().replace(/[-_]/g,""));e[a]=Iv(r)}),e},AL=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),Ow=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const n=e.error;if(typeof n.message=="string")return n.message}}return JSON.stringify(t)},NL=async(t,e,n,r)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const a=t;let s=parseInt(String(a.status),10);Number.isFinite(s)||(s=500),a.json().then(l=>{const u=(l==null?void 0:l.statusCode)||(l==null?void 0:l.code)||s+"";e(new Mv(Ow(l),s,u,r))}).catch(()=>{const l=s+"";e(new Mv(a.statusText||`HTTP ${s} error`,s,l,r))})}else e(new J4(Ow(t),t,r))},CL=(t,e,n,r)=>{const a={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!r)return Wt(Wt({},a),n);if(EL(r)){var s;const l=(e==null?void 0:e.headers)||{};let u;for(const[c,h]of Object.entries(l))c.toLowerCase()==="content-type"&&(u=h);a.headers=Um(l,"Content-Type",(s=u)!==null&&s!==void 0?s:"application/json"),a.body=JSON.stringify(r)}else a.body=r;return e!=null&&e.duplex&&(a.duplex=e.duplex),Wt(Wt({},a),n)};async function Fh(t,e,n,r,a,s,l){return new Promise((u,c)=>{t(n,CL(e,r,a,s)).then(h=>{if(!h.ok)throw h;if(r!=null&&r.noResolveJson)return h;if(l==="vectors"){const d=h.headers.get("content-type");if(h.headers.get("content-length")==="0"||h.status===204)return{};if(!d||!d.includes("application/json"))return{}}return h.json()}).then(h=>u(h)).catch(h=>NL(h,c,r,l))})}function X4(t="storage"){return{get:async(e,n,r,a)=>Fh(e,"GET",n,r,a,void 0,t),post:async(e,n,r,a,s)=>Fh(e,"POST",n,a,s,r,t),put:async(e,n,r,a,s)=>Fh(e,"PUT",n,a,s,r,t),head:async(e,n,r,a)=>Fh(e,"HEAD",n,Wt(Wt({},r),{},{noResolveJson:!0}),a,void 0,t),remove:async(e,n,r,a,s)=>Fh(e,"DELETE",n,a,s,r,t)}}const TL=X4("storage"),{get:dd,post:Xs,put:Fv,head:LL,remove:qy}=TL,as=X4("vectors");var Wf=class{constructor(t,e={},n,r="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=SL(e),this.fetch=_L(n),this.namespace=r}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=Um(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(n){if(e.shouldThrowOnError)throw n;if(Eg(n))return{data:null,error:n};throw n}}};let Z4;Z4=Symbol.toStringTag;var jL=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[Z4]="StreamDownloadBuilder",this.promise=null}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Eg(e))return{data:null,error:e};throw e}}};let Q4;Q4=Symbol.toStringTag;var OL=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[Q4]="BlobDownloadBuilder",this.promise=null}asStream(){return new jL(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Eg(e))return{data:null,error:e};throw e}}};const RL={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},Rw={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var kL=class extends Wf{constructor(t,e={},n,r){super(t,e,r,"storage"),this.bucketId=n}async uploadOrUpdate(t,e,n,r){var a=this;return a.handleOperation(async()=>{let s;const l=Wt(Wt({},Rw),r);let u=Wt(Wt({},a.headers),t==="POST"&&{"x-upsert":String(l.upsert)});const c=l.metadata;if(typeof Blob<"u"&&n instanceof Blob?(s=new FormData,s.append("cacheControl",l.cacheControl),c&&s.append("metadata",a.encodeMetadata(c)),s.append("",n)):typeof FormData<"u"&&n instanceof FormData?(s=n,s.has("cacheControl")||s.append("cacheControl",l.cacheControl),c&&!s.has("metadata")&&s.append("metadata",a.encodeMetadata(c))):(s=n,u["cache-control"]=`max-age=${l.cacheControl}`,u["content-type"]=l.contentType,c&&(u["x-metadata"]=a.toBase64(a.encodeMetadata(c))),(typeof ReadableStream<"u"&&s instanceof ReadableStream||s&&typeof s=="object"&&"pipe"in s&&typeof s.pipe=="function")&&!l.duplex&&(l.duplex="half")),r!=null&&r.headers)for(const[y,g]of Object.entries(r.headers))u=Um(u,y,g);const h=a._removeEmptyFolders(e),d=a._getFinalPath(h),m=await(t=="PUT"?Fv:Xs)(a.fetch,`${a.url}/object/${d}`,s,Wt({headers:u},l!=null&&l.duplex?{duplex:l.duplex}:{}));return{path:h,id:m.Id,fullPath:m.Key}})}async upload(t,e,n){return this.uploadOrUpdate("POST",t,e,n)}async uploadToSignedUrl(t,e,n,r){var a=this;const s=a._removeEmptyFolders(t),l=a._getFinalPath(s),u=new URL(a.url+`/object/upload/sign/${l}`);return u.searchParams.set("token",e),a.handleOperation(async()=>{let c;const h=Wt(Wt({},Rw),r);let d=Wt(Wt({},a.headers),{"x-upsert":String(h.upsert)});const m=h.metadata;if(typeof Blob<"u"&&n instanceof Blob?(c=new FormData,c.append("cacheControl",h.cacheControl),m&&c.append("metadata",a.encodeMetadata(m)),c.append("",n)):typeof FormData<"u"&&n instanceof FormData?(c=n,c.has("cacheControl")||c.append("cacheControl",h.cacheControl),m&&!c.has("metadata")&&c.append("metadata",a.encodeMetadata(m))):(c=n,d["cache-control"]=`max-age=${h.cacheControl}`,d["content-type"]=h.contentType,m&&(d["x-metadata"]=a.toBase64(a.encodeMetadata(m))),(typeof ReadableStream<"u"&&c instanceof ReadableStream||c&&typeof c=="object"&&"pipe"in c&&typeof c.pipe=="function")&&!h.duplex&&(h.duplex="half")),r!=null&&r.headers)for(const[y,g]of Object.entries(r.headers))d=Um(d,y,g);return{path:s,fullPath:(await Fv(a.fetch,u.toString(),c,Wt({headers:d},h!=null&&h.duplex?{duplex:h.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var n=this;return n.handleOperation(async()=>{let r=n._getFinalPath(t);const a=Wt({},n.headers);e!=null&&e.upsert&&(a["x-upsert"]="true");const s=await Xs(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:a}),l=new URL(n.url+s.url),u=l.searchParams.get("token");if(!u)throw new _g("No token returned by API");return{signedUrl:l.toString(),path:t,token:u}})}async update(t,e,n){return this.uploadOrUpdate("PUT",t,e,n)}async move(t,e,n){var r=this;return r.handleOperation(async()=>await Xs(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers}))}async copy(t,e,n){var r=this;return r.handleOperation(async()=>({path:(await Xs(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:t,destinationKey:e,destinationBucket:n==null?void 0:n.destinationBucket},{headers:r.headers})).Key}))}async createSignedUrl(t,e,n){var r=this;return r.handleOperation(async()=>{let a=r._getFinalPath(t);const s=typeof(n==null?void 0:n.transform)=="object"&&n.transform!==null&&Object.keys(n.transform).length>0;let l=await Xs(r.fetch,`${r.url}/object/sign/${a}`,Wt({expiresIn:e},s?{transform:n.transform}:{}),{headers:r.headers});const u=new URLSearchParams;n!=null&&n.download&&u.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&u.set("cacheNonce",String(n.cacheNonce));const c=u.toString();return{signedUrl:encodeURI(`${r.url}${l.signedURL}${c?`&${c}`:""}`)}})}async createSignedUrls(t,e,n){var r=this;return r.handleOperation(async()=>{const a=await Xs(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:e,paths:t},{headers:r.headers}),s=new URLSearchParams;n!=null&&n.download&&s.set("download",n.download===!0?"":n.download),(n==null?void 0:n.cacheNonce)!=null&&s.set("cacheNonce",String(n.cacheNonce));const l=s.toString();return a.map(u=>Wt(Wt({},u),{},{signedUrl:u.signedURL?encodeURI(`${r.url}${u.signedURL}${l?`&${l}`:""}`):null}))})}download(t,e,n){const r=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",a=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(a,e.transform),(e==null?void 0:e.cacheNonce)!=null&&a.set("cacheNonce",String(e.cacheNonce));const s=a.toString(),l=this._getFinalPath(t),u=()=>dd(this.fetch,`${this.url}/${r}/${l}${s?`?${s}`:""}`,{headers:this.headers,noResolveJson:!0},n);return new OL(u,this.shouldThrowOnError)}async info(t){var e=this;const n=e._getFinalPath(t);return e.handleOperation(async()=>Iv(await dd(e.fetch,`${e.url}/object/info/${n}`,{headers:e.headers})))}async exists(t){var e=this;const n=e._getFinalPath(t);try{return await LL(e.fetch,`${e.url}/object/${n}`,{headers:e.headers}),{data:!0,error:null}}catch(a){if(e.shouldThrowOnError)throw a;if(Eg(a)){var r;const s=a instanceof Mv?a.status:a instanceof J4?(r=a.originalError)===null||r===void 0?void 0:r.status:void 0;if(s!==void 0&&[400,404].includes(s))return{data:!1,error:a}}throw a}}getPublicUrl(t,e){const n=this._getFinalPath(t),r=new URLSearchParams;e!=null&&e.download&&r.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(r,e.transform),(e==null?void 0:e.cacheNonce)!=null&&r.set("cacheNonce",String(e.cacheNonce));const a=r.toString(),s=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${s}/public/${n}`)+(a?`?${a}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await qy(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async list(t,e,n){var r=this;return r.handleOperation(async()=>{const a=Wt(Wt(Wt({},RL),e),{},{prefix:t||""});return await Xs(r.fetch,`${r.url}/object/list/${r.bucketId}`,a,{headers:r.headers},n)})}async listV2(t,e){var n=this;return n.handleOperation(async()=>{const r=Wt({},t);return await Xs(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const DL="2.108.2",Od={"X-Client-Info":`storage-js/${DL}`};var PL=class extends Wf{constructor(t,e={},n,r){const a=new URL(t);r!=null&&r.useNewHostname&&/supabase\.(co|in|red)$/.test(a.hostname)&&!a.hostname.includes("storage.supabase.")&&(a.hostname=a.hostname.replace("supabase.","storage.supabase."));const s=a.href.replace(/\/$/,""),l=Wt(Wt({},Od),e);super(s,l,n,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=e.listBucketOptionsToQueryString(t);return await dd(e.fetch,`${e.url}/bucket${n}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await dd(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var n=this;return n.handleOperation(async()=>await Xs(n.fetch,`${n.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async updateBucket(t,e){var n=this;return n.handleOperation(async()=>await Fv(n.fetch,`${n.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:n.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Xs(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await qy(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},ML=class extends Wf{constructor(t,e={},n){const r=t.replace(/\/$/,""),a=Wt(Wt({},Od),e);super(r,a,n,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Xs(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const n=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&n.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&n.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&n.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&n.set("sortOrder",t.sortOrder),t!=null&&t.search&&n.set("search",t.search);const r=n.toString(),a=r?`${e.url}/bucket?${r}`:`${e.url}/bucket`;return await dd(e.fetch,a,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await qy(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!AL(t))throw new _g("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new yL({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(a,s){const l=a[s];return typeof l!="function"?l:async(...u)=>{try{return{data:await l.apply(a,u),error:null}}catch(c){if(r)throw c;return{data:null,error:c}}}}})}},IL=class extends Wf{constructor(t,e={},n){const r=t.replace(/\/$/,""),a=Wt(Wt({},Od),{},{"Content-Type":"application/json"},e);super(r,a,n,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var n=this;return n.handleOperation(async()=>await as.post(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var n=this;return n.handleOperation(async()=>await as.post(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:n.headers})||{})}},FL=class extends Wf{constructor(t,e={},n){const r=t.replace(/\/$/,""),a=Wt(Wt({},Od),{},{"Content-Type":"application/json"},e);super(r,a,n,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},UL=class extends Wf{constructor(t,e={},n){const r=t.replace(/\/$/,""),a=Wt(Wt({},Od),{},{"Content-Type":"application/json"},e);super(r,a,n,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await as.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},BL=class extends UL{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new $L(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,n=this;return e().call(n,t)}async getBucket(t){var e=()=>super.getBucket,n=this;return e().call(n,t)}async listBuckets(t={}){var e=()=>super.listBuckets,n=this;return e().call(n,t)}async deleteBucket(t){var e=()=>super.deleteBucket,n=this;return e().call(n,t)}},$L=class extends IL{constructor(t,e,n,r){super(t,e,r),this.vectorBucketName=n}async createIndex(t){var e=()=>super.createIndex,n=this;return e().call(n,Wt(Wt({},t),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,n=this;return e().call(n,Wt(Wt({},t),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,n=this;return e().call(n,n.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,n=this;return e().call(n,n.vectorBucketName,t)}index(t){return new zL(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},zL=class extends FL{constructor(t,e,n,r,a){super(t,e,a),this.vectorBucketName=n,this.indexName=r}async putVectors(t){var e=()=>super.putVectors,n=this;return e().call(n,Wt(Wt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(t){var e=()=>super.getVectors,n=this;return e().call(n,Wt(Wt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,n=this;return e().call(n,Wt(Wt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,n=this;return e().call(n,Wt(Wt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,n=this;return e().call(n,Wt(Wt({},t),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},qL=class extends PL{constructor(t,e={},n,r){super(t,e,n,r)}from(t){return new kL(this.url,this.headers,t,this.fetch)}get vectors(){return new BL(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new ML(this.url+"/iceberg",this.headers,this.fetch)}};const e3="2.108.2",Ol=30*1e3,Kh=3,m1=Kh*Ol,HL=2*Ol,VL="http://localhost:9999",GL="supabase.auth.token",WL={"X-Client-Info":`gotrue-js/${e3}`},Uv="X-Supabase-Api-Version",t3={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},YL=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,KL=600*1e3;class pd extends Error{constructor(e,n,r){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function rt(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class JL extends pd{constructor(e,n,r){super(e,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function XL(t){return rt(t)&&t.name==="AuthApiError"}class Zs extends pd{constructor(e,n){super(e),this.name="AuthUnknownError",this.originalError=n}}class $o extends pd{constructor(e,n,r,a){super(e,r,a),this.name=n,this.status=r}}class Fa extends $o{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function $p(t){return rt(t)&&t.name==="AuthSessionMissingError"}class uf extends $o{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class zp extends $o{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class qp extends $o{constructor(e,n=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function ZL(t){return rt(t)&&t.name==="AuthImplicitGrantRedirectError"}class kw extends $o{constructor(e,n=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class QL extends $o{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Bv extends $o{constructor(e,n){super(e,"AuthRetryableFetchError",n,void 0)}}function Dw(t){return rt(t)&&t.name==="AuthRetryableFetchError"}class Pw extends $o{constructor(e="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(e,"AuthRefreshDiscardedError",409,void 0)}}function ej(t){return rt(t)&&t.name==="AuthRefreshDiscardedError"}class Mw extends $o{constructor(e,n,r){super(e,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Bm extends $o{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const $m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),Iw=`
|
|
88
|
+
\r=`.split(""),tj=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<Iw.length;e+=1)t[Iw[e].charCodeAt(0)]=-2;for(let e=0;e<$m.length;e+=1)t[$m[e].charCodeAt(0)]=e;return t})();function Fw(t,e,n){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n($m[r]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const r=e.queue>>e.queuedBits-6&63;n($m[r]),e.queuedBits-=6}}function n3(t,e,n){const r=tj[t];if(r>-1)for(e.queue=e.queue<<6|r,e.queuedBits+=6;e.queuedBits>=8;)n(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function Uw(t){const e=[],n=l=>{e.push(String.fromCodePoint(l))},r={utf8seq:0,codepoint:0},a={queue:0,queuedBits:0},s=l=>{aj(l,r,n)};for(let l=0;l<t.length;l+=1)n3(t.charCodeAt(l),a,s);return e.join("")}function nj(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function rj(t,e){for(let n=0;n<t.length;n+=1){let r=t.charCodeAt(n);if(r>55295&&r<=56319){const a=(r-55296)*1024&65535;r=(t.charCodeAt(n+1)-56320&65535|a)+65536,n+=1}nj(r,e)}}function aj(t,e,n){if(e.utf8seq===0){if(t<=127){n(t);return}for(let r=1;r<6;r+=1)if((t>>7-r&1)===0){e.utf8seq=r;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&n(e.codepoint)}}function jf(t){const e=[],n={queue:0,queuedBits:0},r=a=>{e.push(a)};for(let a=0;a<t.length;a+=1)n3(t.charCodeAt(a),n,r);return new Uint8Array(e)}function ij(t){const e=[];return rj(t,n=>e.push(n)),new Uint8Array(e)}function oc(t){const e=[],n={queue:0,queuedBits:0},r=a=>{e.push(a)};return t.forEach(a=>Fw(a,n,r)),Fw(null,n,r),e.join("")}function sj(t){return Math.round(Date.now()/1e3)+t}function oj(){return Symbol("auth-callback")}const li=()=>typeof window<"u"&&typeof document<"u",Qu={tested:!1,writable:!1},r3=()=>{if(!li())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(Qu.tested)return Qu.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),Qu.tested=!0,Qu.writable=!0}catch{Qu.tested=!0,Qu.writable=!1}return Qu.writable};function lj(t){const e={},n=new URL(t);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((a,s)=>{e[s]=a})}catch{}return n.searchParams.forEach((r,a)=>{e[a]=r}),e}const a3=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),uj=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",_f=async(t,e,n)=>{await t.setItem(e,JSON.stringify(n))},Ws=async(t,e)=>{const n=await t.getItem(e);if(!n)return null;try{return JSON.parse(n)}catch{return null}},ea=async(t,e)=>{await t.removeItem(e)};class Ag{constructor(){this.promise=new Ag.promiseConstructor((e,n)=>{this.resolve=e,this.reject=n})}}Ag.promiseConstructor=Promise;function Hp(t){const e=t.split(".");if(e.length!==3)throw new Bm("Invalid JWT structure");for(let r=0;r<e.length;r++)if(!YL.test(e[r]))throw new Bm("JWT not in base64url format");return{header:JSON.parse(Uw(e[0])),payload:JSON.parse(Uw(e[1])),signature:jf(e[2]),raw:{header:e[0],payload:e[1]}}}async function cj(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function fj(t,e){return new Promise((r,a)=>{(async()=>{for(let s=0;s<1/0;s++)try{const l=await t(s);if(!e(s,null,l)){r(l);return}}catch(l){if(!e(s,l)){a(l);return}}})()})}function hj(t){return("0"+t.toString(16)).substr(-2)}function dj(){const e=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let a="";for(let s=0;s<56;s++)a+=n.charAt(Math.floor(Math.random()*r));return a}return crypto.getRandomValues(e),Array.from(e,hj).join("")}async function pj(t){const n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n),a=new Uint8Array(r);return Array.from(a).map(s=>String.fromCharCode(s)).join("")}async function mj(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const n=await pj(t);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ec(t,e,n=!1){const r=dj();let a=r;n&&(a+="/recovery"),await _f(t,`${e}-code-verifier`,a);const s=await mj(r);return[s,r===s?"plain":"s256"]}const gj=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function vj(t){const e=t.headers.get(Uv);if(!e||!e.match(gj))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function yj(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function bj(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const wj=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function El(t){if(!wj.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function Js(t){if(!t.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function g1(){const t={};return new Proxy(t,{get:(e,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function xj(t,e){return new Proxy(t,{get:(n,r,a)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const s=r.toString();if(s==="Symbol(Symbol.toPrimitive)"||s==="Symbol(Symbol.toStringTag)"||s==="Symbol(util.inspect.custom)"||s==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,a)}return!e.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(n,r,a)}})}function Bw(t){return JSON.parse(JSON.stringify(t))}const rc=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},Sj=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function $w(t){var e;if(!uj(t))throw new Bv(rc(t),0);if(Sj.includes(t.status))throw new Bv(rc(t),t.status);let n;try{n=await t.json()}catch(s){throw new Zs(rc(s),s)}let r;const a=vj(t);if(a&&a.getTime()>=t3["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new Mw(rc(n),t.status,((e=n.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(r==="session_not_found")throw new Fa}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((s,l)=>s&&typeof l=="string",!0))throw new Mw(rc(n),t.status,n.weak_password.reasons);throw new JL(rc(n),t.status||500,r)}const _j=(t,e,n,r)=>{const a={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?a:(a.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),a.body=JSON.stringify(r),Object.assign(Object.assign({},a),n))};async function xt(t,e,n,r){var a;const s=Object.assign({},r==null?void 0:r.headers);s[Uv]||(s[Uv]=t3["2024-01-01"].name),r!=null&&r.jwt&&(s.Authorization=`Bearer ${r.jwt}`);const l=(a=r==null?void 0:r.query)!==null&&a!==void 0?a:{};r!=null&&r.redirectTo&&(l.redirect_to=r.redirectTo);const u=Object.keys(l).length?"?"+new URLSearchParams(l).toString():"",c=await Ej(t,e,n+u,{headers:s,noResolveJson:r==null?void 0:r.noResolveJson},{},r==null?void 0:r.body);return r!=null&&r.xform?r==null?void 0:r.xform(c):{data:Object.assign({},c),error:null}}async function Ej(t,e,n,r,a,s){const l=_j(e,r,a,s);let u;try{u=await t(n,Object.assign({},l))}catch(c){throw console.error(c),new Bv(rc(c),0)}if(u.ok||await $w(u),r!=null&&r.noResolveJson)return u;try{return await u.json()}catch(c){await $w(c)}}function bs(t){var e;let n=null;Cj(t)&&(n=Object.assign({},t),t.expires_at||(n.expires_at=sj(t.expires_in)));const r=(e=t.user)!==null&&e!==void 0?e:typeof(t==null?void 0:t.id)=="string"?t:null;return{data:{session:n,user:r},error:null}}function zw(t){const e=bs(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(e.data.weak_password=t.weak_password),e}function Eu(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function Aj(t){return{data:t,error:null}}function Nj(t){const{action_link:e,email_otp:n,hashed_token:r,redirect_to:a,verification_type:s}=t,l=Sg(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),u={action_link:e,email_otp:n,hashed_token:r,redirect_to:a,verification_type:s},c=Object.assign({},l);return{data:{properties:u,user:c},error:null}}function qw(t){return t}function Cj(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const v1=["global","local","others"];class Tj{constructor({url:e="",headers:n={},fetch:r,experimental:a}){this.url=e,this.headers=n,this.fetch=a3(r),this.experimental=a??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,n=v1[0]){if(v1.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${v1.join(", ")}`);try{return await xt(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(r){if(rt(r))return{data:null,error:r};throw r}}async inviteUserByEmail(e,n={}){try{return await xt(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Eu})}catch(r){if(rt(r))return{data:{user:null},error:r};throw r}}async generateLink(e){try{const{options:n}=e,r=Sg(e,["options"]),a=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(a.new_email=r==null?void 0:r.newEmail,delete a.newEmail),await xt(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:a,headers:this.headers,xform:Nj,redirectTo:n==null?void 0:n.redirectTo})}catch(n){if(rt(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(e){try{return await xt(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:Eu})}catch(n){if(rt(n))return{data:{user:null},error:n};throw n}}async listUsers(e){var n,r,a,s,l,u,c;try{const h={nextPage:null,lastPage:0,total:0},d=await xt(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(a=e==null?void 0:e.perPage)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:""},xform:qw});if(d.error)throw d.error;const m=await d.json(),y=(l=d.headers.get("x-total-count"))!==null&&l!==void 0?l:0,g=(c=(u=d.headers.get("link"))===null||u===void 0?void 0:u.split(","))!==null&&c!==void 0?c:[];return g.length>0&&(g.forEach(x=>{const _=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),N=JSON.parse(x.split(";")[1].split("=")[1]);h[`${N}Page`]=_}),h.total=parseInt(y)),{data:Object.assign(Object.assign({},m),h),error:null}}catch(h){if(rt(h))return{data:{users:[]},error:h};throw h}}async getUserById(e){El(e);try{return await xt(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:Eu})}catch(n){if(rt(n))return{data:{user:null},error:n};throw n}}async updateUserById(e,n){El(e);try{return await xt(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:n,headers:this.headers,xform:Eu})}catch(r){if(rt(r))return{data:{user:null},error:r};throw r}}async deleteUser(e,n=!1){El(e);try{return await xt(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:n},xform:Eu})}catch(r){if(rt(r))return{data:{user:null},error:r};throw r}}async _listFactors(e){El(e.userId);try{const{data:n,error:r}=await xt(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:a=>({data:{factors:a},error:null})});return{data:n,error:r}}catch(n){if(rt(n))return{data:null,error:n};throw n}}async _deleteFactor(e){El(e.userId),El(e.id);try{return{data:await xt(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(n){if(rt(n))return{data:null,error:n};throw n}}async _listOAuthClients(e){var n,r,a,s,l,u,c;try{const h={nextPage:null,lastPage:0,total:0},d=await xt(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=e==null?void 0:e.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(s=(a=e==null?void 0:e.perPage)===null||a===void 0?void 0:a.toString())!==null&&s!==void 0?s:""},xform:qw});if(d.error)throw d.error;const m=await d.json(),y=(l=d.headers.get("x-total-count"))!==null&&l!==void 0?l:0,g=(c=(u=d.headers.get("link"))===null||u===void 0?void 0:u.split(","))!==null&&c!==void 0?c:[];return g.length>0&&(g.forEach(x=>{const _=parseInt(x.split(";")[0].split("=")[1].substring(0,1)),N=JSON.parse(x.split(";")[1].split("=")[1]);h[`${N}Page`]=_}),h.total=parseInt(y)),{data:Object.assign(Object.assign({},m),h),error:null}}catch(h){if(rt(h))return{data:{clients:[]},error:h};throw h}}async _createOAuthClient(e){try{return await xt(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(rt(n))return{data:null,error:n};throw n}}async _getOAuthClient(e){try{return await xt(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(rt(n))return{data:null,error:n};throw n}}async _updateOAuthClient(e,n){try{return await xt(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(rt(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(e){try{return await xt(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(rt(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(e){try{return await xt(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(rt(n))return{data:null,error:n};throw n}}async _listCustomProviders(e){try{const n={};return e!=null&&e.type&&(n.type=e.type),await xt(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:n,xform:r=>{var a;return{data:{providers:(a=r==null?void 0:r.providers)!==null&&a!==void 0?a:[]},error:null}}})}catch(n){if(rt(n))return{data:{providers:[]},error:n};throw n}}async _createCustomProvider(e){try{return await xt(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(rt(n))return{data:null,error:n};throw n}}async _getCustomProvider(e){try{return await xt(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(rt(n))return{data:null,error:n};throw n}}async _updateCustomProvider(e,n){try{return await xt(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(rt(r))return{data:null,error:r};throw r}}async _deleteCustomProvider(e){try{return await xt(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(rt(n))return{data:null,error:n};throw n}}async _adminListPasskeys(e){Js(this.experimental),El(e.userId);try{return await xt(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(rt(n))return{data:null,error:n};throw n}}async _adminDeletePasskey(e){Js(this.experimental),El(e.userId),El(e.passkeyId);try{return await xt(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(rt(n))return{data:null,error:n};throw n}}}function Hw(t={}){return{getItem:e=>t[e]||null,setItem:(e,n)=>{t[e]=n},removeItem:e=>{delete t[e]}}}globalThis&&r3()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class Lj extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}function jj(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function i3(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function Oj(t){return parseInt(t,16)}function Rj(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,r=>r.toString(16).padStart(2,"0")).join("")}function kj(t){var e;const{chainId:n,domain:r,expirationTime:a,issuedAt:s=new Date,nonce:l,notBefore:u,requestId:c,resources:h,scheme:d,uri:m,version:y}=t;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(l&&l.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${l}`);if(!m)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(y!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${y}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
|
|
89
|
+
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const g=i3(t.address),x=d?`${d}://${r}`:r,_=t.statement?`${t.statement}
|
|
90
|
+
`:"",N=`${x} wants you to sign in with your Ethereum account:
|
|
91
|
+
${g}
|
|
92
|
+
|
|
93
|
+
${_}`;let A=`URI: ${m}
|
|
94
|
+
Version: ${y}
|
|
95
|
+
Chain ID: ${n}${l?`
|
|
96
|
+
Nonce: ${l}`:""}
|
|
97
|
+
Issued At: ${s.toISOString()}`;if(a&&(A+=`
|
|
98
|
+
Expiration Time: ${a.toISOString()}`),u&&(A+=`
|
|
99
|
+
Not Before: ${u.toISOString()}`),c&&(A+=`
|
|
100
|
+
Request ID: ${c}`),h){let j=`
|
|
101
|
+
Resources:`;for(const L of h){if(!L||typeof L!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${L}`);j+=`
|
|
102
|
+
- ${L}`}A+=j}return`${N}
|
|
103
|
+
${A}`}class da extends Error{constructor({message:e,code:n,cause:r,name:a}){var s;super(e,{cause:r}),this.__isWebAuthnError=!0,this.name=(s=a??(r instanceof Error?r.name:void 0))!==null&&s!==void 0?s:"Unknown Error",this.code=n}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class zm extends da{constructor(e,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:e}),this.name="WebAuthnUnknownError",this.originalError=n}}function Dj({error:t,options:e}){var n,r,a;const{publicKey:s}=e;if(!s)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new da({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((n=s.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new da({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((r=s.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new da({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((a=s.authenticatorSelection)===null||a===void 0?void 0:a.userVerification)==="required")return new da({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new da({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new da({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return s.pubKeyCredParams.filter(u=>u.type==="public-key").length===0?new da({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new da({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const l=window.location.hostname;if(s3(l)){if(s.rp.id!==l)return new da({message:`The RP ID "${s.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new da({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(s.user.id.byteLength<1||s.user.id.byteLength>64)return new da({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new da({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new da({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function Pj({error:t,options:e}){const{publicKey:n}=e;if(!n)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new da({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new da({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const r=window.location.hostname;if(s3(r)){if(n.rpId!==r)return new da({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new da({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new da({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new da({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class Mj{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const $v=new Mj;function Vw(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:n,excludeCredentials:r}=t,a=Sg(t,["challenge","user","excludeCredentials"]),s=jf(e).buffer,l=Object.assign(Object.assign({},n),{id:jf(n.id).buffer}),u=Object.assign(Object.assign({},a),{challenge:s,user:l});if(r&&r.length>0){u.excludeCredentials=new Array(r.length);for(let c=0;c<r.length;c++){const h=r[c];u.excludeCredentials[c]=Object.assign(Object.assign({},h),{id:jf(h.id).buffer,type:h.type||"public-key",transports:h.transports})}}return u}function Gw(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:n}=t,r=Sg(t,["challenge","allowCredentials"]),a=jf(e).buffer,s=Object.assign(Object.assign({},r),{challenge:a});if(n&&n.length>0){s.allowCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const u=n[l];s.allowCredentials[l]=Object.assign(Object.assign({},u),{id:jf(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return s}function Ww(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t;return{id:t.id,rawId:t.id,response:{attestationObject:oc(new Uint8Array(t.response.attestationObject)),clientDataJSON:oc(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Yw(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const n=t,r=t.getClientExtensionResults(),a=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:oc(new Uint8Array(a.authenticatorData)),clientDataJSON:oc(new Uint8Array(a.clientDataJSON)),signature:oc(new Uint8Array(a.signature)),userHandle:a.userHandle?oc(new Uint8Array(a.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(e=n.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function s3(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function qm(){var t,e;return!!(li()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function o3(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new zm("Browser returned unexpected credential type",e)}:{data:null,error:new zm("Empty credential response",e)}}catch(e){return{data:null,error:Dj({error:e,options:t})}}}async function l3(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new zm("Browser returned unexpected credential type",e)}:{data:null,error:new zm("Empty credential response",e)}}catch(e){return{data:null,error:Pj({error:e,options:t})}}}const Ij={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},Fj={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Hm(...t){const e=a=>a!==null&&typeof a=="object"&&!Array.isArray(a),n=a=>a instanceof ArrayBuffer||ArrayBuffer.isView(a),r={};for(const a of t)if(a)for(const s in a){const l=a[s];if(l!==void 0)if(Array.isArray(l))r[s]=l;else if(n(l))r[s]=l;else if(e(l)){const u=r[s];e(u)?r[s]=Hm(u,l):r[s]=Hm(l)}else r[s]=l}return r}function Uj(t,e){return Hm(Ij,t,e||{})}function Bj(t,e){return Hm(Fj,t,e||{})}class $j{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:n,friendlyName:r,signal:a},s){var l;try{const{data:u,error:c}=await this.client.mfa.challenge({factorId:e,webauthn:n});if(!u)return{data:null,error:c};const h=a??$v.createNewAbortSignal();if(u.webauthn.type==="create"){const{user:d}=u.webauthn.credential_options.publicKey;if(!d.name){const m=r;if(m)d.name=`${d.id}:${m}`;else{const g=(await this.client.getUser()).data.user,x=((l=g==null?void 0:g.user_metadata)===null||l===void 0?void 0:l.name)||(g==null?void 0:g.email)||(g==null?void 0:g.id)||"User";d.name=`${d.id}:${x}`}}d.displayName||(d.displayName=d.name)}switch(u.webauthn.type){case"create":{const d=Uj(u.webauthn.credential_options.publicKey,s==null?void 0:s.create),{data:m,error:y}=await o3({publicKey:d,signal:h});return m?{data:{factorId:e,challengeId:u.id,webauthn:{type:u.webauthn.type,credential_response:m}},error:null}:{data:null,error:y}}case"request":{const d=Bj(u.webauthn.credential_options.publicKey,s==null?void 0:s.request),{data:m,error:y}=await l3(Object.assign(Object.assign({},u.webauthn.credential_options),{publicKey:d,signal:h}));return m?{data:{factorId:e,challengeId:u.id,webauthn:{type:u.webauthn.type,credential_response:m}},error:null}:{data:null,error:y}}}}catch(u){return rt(u)?{data:null,error:u}:{data:null,error:new Zs("Unexpected error in challenge",u)}}}async _verify({challengeId:e,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:e,webauthn:r})}async _authenticate({factorId:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},s){if(!n)return{data:null,error:new pd("rpId is required for WebAuthn authentication")};try{if(!qm())return{data:null,error:new Zs("Browser does not support WebAuthn",null)};const{data:l,error:u}=await this.challenge({factorId:e,webauthn:{rpId:n,rpOrigins:r},signal:a},{request:s});if(!l)return{data:null,error:u};const{webauthn:c}=l;return this._verify({factorId:e,challengeId:l.challengeId,webauthn:{type:c.type,rpId:n,rpOrigins:r,credential_response:c.credential_response}})}catch(l){return rt(l)?{data:null,error:l}:{data:null,error:new Zs("Unexpected error in authenticate",l)}}}async _register({friendlyName:e,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:a}={}},s){if(!n)return{data:null,error:new pd("rpId is required for WebAuthn registration")};try{if(!qm())return{data:null,error:new Zs("Browser does not support WebAuthn",null)};const{data:l,error:u}=await this._enroll({friendlyName:e});if(!l)return await this.client.mfa.listFactors().then(d=>{var m;return(m=d.data)===null||m===void 0?void 0:m.all.find(y=>y.factor_type==="webauthn"&&y.friendly_name===e&&y.status!=="unverified")}).then(d=>d?this.client.mfa.unenroll({factorId:d==null?void 0:d.id}):void 0),{data:null,error:u};const{data:c,error:h}=await this._challenge({factorId:l.id,friendlyName:l.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:a},{create:s});return c?this._verify({factorId:l.id,challengeId:c.challengeId,webauthn:{rpId:n,rpOrigins:r,type:c.webauthn.type,credential_response:c.webauthn.credential_response}}):{data:null,error:h}}catch(l){return rt(l)?{data:null,error:l}:{data:null,error:new Zs("Unexpected error in register",l)}}}}jj();const zj={url:VL,storageKey:GL,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:WL,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},cf={};class md{get jwks(){var e,n;return(n=(e=cf[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(e){cf[this.storageKey]=Object.assign(Object.assign({},cf[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,n;return(n=(e=cf[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){cf[this.storageKey]=Object.assign(Object.assign({},cf[this.storageKey]),{cachedAt:e})}constructor(e){var n,r,a;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const s=Object.assign(Object.assign({},zj),e);if(this.storageKey=s.storageKey,this.instanceID=(n=md.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,md.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.instanceID>0&&li()){const l=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(l),this.logDebugMessages&&console.trace(l)}if(this.persistSession=s.persistSession,this.autoRefreshToken=s.autoRefreshToken,this.experimental=(r=s.experimental)!==null&&r!==void 0?r:{},this.admin=new Tj({url:s.url,headers:s.headers,fetch:s.fetch,experimental:this.experimental}),this.url=s.url,this.headers=s.headers,this.fetch=a3(s.fetch),this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.hasCustomAuthorizationHeader=s.hasCustomAuthorizationHeader,this.throwOnError=s.throwOnError,this.lockAcquireTimeout=s.lockAcquireTimeout,s.lock!=null&&(this.lock=s.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new $j(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(s.storage?this.storage=s.storage:r3()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=Hw(this.memoryStorage)),s.userStorage&&(this.userStorage=s.userStorage)):(this.memoryStorage={},this.storage=Hw(this.memoryStorage)),li()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(l){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",l)}(a=this.broadcastChannel)===null||a===void 0||a.addEventListener("message",async l=>{this._debug("received broadcast notification from other tab or client",l),(l.data.event==="TOKEN_REFRESHED"||l.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(l.data.event,l.data.session,!1)}catch(u){this._debug("#broadcastChannel","error",u)}})}s.skipAutoInitialize||this.initialize().catch(l=>{this._debug("#initialize()","error",l)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${e3}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var e;try{let n={},r="none";if(li()&&(n=lj(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),li()&&this.detectSessionInUrl&&r!=="none"){const{data:a,error:s}=await this._getSessionFromURL(n,r);if(s){if(this._debug("#_initialize()","error detecting session from URL",s),ZL(s)){const c=(e=s.details)===null||e===void 0?void 0:e.code;if(c==="identity_already_exists"||c==="identity_not_found"||c==="single_identity_not_deletable")return{error:s}}return{error:s}}const{session:l,redirectType:u}=a;return this._debug("#_initialize()","detected session in URL",l,"redirect type",u),await this._saveSession(l),setTimeout(async()=>{u==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",l):await this._notifyAllSubscribers("SIGNED_IN",l)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return rt(n)?this._returnResult({error:n}):this._returnResult({error:new Zs("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var n,r,a;try{const s=await xt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(a=e==null?void 0:e.options)===null||a===void 0?void 0:a.captchaToken}},xform:bs}),{data:l,error:u}=s;if(u||!l)return this._returnResult({data:{user:null,session:null},error:u});const c=l.session,h=l.user;return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:h,session:c},error:null})}catch(s){if(rt(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signUp(e){var n,r,a;try{let s;if("email"in e){const{email:d,password:m,options:y}=e;let g=null,x=null;this.flowType==="pkce"&&([g,x]=await ec(this.storage,this.storageKey)),s=await xt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:y==null?void 0:y.emailRedirectTo,body:{email:d,password:m,data:(n=y==null?void 0:y.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken},code_challenge:g,code_challenge_method:x},xform:bs})}else if("phone"in e){const{phone:d,password:m,options:y}=e;s=await xt(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:d,password:m,data:(r=y==null?void 0:y.data)!==null&&r!==void 0?r:{},channel:(a=y==null?void 0:y.channel)!==null&&a!==void 0?a:"sms",gotrue_meta_security:{captcha_token:y==null?void 0:y.captchaToken}},xform:bs})}else throw new zp("You must provide either an email or phone number and a password");const{data:l,error:u}=s;if(u||!l)return await ea(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:u});const c=l.session,h=l.user;return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",c)),this._returnResult({data:{user:h,session:c},error:null})}catch(s){if(await ea(this.storage,`${this.storageKey}-code-verifier`),rt(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithPassword(e){try{let n;if("email"in e){const{email:s,password:l,options:u}=e;n=await xt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:s,password:l,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:zw})}else if("phone"in e){const{phone:s,password:l,options:u}=e;n=await xt(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:s,password:l,gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:zw})}else throw new zp("You must provide either an email or phone number and a password");const{data:r,error:a}=n;if(a)return this._returnResult({data:{user:null,session:null},error:a});if(!r||!r.session||!r.user){const s=new uf;return this._returnResult({data:{user:null,session:null},error:s})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:a})}catch(n){if(rt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(e){var n,r,a,s;return await this._handleProviderSignIn(e.provider,{redirectTo:(n=e.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=e.options)===null||r===void 0?void 0:r.scopes,queryParams:(a=e.options)===null||a===void 0?void 0:a.queryParams,skipBrowserRedirect:(s=e.options)===null||s===void 0?void 0:s.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e)):this._exchangeCodeForSession(e)}async signInWithWeb3(e){const{chain:n}=e;switch(n){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(e){var n,r,a,s,l,u,c,h,d,m,y;let g,x;if("message"in e)g=e.message,x=e.signature;else{const{chain:_,wallet:N,statement:A,options:j}=e;let L;if(li())if(typeof N=="object")L=N;else{const B=window;if("ethereum"in B&&typeof B.ethereum=="object"&&"request"in B.ethereum&&typeof B.ethereum.request=="function")L=B.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof N!="object"||!(j!=null&&j.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");L=N}const R=new URL((n=j==null?void 0:j.url)!==null&&n!==void 0?n:window.location.href),I=await L.request({method:"eth_requestAccounts"}).then(B=>B).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!I||I.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const ee=i3(I[0]);let G=(r=j==null?void 0:j.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!G){const B=await L.request({method:"eth_chainId"});G=Oj(B)}const P={domain:R.host,address:ee,statement:A,uri:R.href,version:"1",chainId:G,nonce:(a=j==null?void 0:j.signInWithEthereum)===null||a===void 0?void 0:a.nonce,issuedAt:(l=(s=j==null?void 0:j.signInWithEthereum)===null||s===void 0?void 0:s.issuedAt)!==null&&l!==void 0?l:new Date,expirationTime:(u=j==null?void 0:j.signInWithEthereum)===null||u===void 0?void 0:u.expirationTime,notBefore:(c=j==null?void 0:j.signInWithEthereum)===null||c===void 0?void 0:c.notBefore,requestId:(h=j==null?void 0:j.signInWithEthereum)===null||h===void 0?void 0:h.requestId,resources:(d=j==null?void 0:j.signInWithEthereum)===null||d===void 0?void 0:d.resources};g=kj(P),x=await L.request({method:"personal_sign",params:[Rj(g),ee]})}try{const{data:_,error:N}=await xt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:g,signature:x},!((m=e.options)===null||m===void 0)&&m.captchaToken?{gotrue_meta_security:{captcha_token:(y=e.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:bs});if(N)throw N;if(!_||!_.session||!_.user){const A=new uf;return this._returnResult({data:{user:null,session:null},error:A})}return _.session&&(await this._saveSession(_.session),await this._notifyAllSubscribers("SIGNED_IN",_.session)),this._returnResult({data:Object.assign({},_),error:N})}catch(_){if(rt(_))return this._returnResult({data:{user:null,session:null},error:_});throw _}}async signInWithSolana(e){var n,r,a,s,l,u,c,h,d,m,y,g;let x,_;if("message"in e)x=e.message,_=e.signature;else{const{chain:N,wallet:A,statement:j,options:L}=e;let R;if(li())if(typeof A=="object")R=A;else{const ee=window;if("solana"in ee&&typeof ee.solana=="object"&&("signIn"in ee.solana&&typeof ee.solana.signIn=="function"||"signMessage"in ee.solana&&typeof ee.solana.signMessage=="function"))R=ee.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof A!="object"||!(L!=null&&L.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");R=A}const I=new URL((n=L==null?void 0:L.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in R&&R.signIn){const ee=await R.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},L==null?void 0:L.signInWithSolana),{version:"1",domain:I.host,uri:I.href}),j?{statement:j}:null));let G;if(Array.isArray(ee)&&ee[0]&&typeof ee[0]=="object")G=ee[0];else if(ee&&typeof ee=="object"&&"signedMessage"in ee&&"signature"in ee)G=ee;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in G&&"signature"in G&&(typeof G.signedMessage=="string"||G.signedMessage instanceof Uint8Array)&&G.signature instanceof Uint8Array)x=typeof G.signedMessage=="string"?G.signedMessage:new TextDecoder().decode(G.signedMessage),_=G.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in R)||typeof R.signMessage!="function"||!("publicKey"in R)||typeof R!="object"||!R.publicKey||!("toBase58"in R.publicKey)||typeof R.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");x=[`${I.host} wants you to sign in with your Solana account:`,R.publicKey.toBase58(),...j?["",j,""]:[""],"Version: 1",`URI: ${I.href}`,`Issued At: ${(a=(r=L==null?void 0:L.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&a!==void 0?a:new Date().toISOString()}`,...!((s=L==null?void 0:L.signInWithSolana)===null||s===void 0)&&s.notBefore?[`Not Before: ${L.signInWithSolana.notBefore}`]:[],...!((l=L==null?void 0:L.signInWithSolana)===null||l===void 0)&&l.expirationTime?[`Expiration Time: ${L.signInWithSolana.expirationTime}`]:[],...!((u=L==null?void 0:L.signInWithSolana)===null||u===void 0)&&u.chainId?[`Chain ID: ${L.signInWithSolana.chainId}`]:[],...!((c=L==null?void 0:L.signInWithSolana)===null||c===void 0)&&c.nonce?[`Nonce: ${L.signInWithSolana.nonce}`]:[],...!((h=L==null?void 0:L.signInWithSolana)===null||h===void 0)&&h.requestId?[`Request ID: ${L.signInWithSolana.requestId}`]:[],...!((m=(d=L==null?void 0:L.signInWithSolana)===null||d===void 0?void 0:d.resources)===null||m===void 0)&&m.length?["Resources",...L.signInWithSolana.resources.map(G=>`- ${G}`)]:[]].join(`
|
|
104
|
+
`);const ee=await R.signMessage(new TextEncoder().encode(x),"utf8");if(!ee||!(ee instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");_=ee}}try{const{data:N,error:A}=await xt(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:x,signature:oc(_)},!((y=e.options)===null||y===void 0)&&y.captchaToken?{gotrue_meta_security:{captcha_token:(g=e.options)===null||g===void 0?void 0:g.captchaToken}}:null),xform:bs});if(A)throw A;if(!N||!N.session||!N.user){const j=new uf;return this._returnResult({data:{user:null,session:null},error:j})}return N.session&&(await this._saveSession(N.session),await this._notifyAllSubscribers("SIGNED_IN",N.session)),this._returnResult({data:Object.assign({},N),error:A})}catch(N){if(rt(N))return this._returnResult({data:{user:null,session:null},error:N});throw N}}async _exchangeCodeForSession(e){const n=await Ws(this.storage,`${this.storageKey}-code-verifier`),[r,a]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new QL;const{data:s,error:l}=await xt(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:r},xform:bs});if(await ea(this.storage,`${this.storageKey}-code-verifier`),l)throw l;if(!s||!s.session||!s.user){const u=new uf;return this._returnResult({data:{user:null,session:null,redirectType:null},error:u})}return s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers(a==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",s.session)),this._returnResult({data:Object.assign(Object.assign({},s),{redirectType:a??null}),error:l})}catch(s){if(await ea(this.storage,`${this.storageKey}-code-verifier`),rt(s))return this._returnResult({data:{user:null,session:null,redirectType:null},error:s});throw s}}async signInWithIdToken(e){try{const{options:n,provider:r,token:a,access_token:s,nonce:l}=e,u=await xt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:a,access_token:s,nonce:l,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},xform:bs}),{data:c,error:h}=u;if(h)return this._returnResult({data:{user:null,session:null},error:h});if(!c||!c.session||!c.user){const d=new uf;return this._returnResult({data:{user:null,session:null},error:d})}return c.session&&(await this._saveSession(c.session),await this._notifyAllSubscribers("SIGNED_IN",c.session)),this._returnResult({data:c,error:h})}catch(n){if(rt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(e){var n,r,a,s,l;try{if("email"in e){const{email:u,options:c}=e;let h=null,d=null;this.flowType==="pkce"&&([h,d]=await ec(this.storage,this.storageKey));const{error:m}=await xt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:u,data:(n=c==null?void 0:c.data)!==null&&n!==void 0?n:{},create_user:(r=c==null?void 0:c.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},code_challenge:h,code_challenge_method:d},redirectTo:c==null?void 0:c.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:m})}if("phone"in e){const{phone:u,options:c}=e,{data:h,error:d}=await xt(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:u,data:(a=c==null?void 0:c.data)!==null&&a!==void 0?a:{},create_user:(s=c==null?void 0:c.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:c==null?void 0:c.captchaToken},channel:(l=c==null?void 0:c.channel)!==null&&l!==void 0?l:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:h==null?void 0:h.message_id},error:d})}throw new zp("You must provide either an email or phone number.")}catch(u){if(await ea(this.storage,`${this.storageKey}-code-verifier`),rt(u))return this._returnResult({data:{user:null,session:null},error:u});throw u}}async verifyOtp(e){var n,r;try{let a,s;"options"in e&&(a=(n=e.options)===null||n===void 0?void 0:n.redirectTo,s=(r=e.options)===null||r===void 0?void 0:r.captchaToken);const{data:l,error:u}=await xt(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:s}}),redirectTo:a,xform:bs});if(u)throw u;if(!l)throw new Error("An error occurred on token verification.");const c=l.session,h=l.user;return c!=null&&c.access_token&&(await this._saveSession(c),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",c)),this._returnResult({data:{user:h,session:c},error:null})}catch(a){if(rt(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}}async signInWithSSO(e){var n,r,a,s,l;try{let u=null,c=null;this.flowType==="pkce"&&([u,c]=await ec(this.storage,this.storageKey));const h=await xt(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(r=(n=e.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((a=e==null?void 0:e.options)===null||a===void 0)&&a.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:u,code_challenge_method:c}),headers:this.headers,xform:Aj});return!((s=h.data)===null||s===void 0)&&s.url&&li()&&!(!((l=e.options)===null||l===void 0)&&l.skipBrowserRedirect)&&window.location.assign(h.data.url),this._returnResult(h)}catch(u){if(await ea(this.storage,`${this.storageKey}-code-verifier`),rt(u))return this._returnResult({data:null,error:u});throw u}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)throw r;if(!n)throw new Fa;const{error:a}=await xt(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:a})})}catch(e){if(rt(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const n=`${this.url}/resend`;if("email"in e){const{email:r,type:a,options:s}=e;let l=null,u=null;this.flowType==="pkce"&&([l,u]=await ec(this.storage,this.storageKey));const{error:c}=await xt(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:a,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken},code_challenge:l,code_challenge_method:u},redirectTo:s==null?void 0:s.emailRedirectTo});return c&&await ea(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:c})}else if("phone"in e){const{phone:r,type:a,options:s}=e,{data:l,error:u}=await xt(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:a,gotrue_meta_security:{captcha_token:s==null?void 0:s.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:l==null?void 0:l.message_id},error:u})}throw new zp("You must provide either an email or phone number and a type")}catch(n){if(await ea(this.storage,`${this.storageKey}-code-verifier`),rt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e)):await this._useSession(async e=>e)}async _acquireLock(e,n){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),a=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await a}catch{}})()),a}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const a=[...this.pendingInLock];await Promise.all(a),this.pendingInLock.splice(0,a.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await e(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const n=await Ws(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?e=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const r=e.expires_at?e.expires_at*1e3-Date.now()<m1:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",e.expires_at),!r){if(this.userStorage){const l=await Ws(this.userStorage,this.storageKey+"-user");l!=null&&l.user?e.user=l.user:e.user=g1()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const l={value:this.suppressGetSessionWarning};e.user=xj(e.user,l),l.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:a,error:s}=await this._callRefreshToken(e.refresh_token);if(s){if(!!(e.expires_at&&e.expires_at*1e3>Date.now())){const u=await Ws(this.storage,this.storageKey);if(u&&u.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:s})}return this._returnResult({data:{session:a},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let n;return this.lock!=null?n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):n=await this._getUser(),n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(e){try{return e?await xt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:Eu}):await this._useSession(async n=>{var r,a,s;const{data:l,error:u}=n;if(u)throw u;return!(!((r=l.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new Fa}:await xt(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(s=(a=l.session)===null||a===void 0?void 0:a.access_token)!==null&&s!==void 0?s:void 0,xform:Eu})})}catch(n){if(rt(n))return $p(n)&&(await this._removeSession(),await ea(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(e,n={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,n)):await this._updateUser(e,n)}async _updateUser(e,n={}){try{return await this._useSession(async r=>{const{data:a,error:s}=r;if(s)throw s;if(!a.session)throw new Fa;const l=a.session;let u=null,c=null;this.flowType==="pkce"&&e.email!=null&&([u,c]=await ec(this.storage,this.storageKey));const{data:h,error:d}=await xt(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n==null?void 0:n.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:u,code_challenge_method:c}),jwt:l.access_token,xform:Eu});if(d)throw d;return l.user=h.user,await this._saveSession(l),await this._notifyAllSubscribers("USER_UPDATED",l),this._returnResult({data:{user:l.user},error:null})})}catch(r){if(await ea(this.storage,`${this.storageKey}-code-verifier`),rt(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e)):await this._setSession(e)}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new Fa;const n=Date.now()/1e3;let r=n,a=!0,s=null;const{payload:l}=Hp(e.access_token);if(l.exp&&(r=l.exp,a=r<=n),a){const{data:u,error:c}=await this._callRefreshToken(e.refresh_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});if(!u)return{data:{user:null,session:null},error:null};s=u}else{const{data:u,error:c}=await this._getUser(e.access_token);if(c)return this._returnResult({data:{user:null,session:null},error:c});s={access_token:e.access_token,refresh_token:e.refresh_token,user:u.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)}return this._returnResult({data:{user:s.user,session:s},error:null})}catch(n){if(rt(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e)):await this._refreshSession(e)}async _refreshSession(e){try{return await this._useSession(async n=>{var r;if(!e){const{data:l,error:u}=n;if(u)throw u;e=(r=l.session)!==null&&r!==void 0?r:void 0}if(!(e!=null&&e.refresh_token))throw new Fa;const{data:a,error:s}=await this._callRefreshToken(e.refresh_token);return s?this._returnResult({data:{user:null,session:null},error:s}):a?this._returnResult({data:{user:a.user,session:a},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(rt(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(e,n){var r;try{if(!li())throw new qp("No browser detected.");if(e.error||e.error_description||e.error_code)throw new qp(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new kw("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new qp("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new kw("No code detected.");const{data:L,error:R}=await this._exchangeCodeForSession(e.code);if(R)throw R;const I=new URL(window.location.href);return I.searchParams.delete("code"),window.history.replaceState(window.history.state,"",I.toString()),{data:{session:L.session,redirectType:(r=L.redirectType)!==null&&r!==void 0?r:null},error:null}}const{provider_token:a,provider_refresh_token:s,access_token:l,refresh_token:u,expires_in:c,expires_at:h,token_type:d}=e;if(!l||!c||!u||!d)throw new qp("No session defined in URL");const m=Math.round(Date.now()/1e3),y=parseInt(c);let g=m+y;h&&(g=parseInt(h));const x=g-m;x*1e3<=Ol&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${y}s`);const _=g-y;m-_>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",_,g,m):m-_<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",_,g,m);const{data:N,error:A}=await this._getUser(l);if(A)throw A;const j={provider_token:a,provider_refresh_token:s,access_token:l,expires_in:y,expires_at:g,refresh_token:u,token_type:d,user:N.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:j,redirectType:e.type},error:null})}catch(a){if(rt(a))return this._returnResult({data:{session:null,redirectType:null},error:a});throw a}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}async _isPKCECallback(e){const n=await Ws(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&n)}async signOut(e={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e)):await this._signOut(e)}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:a,error:s}=n;if(s&&!$p(s))return this._returnResult({error:s});const l=(r=a.session)===null||r===void 0?void 0:r.access_token;if(l){const{error:u}=await this.admin.signOut(l,e);if(u&&!(XL(u)&&(u.status===404||u.status===401||u.status===403)||$p(u)))return this._returnResult({error:u})}return e!=="others"&&(await this._removeSession(),await ea(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const n=oj(),r={id:n,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)}):await this._emitInitialSession(n)))(),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async n=>{var r,a;try{const{data:{session:s},error:l}=n;if(l)throw l;await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",s)),this._debug("INITIAL_SESSION","callback id",e,"session",s)}catch(s){await((a=this.stateChangeEmitters.get(e))===null||a===void 0?void 0:a.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",s),$p(s)?console.warn(s):console.error(s)}})}async resetPasswordForEmail(e,n={}){let r=null,a=null;this.flowType==="pkce"&&([r,a]=await ec(this.storage,this.storageKey,!0));try{return await xt(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:a,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(s){if(await ea(this.storage,`${this.storageKey}-code-verifier`),rt(s))return this._returnResult({data:null,error:s});throw s}}async getUserIdentities(){var e;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(e=n.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(n){if(rt(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var n;try{const{data:r,error:a}=await this._useSession(async s=>{var l,u,c,h,d;const{data:m,error:y}=s;if(y)throw y;const g=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(l=e.options)===null||l===void 0?void 0:l.redirectTo,scopes:(u=e.options)===null||u===void 0?void 0:u.scopes,queryParams:(c=e.options)===null||c===void 0?void 0:c.queryParams,skipBrowserRedirect:!0});return await xt(this.fetch,"GET",g,{headers:this.headers,jwt:(d=(h=m.session)===null||h===void 0?void 0:h.access_token)!==null&&d!==void 0?d:void 0})});if(a)throw a;return li()&&!(!((n=e.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r==null?void 0:r.url),this._returnResult({data:{provider:e.provider,url:r==null?void 0:r.url},error:null})}catch(r){if(rt(r))return this._returnResult({data:{provider:e.provider,url:null},error:r});throw r}}async linkIdentityIdToken(e){return await this._useSession(async n=>{var r;try{const{error:a,data:{session:s}}=n;if(a)throw a;const{options:l,provider:u,token:c,access_token:h,nonce:d}=e,m=await xt(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=s==null?void 0:s.access_token)!==null&&r!==void 0?r:void 0,body:{provider:u,id_token:c,access_token:h,nonce:d,link_identity:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken}},xform:bs}),{data:y,error:g}=m;return g?this._returnResult({data:{user:null,session:null},error:g}):!y||!y.session||!y.user?this._returnResult({data:{user:null,session:null},error:new uf}):(y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("USER_UPDATED",y.session)),this._returnResult({data:y,error:g}))}catch(a){if(await ea(this.storage,`${this.storageKey}-code-verifier`),rt(a))return this._returnResult({data:{user:null,session:null},error:a});throw a}})}async unlinkIdentity(e){try{return await this._useSession(async n=>{var r,a;const{data:s,error:l}=n;if(l)throw l;return await xt(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(a=(r=s.session)===null||r===void 0?void 0:r.access_token)!==null&&a!==void 0?a:void 0})})}catch(n){if(rt(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(e){const n="#_refreshAccessToken()";this._debug(n,"begin");try{const r=Date.now();return await fj(async a=>(a>0&&await cj(200*Math.pow(2,a-1)),this._debug(n,"refreshing attempt",a),await xt(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:bs})),(a,s)=>{const l=200*Math.pow(2,a);return s&&Dw(s)&&Date.now()+l-r<Ol})}catch(r){if(this._debug(n,"error",r),rt(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",n,"url",r),li()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const a=await Ws(this.storage,this.storageKey);if(a&&this.userStorage){let l=await Ws(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!l&&(l={user:a.user},await _f(this.userStorage,this.storageKey+"-user",l)),a.user=(e=l==null?void 0:l.user)!==null&&e!==void 0?e:g1()}else if(a&&!a.user&&!a.user){const l=await Ws(this.storage,this.storageKey+"-user");l&&(l!=null&&l.user)?(a.user=l.user,await ea(this.storage,this.storageKey+"-user"),await _f(this.storage,this.storageKey,a)):a.user=g1()}if(this._debug(r,"session from storage",a),!this._isValidSession(a)){this._debug(r,"session is not valid"),a!==null&&await this._removeSession();return}const s=((n=a.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<m1;if(this._debug(r,`session has${s?"":" not"} expired with margin of ${m1}s`),s){if(this.autoRefreshToken&&a.refresh_token){const{error:l}=await this._callRefreshToken(a.refresh_token);l&&(ej(l)?this._debug(r,"refresh discarded by commit guard",l):this._debug(r,"refresh failed",l))}}else if(a.user&&a.user.__isUserNotAvailableProxy===!0)try{const{data:l,error:u}=await this._getUser(a.access_token);!u&&(l!=null&&l.user)?(a.user=l.user,await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(l){console.error("Error getting user data:",l),this._debug(r,"error getting user data, skipping SIGNED_IN notification",l)}else await this._notifyAllSubscribers("SIGNED_IN",a)}catch(a){this._debug(r,"error",a),console.error(a);return}finally{this._debug(r,"end")}}async _callRefreshToken(e){var n,r;if(!e)throw new Fa;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const a="#_callRefreshToken()";this._debug(a,"begin");try{this.refreshingDeferred=new Ag;const s=await Ws(this.storage,this.storageKey),{data:l,error:u}=await this._refreshAccessToken(e);if(u)throw u;if(!l.session)throw new Fa;const c=await Ws(this.storage,this.storageKey);if(s!==null&&(c===null||c.refresh_token!==s.refresh_token)){this._debug(a,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:c?"replaced":"cleared"});const y={data:null,error:new Pw};return this.refreshingDeferred.resolve(y),y}const d=this._sessionRemovalEpoch;if(await this._saveSession(l.session),this._sessionRemovalEpoch!==d){this._debug(a,"commit guard (post-save): _removeSession ran during _saveSession, undoing write"),await ea(this.storage,this.storageKey),this.userStorage&&await ea(this.userStorage,this.storageKey+"-user");const y={data:null,error:new Pw};return this.refreshingDeferred.resolve(y),y}await this._notifyAllSubscribers("TOKEN_REFRESHED",l.session);const m={data:l.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(m),m}catch(s){if(this._debug(a,"error",s),rt(s)){const l={data:null,error:s};if(!Dw(s)){const u=await Ws(this.storage,this.storageKey);!!(u!=null&&u.expires_at&&u.expires_at*1e3>Date.now())?this._debug(a,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:l,expiresAt:Date.now()+HL},(n=this.refreshingDeferred)===null||n===void 0||n.resolve(l),l}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(s),s}finally{this.refreshingDeferred=null,this._debug(a,"end")}}async _notifyAllSubscribers(e,n,r=!0){const a=`#_notifyAllSubscribers(${e})`;this._debug(a,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:n});const s=[],l=Array.from(this.stateChangeEmitters.values()).map(async u=>{try{await u.callback(e,n)}catch(c){s.push(c)}});if(await Promise.all(l),s.length>0){for(let u=0;u<s.length;u+=1)console.error(s[u]);throw s[0]}}finally{this._debug(a,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await ea(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},e),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await _f(this.userStorage,this.storageKey+"-user",{user:n.user});const a=Object.assign({},n);delete a.user;const s=Bw(a);await _f(this.storage,this.storageKey,s)}else{const a=Bw(n);await _f(this.storage,this.storageKey,a)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await ea(this.storage,this.storageKey),await ea(this.storage,this.storageKey+"-code-verifier"),await ea(this.storage,this.storageKey+"-user"),this.userStorage&&await ea(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&li()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Ol);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)===null||e===void 0||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((r.expires_at*1e3-e)/Ol);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${Ol}ms, refresh threshold is ${Kh} ticks`),a<=Kh&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof Lj)this._debug("auto refresh token tick lock not available");else throw e}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const e=Date.now();try{await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const a=Math.floor((r.expires_at*1e3-e)/Ol);this._debug("#_autoRefreshTokenTick()",`access token expires in ${a} ticks, a tick lasts ${Ol}ms, refresh threshold is ${Kh} ticks`),a<=Kh&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!li()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const n=`#_onVisibilityChanged(${e})`;if(this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(n,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,n,r){const a=[`provider=${encodeURIComponent(n)}`];if(r!=null&&r.redirectTo&&a.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r!=null&&r.scopes&&a.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[s,l]=await ec(this.storage,this.storageKey),u=new URLSearchParams({code_challenge:`${encodeURIComponent(s)}`,code_challenge_method:`${encodeURIComponent(l)}`});a.push(u.toString())}if(r!=null&&r.queryParams){const s=new URLSearchParams(r.queryParams);a.push(s.toString())}return r!=null&&r.skipBrowserRedirect&&a.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${e}?${a.join("&")}`}async _unenroll(e){try{return await this._useSession(async n=>{var r;const{data:a,error:s}=n;return s?this._returnResult({data:null,error:s}):await xt(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(r=a==null?void 0:a.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(rt(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(e){try{return await this._useSession(async n=>{var r,a;const{data:s,error:l}=n;if(l)return this._returnResult({data:null,error:l});const u=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:c,error:h}=await xt(this.fetch,"POST",`${this.url}/factors`,{body:u,headers:this.headers,jwt:(r=s==null?void 0:s.session)===null||r===void 0?void 0:r.access_token});return h?this._returnResult({data:null,error:h}):(e.factorType==="totp"&&c.type==="totp"&&(!((a=c==null?void 0:c.totp)===null||a===void 0)&&a.qr_code)&&(c.totp.qr_code=`data:image/svg+xml;utf-8,${c.totp.qr_code}`),this._returnResult({data:c,error:null}))})}catch(n){if(rt(n))return this._returnResult({data:null,error:n});throw n}}async _verify(e){const n=async()=>{try{return await this._useSession(async r=>{var a;const{data:s,error:l}=r;if(l)return this._returnResult({data:null,error:l});const u=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Ww(e.webauthn.credential_response):Yw(e.webauthn.credential_response)})}:{code:e.code}),{data:c,error:h}=await xt(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:u,headers:this.headers,jwt:(a=s==null?void 0:s.session)===null||a===void 0?void 0:a.access_token});return h?this._returnResult({data:null,error:h}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),this._returnResult({data:c,error:h}))})}catch(r){if(rt(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,n):n()}async _challenge(e){const n=async()=>{try{return await this._useSession(async r=>{var a;const{data:s,error:l}=r;if(l)return this._returnResult({data:null,error:l});const u=await xt(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(a=s==null?void 0:s.session)===null||a===void 0?void 0:a.access_token});if(u.error)return u;const{data:c}=u;if(c.type!=="webauthn")return{data:c,error:null};switch(c.webauthn.type){case"create":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:Vw(c.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:Gw(c.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(r){if(rt(r))return this._returnResult({data:null,error:r});throw r}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,n):n()}async _challengeAndVerify(e){const{data:n,error:r}=await this._challenge({factorId:e.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:e.factorId,challengeId:n.id,code:e.code})}async _listFactors(){var e;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const a={all:[],phone:[],totp:[],webauthn:[]};for(const s of(e=n==null?void 0:n.factors)!==null&&e!==void 0?e:[])a.all.push(s),s.status==="verified"&&a[s.factor_type].push(s);return{data:a,error:null}}async _getAuthenticatorAssuranceLevel(e){var n,r,a,s;if(e)try{const{payload:g}=Hp(e);let x=null;g.aal&&(x=g.aal);let _=x;const{data:{user:N},error:A}=await this.getUser(e);if(A)return this._returnResult({data:null,error:A});((r=(n=N==null?void 0:N.factors)===null||n===void 0?void 0:n.filter(R=>R.status==="verified"))!==null&&r!==void 0?r:[]).length>0&&(_="aal2");const L=g.amr||[];return{data:{currentLevel:x,nextLevel:_,currentAuthenticationMethods:L},error:null}}catch(g){if(rt(g))return this._returnResult({data:null,error:g});throw g}const{data:{session:l},error:u}=await this.getSession();if(u)return this._returnResult({data:null,error:u});if(!l)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:c}=Hp(l.access_token);let h=null;c.aal&&(h=c.aal);let d=h;((s=(a=l.user.factors)===null||a===void 0?void 0:a.filter(g=>g.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(d="aal2");const y=c.amr||[];return{data:{currentLevel:h,nextLevel:d,currentAuthenticationMethods:y},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async n=>{const{data:{session:r},error:a}=n;return a?this._returnResult({data:null,error:a}):r?await xt(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new Fa})})}catch(n){if(rt(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:a},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!a)return this._returnResult({data:null,error:new Fa});const l=await xt(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"approve"},xform:u=>({data:u,error:null})});return l.data&&l.data.redirect_url&&li()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(l.data.redirect_url),l})}catch(r){if(rt(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(e,n){try{return await this._useSession(async r=>{const{data:{session:a},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!a)return this._returnResult({data:null,error:new Fa});const l=await xt(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:a.access_token,body:{action:"deny"},xform:u=>({data:u,error:null})});return l.data&&l.data.redirect_url&&li()&&!(n!=null&&n.skipBrowserRedirect)&&window.location.assign(l.data.redirect_url),l})}catch(r){if(rt(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;return r?this._returnResult({data:null,error:r}):n?await xt(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:a=>({data:a,error:null})}):this._returnResult({data:null,error:new Fa})})}catch(e){if(rt(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async n=>{const{data:{session:r},error:a}=n;return a?this._returnResult({data:null,error:a}):r?(await xt(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new Fa})})}catch(n){if(rt(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(e,n={keys:[]}){let r=n.keys.find(u=>u.kid===e);if(r)return r;const a=Date.now();if(r=this.jwks.keys.find(u=>u.kid===e),r&&this.jwks_cached_at+KL>a)return r;const{data:s,error:l}=await xt(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(l)throw l;return!s.keys||s.keys.length===0||(this.jwks=s,this.jwks_cached_at=a,r=s.keys.find(u=>u.kid===e),!r)?null:r}async getClaims(e,n={}){try{let r=e;if(!r){const{data:g,error:x}=await this.getSession();if(x||!g.session)return this._returnResult({data:null,error:x});r=g.session.access_token}const{header:a,payload:s,signature:l,raw:{header:u,payload:c}}=Hp(r);if(!(n!=null&&n.allowExpired))try{yj(s.exp)}catch(g){throw new Bm(g instanceof Error?g.message:"JWT validation failed")}const h=!a.alg||a.alg.startsWith("HS")||!a.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(a.kid,n!=null&&n.keys?{keys:n.keys}:n==null?void 0:n.jwks);if(!h){const{error:g}=await this.getUser(r);if(g)throw g;return{data:{claims:s,header:a,signature:l},error:null}}const d=bj(a.alg),m=await crypto.subtle.importKey("jwk",h,d,!0,["verify"]);if(!await crypto.subtle.verify(d,m,l,ij(`${u}.${c}`)))throw new Bm("Invalid JWT signature");return{data:{claims:s,header:a,signature:l},error:null}}catch(r){if(rt(r))return this._returnResult({data:null,error:r});throw r}}async signInWithPasskey(e){var n,r,a;Js(this.experimental);try{if(!qm())return this._returnResult({data:null,error:new Zs("Browser does not support WebAuthn",null)});const{data:s,error:l}=await this._startPasskeyAuthentication({options:{captchaToken:(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.captchaToken}});if(l||!s)return this._returnResult({data:null,error:l});const u=Gw(s.options),c=(a=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&a!==void 0?a:$v.createNewAbortSignal(),{data:h,error:d}=await l3({publicKey:u,signal:c});if(d||!h)return this._returnResult({data:null,error:d??new Zs("WebAuthn ceremony failed",null)});const m=Yw(h);return this._verifyPasskeyAuthentication({challengeId:s.challenge_id,credential:m})}catch(s){if(rt(s))return this._returnResult({data:null,error:s});throw s}}async registerPasskey(e){var n,r;Js(this.experimental);try{if(!qm())return this._returnResult({data:null,error:new Zs("Browser does not support WebAuthn",null)});const{data:a,error:s}=await this._startPasskeyRegistration();if(s||!a)return this._returnResult({data:null,error:s});const l=Vw(a.options),u=(r=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&r!==void 0?r:$v.createNewAbortSignal(),{data:c,error:h}=await o3({publicKey:l,signal:u});if(h||!c)return this._returnResult({data:null,error:h??new Zs("WebAuthn ceremony failed",null)});const d=Ww(c);return this._verifyPasskeyRegistration({challengeId:a.challenge_id,credential:d})}catch(a){if(rt(a))return this._returnResult({data:null,error:a});throw a}}async _startPasskeyRegistration(){Js(this.experimental);try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Fa});const{data:a,error:s}=await xt(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:n.access_token,body:{}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:a,error:null})})}catch(e){if(rt(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){Js(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!r)return this._returnResult({data:null,error:new Fa});const{data:s,error:l}=await xt(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:r.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return l?this._returnResult({data:null,error:l}):this._returnResult({data:s,error:null})})}catch(n){if(rt(n))return this._returnResult({data:null,error:n});throw n}}async _startPasskeyAuthentication(e){var n;Js(this.experimental);try{const{data:r,error:a}=await xt(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.captchaToken}}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:r,error:null})}catch(r){if(rt(r))return this._returnResult({data:null,error:r});throw r}}async _verifyPasskeyAuthentication(e){Js(this.experimental);try{const{data:n,error:r}=await xt(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:bs});return r?this._returnResult({data:null,error:r}):(n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:n,error:null}))}catch(n){if(rt(n))return this._returnResult({data:null,error:n});throw n}}async _listPasskeys(){Js(this.experimental);try{return await this._useSession(async e=>{const{data:{session:n},error:r}=e;if(r)return this._returnResult({data:null,error:r});if(!n)return this._returnResult({data:null,error:new Fa});const{data:a,error:s}=await xt(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:n.access_token,xform:l=>({data:l,error:null})});return s?this._returnResult({data:null,error:s}):this._returnResult({data:a,error:null})})}catch(e){if(rt(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){Js(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!r)return this._returnResult({data:null,error:new Fa});const{data:s,error:l}=await xt(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,body:{friendly_name:e.friendlyName}});return l?this._returnResult({data:null,error:l}):this._returnResult({data:s,error:null})})}catch(n){if(rt(n))return this._returnResult({data:null,error:n});throw n}}async _deletePasskey(e){Js(this.experimental);try{return await this._useSession(async n=>{const{data:{session:r},error:a}=n;if(a)return this._returnResult({data:null,error:a});if(!r)return this._returnResult({data:null,error:new Fa});const{error:s}=await xt(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:r.access_token,noResolveJson:!0});return s?this._returnResult({data:null,error:s}):this._returnResult({data:null,error:null})})}catch(n){if(rt(n))return this._returnResult({data:null,error:n});throw n}}}md.nextInstanceID={};const qj=md,Hj="2.108.2";let Jh="",Vm;if(typeof Deno<"u"){var y1;Jh="deno",Vm=(y1=Deno.version)===null||y1===void 0?void 0:y1.deno}else if(typeof document<"u")Jh="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")Jh="react-native";else{var b1;Jh="node",Vm=typeof process<"u"?(b1=process.version)===null||b1===void 0?void 0:b1.replace(/^v/,""):void 0}const u3=[`runtime=${Jh}`];Vm&&u3.push(`runtime-version=${Vm}`);const Vj={"X-Client-Info":`supabase-js/${Hj}; ${u3.join("; ")}`},Gj={headers:Vj},Wj={schema:"public"},Yj={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},Kj={},Jj={enabled:!1,respectSamplingDecision:!0};function Xj(t,e,n,r){function a(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function u(d){try{h(r.next(d))}catch(m){l(m)}}function c(d){try{h(r.throw(d))}catch(m){l(m)}}function h(d){d.done?s(d.value):a(d.value).then(u,c)}h((r=r.apply(t,[])).next())})}let w1=null;const Zj="@opentelemetry/api";function Qj(){return w1===null&&(w1=import(Zj).catch(()=>null)),w1}function eO(){return Xj(this,void 0,void 0,function*(){try{const t=yield Qj();if(!t||!t.propagation||!t.context)return null;const e={};t.propagation.inject(t.context.active(),e);const n=e.traceparent;return n?{traceparent:n,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function tO(t){if(!t||typeof t!="string")return null;const e=t.split("-");if(e.length!==4)return null;const[n,r,a,s]=e;if(n.length!==2||r.length!==32||a.length!==16||s.length!==2)return null;const l=/^[0-9a-f]+$/i;return!l.test(n)||!l.test(r)||!l.test(a)||!l.test(s)||r==="00000000000000000000000000000000"||a==="0000000000000000"?null:{version:n,traceId:r,parentId:a,traceFlags:s,isSampled:(parseInt(s,16)&1)===1}}function nO(t,e){if(!t||!e||e.length===0)return!1;let n;if(t instanceof URL)n=t;else try{n=new URL(t)}catch{return!1}for(const r of e)try{if(typeof r=="string"){if(rO(n.hostname,r))return!0}else if(r instanceof RegExp){if(r.test(n.hostname))return!0}else if(typeof r=="function"&&r(n))return!0}catch{continue}return!1}function rO(t,e){if(e===t)return!0;if(e.startsWith("*.")){const n=e.slice(2);if(t.endsWith(n)&&(t===n||t.endsWith("."+n)))return!0}return!1}function aO(t){const e=[];try{const n=new URL(t);e.push(n.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function gd(t){"@babel/helpers - typeof";return gd=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},gd(t)}function iO(t,e){if(gd(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(gd(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function sO(t){var e=iO(t,"string");return gd(e)=="symbol"?e:e+""}function oO(t,e,n){return(e=sO(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Kw(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function Yr(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Kw(Object(n),!0).forEach(function(r){oO(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kw(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}const lO=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),uO=()=>Headers,cO=(t,e,n,r,a)=>{const s=lO(r),l=uO(),u=(a==null?void 0:a.enabled)===!0,c=(a==null?void 0:a.respectSamplingDecision)!==!1,h=u?aO(e):null;return async(d,m)=>{var y;const g=(y=await n())!==null&&y!==void 0?y:t;let x=new l(m==null?void 0:m.headers);if(x.has("apikey")||x.set("apikey",t),x.has("Authorization")||x.set("Authorization",`Bearer ${g}`),h){const _=await fO(d,h,c);_&&(_.traceparent&&!x.has("traceparent")&&x.set("traceparent",_.traceparent),_.tracestate&&!x.has("tracestate")&&x.set("tracestate",_.tracestate),_.baggage&&!x.has("baggage")&&x.set("baggage",_.baggage))}return s(d,Yr(Yr({},m),{},{headers:x}))}};async function fO(t,e,n){if(!nO(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const r=await eO();if(!r||!r.traceparent)return null;if(n){const a=tO(r.traceparent);if(a&&!a.isSampled)return null}return r}function Jw(t){return typeof t=="boolean"?{enabled:t}:t}function hO(t){return t.endsWith("/")?t:t+"/"}function dO(t,e){var n,r,a,s,l,u;const{db:c,auth:h,realtime:d,global:m}=t,{db:y,auth:g,realtime:x,global:_}=e,N=Jw(t.tracePropagation),A=Jw(e.tracePropagation),j={db:Yr(Yr({},y),c),auth:Yr(Yr({},g),h),realtime:Yr(Yr({},x),d),storage:{},global:Yr(Yr(Yr({},_),m),{},{headers:Yr(Yr({},(n=_==null?void 0:_.headers)!==null&&n!==void 0?n:{}),(r=m==null?void 0:m.headers)!==null&&r!==void 0?r:{})}),tracePropagation:{enabled:(a=(s=N==null?void 0:N.enabled)!==null&&s!==void 0?s:A==null?void 0:A.enabled)!==null&&a!==void 0?a:!1,respectSamplingDecision:(l=(u=N==null?void 0:N.respectSamplingDecision)!==null&&u!==void 0?u:A==null?void 0:A.respectSamplingDecision)!==null&&l!==void 0?l:!0},accessToken:async()=>""};return t.accessToken?j.accessToken=t.accessToken:delete j.accessToken,j}function pO(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(hO(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var mO=class extends qj{constructor(t){super(t)}},gO=class{constructor(t,e,n){var r,a;this.supabaseUrl=t,this.supabaseKey=e;const s=pO(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",s),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",s),this.storageUrl=new URL("storage/v1",s),this.functionsUrl=new URL("functions/v1",s);const l=`sb-${s.hostname.split(".")[0]}-auth-token`,u={db:Wj,realtime:Kj,auth:Yr(Yr({},Yj),{},{storageKey:l}),global:Gj,tracePropagation:Jj},c=dO(n??{},u);if(this.settings=c,this.storageKey=(r=c.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(a=c.global.headers)!==null&&a!==void 0?a:{},c.accessToken)this.accessToken=c.accessToken,this.auth=new Proxy({},{get:(d,m)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(m)} is not possible`)}});else{var h;this.auth=this._initSupabaseAuthClient((h=c.auth)!==null&&h!==void 0?h:{},this.headers,c.global.fetch)}this.fetch=cO(e,t,this._getAccessToken.bind(this),c.global.fetch,c.tracePropagation),this.realtime=this._initRealtimeClient(Yr({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},c.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(d=>this.realtime.setAuth(d)).catch(d=>console.warn("Failed to set initial Realtime auth token:",d)),this.rest=new j8(new URL("rest/v1",s).href,{headers:this.headers,schema:c.db.schema,fetch:this.fetch,timeout:c.db.timeout,urlLengthLimit:c.db.urlLengthLimit}),this.storage=new qL(this.storageUrl.href,this.headers,this.fetch,n==null?void 0:n.storage),c.accessToken||this._listenForAuthEvents()}get functions(){return new x8(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,n)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,n;if(t.accessToken)return await t.accessToken();const{data:r}=await t.auth.getSession();return(e=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:a,storageKey:s,flowType:l,lock:u,debug:c,throwOnError:h,experimental:d,lockAcquireTimeout:m,skipAutoInitialize:y},g,x){const _={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new mO({url:this.authUrl.href,headers:Yr(Yr({},_),g),storageKey:s,autoRefreshToken:t,persistSession:e,detectSessionInUrl:n,storage:r,userStorage:a,flowType:l,lock:u,debug:c,throwOnError:h,experimental:d,fetch:x,lockAcquireTimeout:m,skipAutoInitialize:y,hasCustomAuthorizationHeader:Object.keys(this.headers).some(N=>N.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new hL(this.realtimeUrl.href,Yr(Yr({},t),{},{params:Yr(Yr({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,n){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const vO=(t,e,n)=>new gO(t,e,n);function yO(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const n=e.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}yO()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const bO="https://irn-api.bonnetider.eu",wO="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzgxNTgyNTM4LCJleHAiOjIwOTY5NDI1Mzh9.c8mlFucA109cYtPsuH_PcNjqUv2Srkk3hmWZSAH7XqQ",ot=vO(bO,wO),zv=(t,e)=>e.some(n=>t instanceof n);let Xw,Zw;function xO(){return Xw||(Xw=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function SO(){return Zw||(Zw=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const qv=new WeakMap,x1=new WeakMap,Ng=new WeakMap;function _O(t){const e=new Promise((n,r)=>{const a=()=>{t.removeEventListener("success",s),t.removeEventListener("error",l)},s=()=>{n(uc(t.result)),a()},l=()=>{r(t.error),a()};t.addEventListener("success",s),t.addEventListener("error",l)});return Ng.set(e,t),e}function EO(t){if(qv.has(t))return;const e=new Promise((n,r)=>{const a=()=>{t.removeEventListener("complete",s),t.removeEventListener("error",l),t.removeEventListener("abort",l)},s=()=>{n(),a()},l=()=>{r(t.error||new DOMException("AbortError","AbortError")),a()};t.addEventListener("complete",s),t.addEventListener("error",l),t.addEventListener("abort",l)});qv.set(t,e)}let Hv={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return qv.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return uc(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function c3(t){Hv=t(Hv)}function AO(t){return SO().includes(t)?function(...e){return t.apply(Vv(this),e),uc(this.request)}:function(...e){return uc(t.apply(Vv(this),e))}}function NO(t){return typeof t=="function"?AO(t):(t instanceof IDBTransaction&&EO(t),zv(t,xO())?new Proxy(t,Hv):t)}function uc(t){if(t instanceof IDBRequest)return _O(t);if(x1.has(t))return x1.get(t);const e=NO(t);return e!==t&&(x1.set(t,e),Ng.set(e,t)),e}const Vv=t=>Ng.get(t);function Xr(t,e,{blocked:n,upgrade:r,blocking:a,terminated:s}={}){const l=indexedDB.open(t,e),u=uc(l);return r&&l.addEventListener("upgradeneeded",c=>{r(uc(l.result),c.oldVersion,c.newVersion,uc(l.transaction),c)}),n&&l.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),u.then(c=>{s&&c.addEventListener("close",()=>s()),a&&c.addEventListener("versionchange",h=>a(h.oldVersion,h.newVersion,h))}).catch(()=>{}),u}const CO=["get","getKey","getAll","getAllKeys","count"],TO=["put","add","delete","clear"],S1=new Map;function Qw(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(S1.get(e))return S1.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,a=TO.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(a||CO.includes(n)))return;const s=async function(l,...u){const c=this.transaction(l,a?"readwrite":"readonly");let h=c.store;return r&&(h=h.index(u.shift())),(await Promise.all([h[n](...u),a&&c.done]))[0]};return S1.set(e,s),s}c3(t=>({...t,get:(e,n,r)=>Qw(e,n)||t.get(e,n,r),has:(e,n)=>!!Qw(e,n)||t.has(e,n)}));const LO=["continue","continuePrimaryKey","advance"],ex={},Gv=new WeakMap,f3=new WeakMap,jO={get(t,e){if(!LO.includes(e))return t[e];let n=ex[e];return n||(n=ex[e]=function(...r){Gv.set(this,f3.get(this)[e](...r))}),n}};async function*OO(...t){let e=this;if(e instanceof IDBCursor||(e=await e.openCursor(...t)),!e)return;e=e;const n=new Proxy(e,jO);for(f3.set(n,e),Ng.set(n,Vv(e));e;)yield n,e=await(Gv.get(n)||e.continue()),Gv.delete(n)}function tx(t,e){return e===Symbol.asyncIterator&&zv(t,[IDBIndex,IDBObjectStore,IDBCursor])||e==="iterate"&&zv(t,[IDBIndex,IDBObjectStore])}c3(t=>({...t,get(e,n,r){return tx(e,n)?OO:t.get(e,n,r)},has(e,n){return tx(e,n)||t.has(e,n)}}));const h3="site-language-db",Of="mosqueLanguage";async function nx(t,e){await(await Xr(h3,1,{upgrade(r){r.objectStoreNames.contains(Of)||r.createObjectStore(Of)}})).put(Of,e,t)}async function rx(t){return(await Xr(h3,1,{upgrade(n){n.objectStoreNames.contains(Of)||n.createObjectStore(Of)}})).get(Of,t)}const RO=t=>({no:1,en:2,ar:3})[t]||2,Gm=t=>({1:"no",2:"en",3:"ar"})[t]||"en";var _1={};const rn=t=>typeof t=="string",Uh=()=>{let t,e;const n=new Promise((r,a)=>{t=r,e=a});return n.resolve=t,n.reject=e,n},ax=t=>t==null?"":""+t,kO=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},DO=/###/g,ix=t=>t&&t.indexOf("###")>-1?t.replace(DO,"."):t,sx=t=>!t||rn(t),nd=(t,e,n)=>{const r=rn(e)?e.split("."):e;let a=0;for(;a<r.length-1;){if(sx(t))return{};const s=ix(r[a]);!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++a}return sx(t)?{}:{obj:t,k:ix(r[a])}},ox=(t,e,n)=>{const{obj:r,k:a}=nd(t,e,Object);if(r!==void 0||e.length===1){r[a]=n;return}let s=e[e.length-1],l=e.slice(0,e.length-1),u=nd(t,l,Object);for(;u.obj===void 0&&l.length;)s=`${l[l.length-1]}.${s}`,l=l.slice(0,l.length-1),u=nd(t,l,Object),u!=null&&u.obj&&typeof u.obj[`${u.k}.${s}`]<"u"&&(u.obj=void 0);u.obj[`${u.k}.${s}`]=n},PO=(t,e,n,r)=>{const{obj:a,k:s}=nd(t,e,Object);a[s]=a[s]||[],a[s].push(n)},Wm=(t,e)=>{const{obj:n,k:r}=nd(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},MO=(t,e,n)=>{const r=Wm(t,n);return r!==void 0?r:Wm(e,n)},d3=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?rn(t[r])||t[r]instanceof String||rn(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):d3(t[r],e[r],n):t[r]=e[r]);return t},tc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var IO={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const FO=t=>rn(t)?t.replace(/[&<>"'\/]/g,e=>IO[e]):t;class UO{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const BO=[" ",",","?","!",";"],$O=new UO(20),zO=(t,e,n)=>{e=e||"",n=n||"";const r=BO.filter(l=>e.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const a=$O.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let s=!a.test(t);if(!s){const l=t.indexOf(n);l>0&&!a.test(t.substring(0,l))&&(s=!0)}return s},Wv=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let a=t;for(let s=0;s<r.length;){if(!a||typeof a!="object")return;let l,u="";for(let c=s;c<r.length;++c)if(c!==s&&(u+=n),u+=r[c],l=a[u],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&c<r.length-1)continue;s+=c-s+1;break}a=l}return a},vd=t=>t==null?void 0:t.replace(/_/g,"-"),qO={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class Ym{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||qO,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,a){return a&&!this.debug?null:(rn(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new Ym(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new Ym(this.logger,e)}}var Io=new Ym;class Cg{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([a,s])=>{for(let l=0;l<s;l++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,s])=>{for(let l=0;l<s;l++)a.apply(a,[e,...n])})}}class lx extends Cg{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,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 n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r,a={}){var h,d;const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,l=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let u;e.indexOf(".")>-1?u=e.split("."):(u=[e,n],r&&(Array.isArray(r)?u.push(...r):rn(r)&&s?u.push(...r.split(s)):u.push(r)));const c=Wm(this.data,u);return!c&&!n&&!r&&e.indexOf(".")>-1&&(e=u[0],n=u[1],r=u.slice(2).join(".")),c||!l||!rn(r)?c:Wv((d=(h=this.data)==null?void 0:h[e])==null?void 0:d[n],r,s)}addResource(e,n,r,a,s={silent:!1}){const l=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let u=[e,n];r&&(u=u.concat(l?r.split(l):r)),e.indexOf(".")>-1&&(u=e.split("."),a=n,n=u[1]),this.addNamespaces(n),ox(this.data,u,a),s.silent||this.emit("added",e,n,r,a)}addResources(e,n,r,a={silent:!1}){for(const s in r)(rn(r[s])||Array.isArray(r[s]))&&this.addResource(e,n,s,r[s],{silent:!0});a.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,a,s,l={silent:!1,skipCopy:!1}){let u=[e,n];e.indexOf(".")>-1&&(u=e.split("."),a=r,r=n,n=u[1]),this.addNamespaces(n);let c=Wm(this.data,u)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?d3(c,r,s):c={...c,...r},ox(this.data,u,c),l.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var p3={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,a){return t.forEach(s=>{var l;e=((l=this.processors[s])==null?void 0:l.process(e,n,r,a))??e}),e}};const m3=Symbol("i18next/PATH_KEY");function HO(){const t=[],e=Object.create(null);let n;return e.get=(r,a)=>{var s;return(s=n==null?void 0:n.revoke)==null||s.call(n),a===m3?t:(t.push(a),n=Proxy.revocable(r,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function Rf(t,e){const{[m3]:n}=t(HO()),r=(e==null?void 0:e.keySeparator)??".",a=(e==null?void 0:e.nsSeparator)??":";if(n.length>1&&a){const s=e==null?void 0:e.ns,l=Array.isArray(s)?s:null;if(l&&l.length>1&&l.slice(1).includes(n[0]))return`${n[0]}${a}${n.slice(1).join(r)}`}return n.join(r)}const ux={},E1=t=>!rn(t)&&typeof t!="boolean"&&typeof t!="number";class Km extends Cg{constructor(e,n={}){super(),kO(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Io.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};if(e==null)return!1;const a=this.resolve(e,r);if((a==null?void 0:a.res)===void 0)return!1;const s=E1(a.res);return!(r.returnObjects===!1&&s)}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const l=r&&e.indexOf(r)>-1,u=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!zO(e,r,a);if(l&&!u){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:rn(s)?[s]:s};const h=e.split(r);(r!==a||r===a&&this.options.ns.indexOf(h[0])>-1)&&(s=h.shift()),e=h.join(a)}return{key:e,namespaces:rn(s)?[s]:s}}translate(e,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),e==null)return"";typeof e=="function"&&(e=Rf(e,{...this.options,...a})),Array.isArray(e)||(e=[String(e)]),e=e.map(K=>typeof K=="function"?Rf(K,{...this.options,...a}):String(K));const s=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:u,namespaces:c}=this.extractFromKey(e[e.length-1],a),h=c[c.length-1];let d=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const m=a.lng||this.language,y=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((m==null?void 0:m.toLowerCase())==="cimode")return y?s?{res:`${h}${d}${u}`,usedKey:u,exactUsedKey:u,usedLng:m,usedNS:h,usedParams:this.getUsedParamsDetails(a)}:`${h}${d}${u}`:s?{res:u,usedKey:u,exactUsedKey:u,usedLng:m,usedNS:h,usedParams:this.getUsedParamsDetails(a)}:u;const g=this.resolve(e,a);let x=g==null?void 0:g.res;const _=(g==null?void 0:g.usedKey)||u,N=(g==null?void 0:g.exactUsedKey)||u,A=["[object Number]","[object Function]","[object RegExp]"],j=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,L=!this.i18nFormat||this.i18nFormat.handleAsObject,R=a.count!==void 0&&!rn(a.count),I=Km.hasDefaultValue(a),ee=R?this.pluralResolver.getSuffix(m,a.count,a):"",G=a.ordinal&&R?this.pluralResolver.getSuffix(m,a.count,{ordinal:!1}):"",P=R&&!a.ordinal&&a.count===0,B=P&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${ee}`]||a[`defaultValue${G}`]||a.defaultValue;let X=x;L&&!x&&I&&(X=B);const F=E1(X),$=Object.prototype.toString.apply(X);if(L&&X&&F&&A.indexOf($)<0&&!(rn(j)&&Array.isArray(X))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const K=this.options.returnedObjectHandler?this.options.returnedObjectHandler(_,X,{...a,ns:c}):`key '${u} (${this.language})' returned an object instead of string.`;return s?(g.res=K,g.usedParams=this.getUsedParamsDetails(a),g):K}if(l){const K=Array.isArray(X),Y=K?[]:{},he=K?N:_;for(const te in X)if(Object.prototype.hasOwnProperty.call(X,te)){const oe=`${he}${l}${te}`;I&&!x?Y[te]=this.translate(oe,{...a,defaultValue:E1(B)?B[te]:void 0,joinArrays:!1,ns:c}):Y[te]=this.translate(oe,{...a,joinArrays:!1,ns:c}),Y[te]===oe&&(Y[te]=X[te])}x=Y}}else if(L&&rn(j)&&Array.isArray(x))x=x.join(j),x&&(x=this.extendTranslation(x,e,a,r));else{let K=!1,Y=!1;!this.isValidLookup(x)&&I&&(K=!0,x=B),this.isValidLookup(x)||(Y=!0,x=u);const te=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&Y?void 0:x,oe=I&&B!==x&&this.options.updateMissing;if(Y||K||oe){if(this.logger.log(oe?"updateKey":"missingKey",m,h,u,oe?B:x),l){const U=this.resolve(u,{...a,keySeparator:!1});U&&U.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 le=[];const pe=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&pe&&pe[0])for(let U=0;U<pe.length;U++)le.push(pe[U]);else this.options.saveMissingTo==="all"?le=this.languageUtils.toResolveHierarchy(a.lng||this.language):le.push(a.lng||this.language);const Ne=(U,O,V)=>{var ie;const Z=I&&V!==x?V:te;this.options.missingKeyHandler?this.options.missingKeyHandler(U,h,O,Z,oe,a):(ie=this.backendConnector)!=null&&ie.saveMissing&&this.backendConnector.saveMissing(U,h,O,Z,oe,a),this.emit("missingKey",U,h,O,x)};this.options.saveMissing&&(this.options.saveMissingPlurals&&R?le.forEach(U=>{const O=this.pluralResolver.getSuffixes(U,a);P&&a[`defaultValue${this.options.pluralSeparator}zero`]&&O.indexOf(`${this.options.pluralSeparator}zero`)<0&&O.push(`${this.options.pluralSeparator}zero`),O.forEach(V=>{Ne([U],u+V,a[`defaultValue${V}`]||B)})}):Ne(le,u,B))}x=this.extendTranslation(x,e,a,g,r),Y&&x===u&&this.options.appendNamespaceToMissingKey&&(x=`${h}${d}${u}`),(Y||K)&&this.options.parseMissingKeyHandler&&(x=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${h}${d}${u}`:u,K?x:void 0,a))}return s?(g.res=x,g.usedParams=this.getUsedParamsDetails(a),g):x}extendTranslation(e,n,r,a,s){var c,h;if((c=this.i18nFormat)!=null&&c.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=rn(e)&&(((h=r==null?void 0:r.interpolation)==null?void 0:h.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(d){const g=e.match(this.interpolator.nestingRegexp);m=g&&g.length}let y=r.replace&&!rn(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),e=this.interpolator.interpolate(e,y,r.lng||this.language||a.usedLng,r),d){const g=e.match(this.interpolator.nestingRegexp),x=g&&g.length;m<x&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(e=this.interpolator.nest(e,(...g)=>(s==null?void 0:s[0])===g[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):this.translate(...g,n),r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,u=rn(l)?[l]:l;return e!=null&&(u!=null&&u.length)&&r.applyPostProcessor!==!1&&(e=p3.handle(u,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,a,s,l,u;return rn(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(c=>typeof c=="function"?Rf(c,{...this.options,...n}):c)),e.forEach(c=>{if(this.isValidLookup(r))return;const h=this.extractFromKey(c,n),d=h.key;a=d;let m=h.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const y=n.count!==void 0&&!rn(n.count),g=y&&!n.ordinal&&n.count===0,x=n.context!==void 0&&(rn(n.context)||typeof n.context=="number")&&n.context!=="",_=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);m.forEach(N=>{var A,j;this.isValidLookup(r)||(u=N,!ux[`${_[0]}-${N}`]&&((A=this.utils)!=null&&A.hasLoadedNamespace)&&!((j=this.utils)!=null&&j.hasLoadedNamespace(u))&&(ux[`${_[0]}-${N}`]=!0,this.logger.warn(`key "${a}" for languages "${_.join(", ")}" won't get resolved as namespace "${u}" 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!!!")),_.forEach(L=>{var ee;if(this.isValidLookup(r))return;l=L;const R=[d];if((ee=this.i18nFormat)!=null&&ee.addLookupKeys)this.i18nFormat.addLookupKeys(R,d,L,N,n);else{let G;y&&(G=this.pluralResolver.getSuffix(L,n.count,n));const P=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&G.indexOf(B)===0&&R.push(d+G.replace(B,this.options.pluralSeparator)),R.push(d+G),g&&R.push(d+P)),x){const X=`${d}${this.options.contextSeparator||"_"}${n.context}`;R.push(X),y&&(n.ordinal&&G.indexOf(B)===0&&R.push(X+G.replace(B,this.options.pluralSeparator)),R.push(X+G),g&&R.push(X+P))}}let I;for(;I=R.pop();)this.isValidLookup(r)||(s=I,r=this.getResource(L,N,I,n))}))})}),{res:r,usedKey:a,exactUsedKey:s,usedLng:l,usedNS:u}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,a={}){var s;return(s=this.i18nFormat)!=null&&s.getResource?this.i18nFormat.getResource(e,n,r,a):this.resourceStore.getResource(e,n,r,a)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!rn(e.replace);let a=r?e.replace:e;if(r&&typeof e.count<"u"&&(a.count=e.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const s of n)delete a[s]}return a}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class cx{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Io.create("languageUtils")}getScriptPartFromCode(e){if(e=vd(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=vd(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(rn(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}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 n;return e.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const s=this.getLanguagePartFromCode(r);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(l=>{if(l===s)return l;if(!(l.indexOf("-")<0&&s.indexOf("-")<0)&&(l.indexOf("-")>0&&s.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===s||l.indexOf(s)===0&&s.length>1))return l})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),rn(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),a=[],s=l=>{l&&(this.isSupportedCode(l)?a.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return rn(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):rn(e)&&s(this.formatLanguageCode(e)),r.forEach(l=>{a.indexOf(l)<0&&s(this.formatLanguageCode(l))}),a}}const fx={zero:0,one:1,two:2,few:3,many:4,other:5},hx={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class VO{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=Io.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=vd(e==="dev"?"en":e),a=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:r,type:a});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let l;try{l=new Intl.PluralRules(r,{type:a})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),hx;if(!e.match(/-|_/))return hx;const c=this.languageUtils.getLanguagePartFromCode(e);l=this.getRule(c,n)}return this.pluralRulesCache[s]=l,l}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(a=>`${n}${a}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,s)=>fx[a]-fx[s]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(e,n,r={}){const a=this.getRule(e,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const dx=(t,e,n,r=".",a=!0)=>{let s=MO(t,e,n);return!s&&a&&rn(n)&&(s=Wv(t,n,r),s===void 0&&(s=Wv(e,n,r))),s},A1=t=>t.replace(/\$/g,"$$$$");class px{constructor(e={}){var n;this.logger=Io.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:s,prefixEscaped:l,suffix:u,suffixEscaped:c,formatSeparator:h,unescapeSuffix:d,unescapePrefix:m,nestingPrefix:y,nestingPrefixEscaped:g,nestingSuffix:x,nestingSuffixEscaped:_,nestingOptionsSeparator:N,maxReplaces:A,alwaysFormat:j}=e.interpolation;this.escape=n!==void 0?n:FO,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=s?tc(s):l||"{{",this.suffix=u?tc(u):c||"}}",this.formatSeparator=h||",",this.unescapePrefix=d?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=y?tc(y):g||tc("$t("),this.nestingSuffix=x?tc(x):_||tc(")"),this.nestingOptionsSeparator=N||",",this.maxReplaces=A||1e3,this.alwaysFormat=j!==void 0?j:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"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,n,r,a){var g;let s,l,u;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},h=x=>{if(x.indexOf(this.formatSeparator)<0){const j=dx(n,c,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(j,void 0,r,{...a,...n,interpolationkey:x}):j}const _=x.split(this.formatSeparator),N=_.shift().trim(),A=_.join(this.formatSeparator).trim();return this.format(dx(n,c,N,this.options.keySeparator,this.options.ignoreJSONStructure),A,r,{...a,...n,interpolationkey:N})};this.resetRegExp();const d=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,m=((g=a==null?void 0:a.interpolation)==null?void 0:g.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>A1(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?A1(this.escape(x)):A1(x)}].forEach(x=>{for(u=0;s=x.regex.exec(e);){const _=s[1].trim();if(l=h(_),l===void 0)if(typeof d=="function"){const A=d(e,s,a);l=rn(A)?A:""}else if(a&&Object.prototype.hasOwnProperty.call(a,_))l="";else if(m){l=s[0];continue}else this.logger.warn(`missed to pass in variable ${_} for interpolating ${e}`),l="";else!rn(l)&&!this.useRawValueToEscape&&(l=ax(l));const N=x.safeValue(l);if(e=e.replace(s[0],N),m?(x.regex.lastIndex+=l.length,x.regex.lastIndex-=s[0].length):x.regex.lastIndex=0,u++,u>=this.maxReplaces)break}}),e}nest(e,n,r={}){let a,s,l;const u=(c,h)=>{const d=this.nestingOptionsSeparator;if(c.indexOf(d)<0)return c;const m=c.split(new RegExp(`${tc(d)}[ ]*{`));let y=`{${m[1]}`;c=m[0],y=this.interpolate(y,l);const g=y.match(/'/g),x=y.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!x||((x==null?void 0:x.length)??0)%2!==0)&&(y=y.replace(/'/g,'"'));try{l=JSON.parse(y),h&&(l={...h,...l})}catch(_){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,_),`${c}${d}${y}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,c};for(;a=this.nestingRegexp.exec(e);){let c=[];l={...r},l=l.replace&&!rn(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const h=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(h!==-1&&(c=a[1].slice(h).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),a[1]=a[1].slice(0,h)),s=n(u.call(this,a[1].trim(),l),l),s&&a[0]===e&&!rn(s))return s;rn(s)||(s=ax(s)),s||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),s=""),c.length&&(s=c.reduce((d,m)=>this.format(d,m,r.lng,{...r,interpolationkey:a[1].trim()}),s.trim())),e=e.replace(a[0],s),this.regexp.lastIndex=0}return e}}const GO=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);e==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):e==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(l=>{if(l){const[u,...c]=l.split(":"),h=c.join(":").trim().replace(/^'+|'+$/g,""),d=u.trim();n[d]||(n[d]=h),h==="false"&&(n[d]=!1),h==="true"&&(n[d]=!0),isNaN(h)||(n[d]=parseInt(h,10))}})}return{formatName:e,formatOptions:n}},mx=t=>{const e={};return(n,r,a)=>{let s=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(s={...s,[a.interpolationkey]:void 0});const l=r+JSON.stringify(s);let u=e[l];return u||(u=t(vd(r),a),e[l]=u),u(n)}},WO=t=>(e,n,r)=>t(vd(n),r)(e);class YO{constructor(e={}){this.logger=Io.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?mx:WO;this.formats={number:r((a,s)=>{const l=new Intl.NumberFormat(a,{...s});return u=>l.format(u)}),currency:r((a,s)=>{const l=new Intl.NumberFormat(a,{...s,style:"currency"});return u=>l.format(u)}),datetime:r((a,s)=>{const l=new Intl.DateTimeFormat(a,{...s});return u=>l.format(u)}),relativetime:r((a,s)=>{const l=new Intl.RelativeTimeFormat(a,{...s});return u=>l.format(u,s.range||"day")}),list:r((a,s)=>{const l=new Intl.ListFormat(a,{...s});return u=>l.format(u)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=mx(n)}format(e,n,r,a={}){const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(u=>u.indexOf(")")>-1)){const u=s.findIndex(c=>c.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,u)].join(this.formatSeparator)}return s.reduce((u,c)=>{var m;const{formatName:h,formatOptions:d}=GO(c);if(this.formats[h]){let y=u;try{const g=((m=a==null?void 0:a.formatParams)==null?void 0:m[a.interpolationkey])||{},x=g.locale||g.lng||a.locale||a.lng||r;y=this.formats[h](u,x,{...d,...a,...g})}catch(g){this.logger.warn(g)}return y}else this.logger.warn(`there was no format function for ${h}`);return u},e)}}const KO=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class JO extends Cg{constructor(e,n,r,a={}){var s,l;super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=Io.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(l=(s=this.backend)==null?void 0:s.init)==null||l.call(s,r,a.backend,a)}queueLoad(e,n,r,a){const s={},l={},u={},c={};return e.forEach(h=>{let d=!0;n.forEach(m=>{const y=`${h}|${m}`;!r.reload&&this.store.hasResourceBundle(h,m)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?l[y]===void 0&&(l[y]=!0):(this.state[y]=1,d=!1,l[y]===void 0&&(l[y]=!0),s[y]===void 0&&(s[y]=!0),c[m]===void 0&&(c[m]=!0)))}),d||(u[h]=!0)}),(Object.keys(s).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(s),pending:Object.keys(l),toLoadLanguages:Object.keys(u),toLoadNamespaces:Object.keys(c)}}loaded(e,n,r){const a=e.split("|"),s=a[0],l=a[1];n&&this.emit("failedLoading",s,l,n),!n&&r&&this.store.addResourceBundle(s,l,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const u={};this.queue.forEach(c=>{PO(c.loaded,[s],l),KO(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(h=>{u[h]||(u[h]={});const d=c.loaded[h];d.length&&d.forEach(m=>{u[h][m]===void 0&&(u[h][m]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(c=>!c.done)}read(e,n,r,a=0,s=this.retryTimeout,l){if(!e.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:a,wait:s,callback:l});return}this.readingCalls++;const u=(h,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(h&&d&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,r,a+1,s*2,l)},s);return}l(h,d)},c=this.backend[r].bind(this.backend);if(c.length===2){try{const h=c(e,n);h&&typeof h.then=="function"?h.then(d=>u(null,d)).catch(u):u(null,h)}catch(h){u(h)}return}return c(e,n,u)}prepareLoading(e,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();rn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),rn(n)&&(n=[n]);const s=this.queueLoad(e,n,r,a);if(!s.toLoad.length)return s.pending.length||a(),null;s.toLoad.forEach(l=>{this.loadOne(l)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),a=r[0],s=r[1];this.read(a,s,"read",void 0,void 0,(l,u)=>{l&&this.logger.warn(`${n}loading namespace ${s} for language ${a} failed`,l),!l&&u&&this.logger.log(`${n}loaded namespace ${s} for language ${a}`,u),this.loaded(e,l,u)})}saveMissing(e,n,r,a,s,l={},u=()=>{}){var c,h,d,m,y;if((h=(c=this.services)==null?void 0:c.utils)!=null&&h.hasLoadedNamespace&&!((m=(d=this.services)==null?void 0:d.utils)!=null&&m.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" 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(!(r==null||r==="")){if((y=this.backend)!=null&&y.create){const g={...l,isUpdate:s},x=this.backend.create.bind(this.backend);if(x.length<6)try{let _;x.length===5?_=x(e,n,r,a,g):_=x(e,n,r,a),_&&typeof _.then=="function"?_.then(N=>u(null,N)).catch(u):u(null,_)}catch(_){u(_)}else x(e,n,r,a,u,g)}!e||!e[0]||this.store.addResource(e[0],n,r,a)}}}const N1=()=>({debug:!1,initAsync:!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:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),rn(t[1])&&(e.defaultValue=t[1]),rn(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),gx=t=>{var e,n;return rn(t.ns)&&(t.ns=[t.ns]),rn(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),rn(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},Vp=()=>{},XO=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})},g3="__i18next_supportNoticeShown",ZO=()=>!!(typeof globalThis<"u"&&globalThis[g3]||typeof process<"u"&&_1&&_1.I18NEXT_NO_SUPPORT_NOTICE||typeof process<"u"&&_1),QO=()=>{typeof globalThis<"u"&&(globalThis[g3]=!0)},eR=t=>{var e,n,r,a,s,l,u,c,h,d,m,y,g;return!!(((r=(n=(e=t==null?void 0:t.modules)==null?void 0:e.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((u=(l=(s=(a=t==null?void 0:t.modules)==null?void 0:a.backend)==null?void 0:s.constructor)==null?void 0:l.name)==null?void 0:u.indexOf("Locize"))>0||(h=(c=t==null?void 0:t.options)==null?void 0:c.backend)!=null&&h.backends&&t.options.backend.backends.some(x=>{var _,N,A;return((_=x==null?void 0:x.name)==null?void 0:_.indexOf("Locize"))>0||((A=(N=x==null?void 0:x.constructor)==null?void 0:N.name)==null?void 0:A.indexOf("Locize"))>0})||(m=(d=t==null?void 0:t.options)==null?void 0:d.backend)!=null&&m.projectId||(g=(y=t==null?void 0:t.options)==null?void 0:y.backend)!=null&&g.backendOptions&&t.options.backend.backendOptions.some(x=>x==null?void 0:x.projectId))};class rd extends Cg{constructor(e={},n){if(super(),this.options=gx(e),this.services={},this.logger=Io,this.modules={external:[]},XO(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(rn(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=N1();this.options={...r,...this.options,...gx(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!eR(this)&&!ZO()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),QO());const a=h=>h?typeof h=="function"?new h:h:null;if(!this.options.isClone){this.modules.logger?Io.init(a(this.modules.logger),this.options):Io.init(null,this.options);let h;this.modules.formatter?h=this.modules.formatter:h=YO;const d=new cx(this.options);this.store=new lx(this.options.resources,this.options);const m=this.services;m.logger=Io,m.resourceStore=this.store,m.languageUtils=d,m.pluralResolver=new VO(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),h&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(m.formatter=a(h),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new px(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new JO(a(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(g,...x)=>{this.emit(g,...x)}),this.modules.languageDetector&&(m.languageDetector=a(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=a(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Km(this.services,this.options),this.translator.on("*",(g,...x)=>{this.emit(g,...x)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Vp),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]=(...d)=>this.store[h](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(h=>{this[h]=(...d)=>(this.store[h](...d),this)});const u=Uh(),c=()=>{const h=(d,m)=>{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),u.resolve(m),n(d,m)};if(this.languages&&!this.isInitialized)return h(null,this.t.bind(this));this.changeLanguage(this.options.lng,h)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),u}loadResources(e,n=Vp){var s,l;let r=n;const a=rn(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const u=[],c=h=>{if(!h||h==="cimode")return;this.services.languageUtils.toResolveHierarchy(h).forEach(m=>{m!=="cimode"&&u.indexOf(m)<0&&u.push(m)})};a?c(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>c(d)),(l=(s=this.options.preload)==null?void 0:s.forEach)==null||l.call(s,h=>c(h)),this.services.backendConnector.load(u,this.options.ns,h=>{!h&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(h)})}else r(null)}reloadResources(e,n,r){const a=Uh();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=Vp),this.services.backendConnector.reload(e,n,s=>{a.resolve(),r(s)}),a}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"&&p3.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 n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const r=Uh();this.emit("languageChanging",e);const a=u=>{this.language=u,this.languages=this.services.languageUtils.toResolveHierarchy(u),this.resolvedLanguage=void 0,this.setResolvedLanguage(u)},s=(u,c)=>{c?this.isLanguageChangingTo===e&&(a(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,r.resolve((...h)=>this.t(...h)),n&&n(u,(...h)=>this.t(...h))},l=u=>{var d,m;!e&&!u&&this.services.languageDetector&&(u=[]);const c=rn(u)?u:u&&u[0],h=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(rn(u)?[u]:u);h&&(this.language||a(h),this.translator.language||this.translator.changeLanguage(h),(m=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||m.call(d,h)),this.loadResources(h,y=>{s(y,h)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),r}getFixedT(e,n,r){const a=(s,l,...u)=>{let c;typeof l!="object"?c=this.options.overloadTranslationOptionHandler([s,l].concat(u)):c={...l},c.lng=c.lng||a.lng,c.lngs=c.lngs||a.lngs,c.ns=c.ns||a.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||r||a.keyPrefix);const h={...this.options,...c};typeof c.keyPrefix=="function"&&(c.keyPrefix=Rf(c.keyPrefix,h));const d=this.options.keySeparator||".";let m;return c.keyPrefix&&Array.isArray(s)?m=s.map(y=>(typeof y=="function"&&(y=Rf(y,h)),`${c.keyPrefix}${d}${y}`)):(typeof s=="function"&&(s=Rf(s,h)),m=c.keyPrefix?`${c.keyPrefix}${d}${s}`:s),this.t(m,c)};return rn(e)?a.lng=e:a.lngs=e,a.ns=n,a.keyPrefix=r,a}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){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 r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(u,c)=>{const h=this.services.backendConnector.state[`${u}|${c}`];return h===-1||h===0||h===2};if(n.precheck){const u=n.precheck(this,l);if(u!==void 0)return u}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,e)&&(!a||l(s,e)))}loadNamespaces(e,n){const r=Uh();return this.options.ns?(rn(e)&&(e=[e]),e.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Uh();rn(e)&&(e=[e]);const a=this.options.preload||[],s=e.filter(l=>a.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return s.length?(this.options.preload=a.concat(s),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(e){var a,s;if(e||(e=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const l=new Intl.Locale(e);if(l&&l.getTextInfo){const u=l.getTextInfo();if(u&&u.direction)return u.direction}}catch{}const n=["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"],r=((s=this.services)==null?void 0:s.languageUtils)||new cx(N1());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const r=new rd(e,n);return r.createInstance=rd.createInstance,r}cloneInstance(e={},n=Vp){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const a={...this.options,...e,isClone:!0},s=new rd(a);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(u=>{s[u]=this[u]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},r){const u=Object.keys(this.store.data).reduce((c,h)=>(c[h]={...this.store.data[h]},c[h]=Object.keys(c[h]).reduce((d,m)=>(d[m]={...c[h][m]},d),c[h]),c),{});s.store=new lx(u,a),s.services.resourceStore=s.store}if(e.interpolation){const c={...N1().interpolation,...this.options.interpolation,...e.interpolation},h={...a,interpolation:c};s.services.interpolator=new px(h)}return s.translator=new Km(s.services,a),s.translator.on("*",(u,...c)=>{s.emit(u,...c)}),s.init(a,n),s.translator.options=a,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Ir=rd.createInstance();Ir.createInstance;Ir.dir;Ir.init;Ir.loadResources;Ir.reloadResources;Ir.use;Ir.changeLanguage;Ir.getFixedT;Ir.t;Ir.exists;Ir.setDefaultNamespace;Ir.hasLoadedNamespace;Ir.loadNamespaces;Ir.loadLanguages;const tR="Prayer",nR="Salah",rR="Adhan",aR="Jamaat",iR="Iqamah",sR="Tomorrow",oR="Tmrw",lR="Sunrise",uR="Fajr",cR="Dhuhr",fR="Asr",hR="Maghrib",dR="Isha",pR="Jumuah",mR="Eid",gR="In",vR="Select",yR="Language",bR="English",wR="Norwegian",xR="Arabic",SR="Method",_R="North",ER="South",AR="Settings",NR="Daily",CR="Weekly",TR="Monthly",LR="Custom",jR="From",OR="To",RR="Cancel",kR="Contact",DR="Sun",PR="Mon",MR="Tue",IR="Wed",FR="Thu",UR="Fri",BR="Sat",$R="Today",zR="Date",qR="January",HR="February",VR="March",GR="April",WR="May",YR="June",KR="July",JR="August",XR="September",ZR="October",QR="November",ek="December",tk={PRAYER:tR,SALAH:nR,ADHAN:rR,JAMAAT:aR,IQAMAH:iR,TOMORROW:sR,TMRW:oR,SUNRISE:lR,FAJR:uR,DHUHR:cR,ASR:fR,MAGHRIB:hR,ISHA:dR,"FAJR END TIME":"Fajr End Time","FAJR END":"Fajr End",JUMUAH:pR,EID:mR,IN:gR,"SELECT MASJID":"Select Masjid",SELECT:vR,LANGUAGE:yR,ENGLISH:bR,NORWEGIAN:wR,ARABIC:xR,"ASR METHOD":"Asr Method","PRAYER METHOD":"Prayer Method","IRN DEFAULT":"IRN default",METHOD:SR,"1X METHOD":"1x method","2X METHOD":"2x method","50% METHOD":"50% method",NORTH:_R,SOUTH:ER,"EVENTS & CALENDAR":"Events & Calendar","SEE ALL":"See All","LOOK OUT FOR IMPORTANT DATES AND EVENTS":"Look Out for Important Dates and Events","CREATE YOUR PRAYER TIMETABLE":"Create Your Prayer Timetable","VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE":"View and Download Your Custom Prayer Timetable","VIEW FULL CALENDAR":"View Full Calendar","HIJRI CALENDAR":"Hijri Calendar",SETTINGS:AR,DAILY:NR,WEEKLY:CR,MONTHLY:TR,CUSTOM:LR,FROM:jR,TO:OR,"PRAYER TIMETABLE":"Prayer Timetable","DOWNLOAD TIMETABLE":"Download Timetable","DOWNLOAD (CSV/PDF)":"Download (Csv/Pdf)","SAVE AS CSV":"Save as Csv","SAVE AS PDF":"Save as Pdf",CANCEL:RR,CONTACT:kR,SUN:DR,MON:PR,TUE:MR,WED:IR,THU:FR,FRI:UR,SAT:BR,TODAY:$R,DATE:zR,JANUARY:qR,FEBRUARY:HR,MARCH:VR,APRIL:GR,MAY:WR,JUNE:YR,JULY:KR,AUGUST:JR,SEPTEMBER:XR,OCTOBER:ZR,NOVEMBER:QR,DECEMBER:ek},nk="Bønn",rk="Salah",ak="Adhan",ik="Jamaat",sk="Iqamah",ok="I Morgen",lk="I Mrgn",uk="Soloppgang",ck="Fajr",fk="Dhuhr",hk="Asr",dk="Maghrib",pk="Isha",mk="Slutt",gk="Jummah",vk="Eid",yk="I",bk="Velg",wk="Språk",xk="Engelsk",Sk="Norsk",_k="Arabisk",Ek="metode",Ak="Nord",Nk="Sør",Ck="Innstillinger",Tk="Daglig",Lk="Ukentlig",jk="Månedlig",Ok="Tilpasset",Rk="Fra",kk="Til",Dk="Avbryt",Pk="Kontakt",Mk="Søn",Ik="Man",Fk="Tir",Uk="Ons",Bk="Tor",$k="Fre",zk="Lør",qk="I Dag",Hk="Dato",Vk="Januar",Gk="Februar",Wk="Mars",Yk="April",Kk="Mai",Jk="Juni",Xk="Juli",Zk="August",Qk="September",eD="Oktober",tD="November",nD="Desember",rD={PRAYER:nk,SALAH:rk,ADHAN:ak,JAMAAT:ik,IQAMAH:sk,TOMORROW:ok,TMRW:lk,SUNRISE:uk,FAJR:ck,DHUHR:fk,ASR:hk,MAGHRIB:dk,ISHA:pk,"FAJR END TIME":"Fajr Sluttidspunkt","FAJR END":"Fajr Slutt",END:mk,JUMMAH:gk,EID:vk,IN:yk,"SELECT MASJID":"Velg Masjid",SELECT:bk,LANGUAGE:wk,ENGLISH:xk,NORWEGIAN:Sk,ARABIC:_k,"ASR METHOD":"Asr-metode","PRAYER METHOD":"Bønnemetode","IRN DEFAULT":"IRN standard",METHOD:Ek,"1X METHOD":"1x metode","2X METHOD":"2x metode","50% METHOD":"50% metode",NORTH:Ak,SOUTH:Nk,"EVENTS & CALENDAR":"Arrangementer & Kalender","SEE ALL":"Se Alle","LOOK OUT FOR IMPORTANT DATES AND EVENTS":"Følg Med På Viktige Datoer Og Hendelser","CREATE YOUR PRAYER TIMETABLE":"Lag Din Bønnetidtabell","VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE":"Vis Og Last Ned Din Egendefinerte Bønnetidtabell","VIEW FULL CALENDAR":"Se Full Kalender","HIJRI CALENDAR":"Hijri-kalender",SETTINGS:Ck,DAILY:Tk,WEEKLY:Lk,MONTHLY:jk,CUSTOM:Ok,FROM:Rk,TO:kk,"PRAYER TIMETABLE":"Bønnetidtabell","DOWNLOAD TIMETABLE":"Last Ned Tidtabell","DOWNLOAD (CSV/PDF)":"Last Ned (Csv/Pdf)","SAVE AS CSV":"Lagre Som Csv","SAVE AS PDF":"Lagre Som Pdf",CANCEL:Dk,CONTACT:Pk,SUN:Mk,MON:Ik,TUE:Fk,WED:Uk,THU:Bk,FRI:$k,SAT:zk,TODAY:qk,DATE:Hk,JANUARY:Vk,FEBRUARY:Gk,MARCH:Wk,APRIL:Yk,MAY:Kk,JUNE:Jk,JULY:Xk,AUGUST:Zk,SEPTEMBER:Qk,OCTOBER:eD,NOVEMBER:tD,DECEMBER:nD},aD="الصلاة",iD="الصلاة",sD="الأذان",oD="الجماعة",lD="الإقامة",uD="غدًا",cD="غدًا",fD="شروق الشمس",hD="الفجر",dD="الظهر",pD="العصر",mD="المغرب",gD="العشاء",vD="جمعة",yD="العيد",bD="في",wD="اختر",xD="اللغة",SD="الإنجليزية",_D="النرويجية",ED="العربية",AD="الطريقة",ND="الشمالية",CD="الجنوبية",TD="الإعدادات",LD="يومي",jD="أسبوعي",OD="شهري",RD="مخصص",kD="من",DD="إلى",PD="إلغاء",MD="اتصال",ID="أحد",FD="إثنين",UD="ثلاثاء",BD="أربعاء",$D="خميس",zD="جمعة",qD="سبت",HD="اليوم",VD="التاريخ",GD="January",WD="February",YD="March",KD="April",JD="May",XD="June",ZD="July",QD="August",e7="September",t7="October",n7="November",r7="December",a7={PRAYER:aD,SALAH:iD,ADHAN:sD,JAMAAT:oD,IQAMAH:lD,TOMORROW:uD,TMRW:cD,SUNRISE:fD,FAJR:hD,DHUHR:dD,ASR:pD,MAGHRIB:mD,ISHA:gD,"FAJR END TIME":"نهاية وقت الفجر","FAJR END":"نهاية الفجر",JUMUAH:vD,EID:yD,IN:bD,"SELECT MASJID":"اختر المسجد",SELECT:wD,LANGUAGE:xD,ENGLISH:SD,NORWEGIAN:_D,ARABIC:ED,"ASR METHOD":"طريقة العصر","PRAYER METHOD":"طريقة الصلاة","IRN DEFAULT":"الإعداد الافتراضي ل IRN",METHOD:AD,"1X METHOD":"طريقة 1 x","2X METHOD":"طريقة 2 x","50% METHOD":"طريقة 50 %",NORTH:ND,SOUTH:CD,"EVENTS & CALENDAR":"الأحداث والتقويم","SEE ALL":"عرض الكل","LOOK OUT FOR IMPORTANT DATES AND EVENTS":"ترقب التواريخ الهامة والأحداث","CREATE YOUR PRAYER TIMETABLE":"أنشئ جدول صلواتك","VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE":"عرض وتحميل جدول صلاتك المخصص","VIEW FULL CALENDAR":"عرض التقويم الكامل","HIJRI CALENDAR":"التقويم الهجري",SETTINGS:TD,DAILY:LD,WEEKLY:jD,MONTHLY:OD,CUSTOM:RD,FROM:kD,TO:DD,"PRAYER TIMETABLE":"جدول الصلاة","DOWNLOAD TIMETABLE":"تحميل الجدول","DOWNLOAD (CSV/PDF)":"تحميل (CSV/PDF)","SAVE AS CSV":"حفظ كـ CSV","SAVE AS PDF":"حفظ كـ PDF",CANCEL:PD,CONTACT:MD,SUN:ID,MON:FD,TUE:UD,WED:BD,THU:$D,FRI:zD,SAT:qD,TODAY:HD,DATE:VD,JANUARY:GD,FEBRUARY:WD,MARCH:YD,APRIL:KD,MAY:JD,JUNE:XD,JULY:ZD,AUGUST:QD,SEPTEMBER:e7,OCTOBER:t7,NOVEMBER:n7,DECEMBER:r7};Ir.use(i8).init({resources:{en:{translation:tk},no:{translation:rD},ar:{translation:a7}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}});function v3(t){const[e,n]=D.useState(null),[r,a]=D.useState(!0);return D.useEffect(()=>{e&&Ir.language!==e&&Ir.changeLanguage(e)},[e]),D.useEffect(()=>{if(!t){n("en"),a(!1);return}let s=null;return(async()=>{if(a(!0),!navigator.onLine){const u=await rx(t);if(u){n(u),a(!1);return}}try{const{data:u}=await ot.from("mosque_t").select("language").eq("organisasjonsnummer",t).single(),c=(u==null?void 0:u.language)||2,h=Gm(c);await nx(t,h),n(h)}catch(u){const c=await rx(t);c&&n(c),console.error("Error fetching mosque language:",u)}finally{a(!1)}})(),s=ot.channel(`mosque_language_changes:${t}`).on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${t}`},async u=>{var h;const c=(h=u.new)==null?void 0:h.language;if(c){const d=Gm(c);await nx(t,d),n(d)}}).subscribe(),()=>{s&&ot.removeChannel(s)}},[t]),{language:e,loading:r}}const y3=D.createContext({language:"en",loading:!0});function i7({mosqueId:t,children:e}){const{language:n,loading:r}=v3(t);return D.useEffect(()=>{n&&Ir.language!==n&&Ir.changeLanguage(n)},[n]),E.jsx(y3.Provider,{value:{language:n||"en",loading:r},children:e})}const Tu=()=>D.useContext(y3);function vx(t){const e=t.getFullYear(),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.getDate().toString().padStart(2,"0");return`${e}-${n}-${r}`}const Yv=t=>{const[e,n]=t.split(":").map(Number);return e*60+n};function Tg(t){const e={};for(const n of t){const r=n.name.toLowerCase();["fajr","fajr end","dhuhr","asr","maghrib","isha"].includes(r)&&(e[r]=n.adhan)}return e}function Rd(t){const e=new Date,n=e.getHours()*60+e.getMinutes();return t.findIndex(r=>{if(r.adhan)return Yv(r.adhan)<n?Yv(r.iqamah)>n:!0})}const Lg=(t,e)=>{const n=new Date,r=n.getHours()*60+n.getMinutes(),a=e[t+1],s=Yv(a?a.adhan:"23:59");return r>=s};function s7({prayerTimes:t,extraInfo:e,prayerTimesColor:n,extraInfoColor:r,isDefault:a}){const{language:s}=Tu(),{t:l}=Ar(),u=Rd(t),{darkMode:c}=Aa(),h=s==="ar";return E.jsx("div",{className:"font-chakra ",style:{color:c?"#F2E7D5":n.text},children:E.jsxs("div",{className:"backdrop-blur-md rounded-4xl p- shadow-sm min-w-[340px] dark:bg-gradient-to-r dark:from-[#1C1B1BBF] dark:to-[#13121299]",style:{backgroundColor:c?"":a?F4(n.bg,.75):n.bg},dir:h?"rtl":"ltr",children:[E.jsxs("div",{className:"table w-full border-b-2 border-[#00000026] dark:border-[#F2E7D530] p-6",children:[E.jsx("div",{className:"table-header-group w-full text-md md:text-lg 2xl:text-2xl font-bold",style:{color:c?"#F2E7D5":a?"#53452E":n.text},children:E.jsxs("div",{className:"table-row",children:[E.jsx("div",{className:`table-cell py-4 pl-2 ${h?"text-right":"text-left"} border-b-2 border-[#00000026] dark:border-[#F2E7D530]`,children:l("SALAH")}),!h&&E.jsx("div",{className:"table-cell py-2 text-right border-b-2 border-[#00000026] dark:border-[#F2E7D530]"}),E.jsx("div",{className:"table-cell py-2 text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:l("ADHAN")}),E.jsx("div",{className:"table-cell py-2 text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:l("IQAMAH")}),E.jsx("div",{className:"table-cell py-2 text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:l("TOMORROW")})]})}),E.jsx("div",{className:"table-row-group w-full text-md md:text-lg 2xl:text-2xl",children:t.map((d,m)=>{const y=m===u,x=Lg(m,t)&&!y?"opacity-40 dark:text-[#F2E7D5]":"",_={backgroundColor:c?"#54462E":a?"#CFB78F":r.bg,color:a?"":r.text,borderBlockColor:c?"#F2E7DF":a?"#53452E":r.text};return E.jsxs("div",{className:"table-row overflow-hidden text-lg md:text-xl lg:text-3xl",children:[E.jsx("div",{className:`table-cell py-2 pl-2 ${h?"text-right":"text-left"} font-bold ${y?h?"border-r-2 border-y-2 rounded-r-xl":"border-l-2 border-y-2 rounded-l-xl":""}`,style:y?_:{},children:d.name==="Fajr end"?E.jsx(jd,{color:"orange",size:28}):l(d.name.toUpperCase())}),!h&&E.jsx("div",{className:`table-cell py-2 text-right ${y&&"border-y-2"}`,style:y?_:{},children:d.arabic?l(d.arabic.toUpperCase()):""}),E.jsx("div",{className:`table-cell py-2 text-center font-bold ${x} ${y&&"border-y-2"}`,style:y?_:{},children:d.adhan}),E.jsx("div",{className:`table-cell py-2 text-center font-semibold ${x} ${y?h?"border-l-2 border-y-2 rounded-l-xl":"border-r-2 border-y-2 rounded-r-xl":""}`,style:y?_:{},children:d.iqamah}),E.jsx("div",{className:"table-cell py-2 text-center font-semibold",children:d.tomorrow})]},m)})})]}),E.jsx("div",{className:"px-8 py-6 font-semibold rounded-b-4xl text-lg md:text-xl 2xl:text-3xl",style:{color:c?"#F2E7D5":r.text,backgroundColor:c?"#54462E":a?"#CFB78F":r.bg},children:E.jsx("div",{className:h?"w-[55%]":"",children:e.filter(d=>d.label==="Eid"?Array.isArray(d.time)&&d.time.some(m=>m&&m.trim()!==""):!0).map((d,m)=>E.jsxs("div",{className:"flex justify-between py-2",children:[E.jsx("div",{className:"w-2/5",children:l(d==null?void 0:d.label.toUpperCase())}),Array.isArray(d.time)?(h?[2,1,0]:[0,1,2]).map(y=>E.jsx("div",{className:"w-1/4 md:w-1/5 text-center ",children:d.time[y]||"_"},y)):E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"w-1/5 text-center ",children:d.time}),E.jsx("div",{className:"w-1/5"}),E.jsx("div",{className:"w-1/5"})]})]},m))})})]})})}const b3="masjid-info-db",Jm="masjid_info";async function yx(t){return await(await Xr(b3,1,{upgrade(n){n.createObjectStore(Jm)}})).get(Jm,t)}async function o7(t,e){await(await Xr(b3,1,{upgrade(r){r.createObjectStore(Jm)}})).put(Jm,e,t)}function w3(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(n=w3(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function cc(){for(var t,e,n=0,r="",a=arguments.length;n<a;n++)(t=arguments[n])&&(e=w3(t))&&(r&&(r+=" "),r+=e);return r}var kd=t=>typeof t=="number"&&!isNaN(t),dc=t=>typeof t=="string",Pl=t=>typeof t=="function",l7=t=>dc(t)||kd(t),Kv=t=>dc(t)||Pl(t)?t:null,u7=(t,e)=>t===!1||kd(t)&&t>0?t:e,Jv=t=>D.isValidElement(t)||dc(t)||Pl(t)||kd(t);function c7(t,e,n=300){let{scrollHeight:r,style:a}=t;requestAnimationFrame(()=>{a.minHeight="initial",a.height=r+"px",a.transition=`all ${n}ms`,requestAnimationFrame(()=>{a.height="0",a.padding="0",a.margin="0",setTimeout(e,n)})})}function f7({enter:t,exit:e,appendPosition:n=!1,collapse:r=!0,collapseDuration:a=300}){return function({children:s,position:l,preventExitTransition:u,done:c,nodeRef:h,isIn:d,playToast:m}){let y=n?`${t}--${l}`:t,g=n?`${e}--${l}`:e,x=D.useRef(0);return D.useLayoutEffect(()=>{let _=h.current,N=y.split(" "),A=j=>{j.target===h.current&&(m(),_.removeEventListener("animationend",A),_.removeEventListener("animationcancel",A),x.current===0&&j.type!=="animationcancel"&&_.classList.remove(...N))};_.classList.add(...N),_.addEventListener("animationend",A),_.addEventListener("animationcancel",A)},[]),D.useEffect(()=>{let _=h.current,N=()=>{_.removeEventListener("animationend",N),r?c7(_,c,a):c()};d||(u?N():(x.current=1,_.className+=` ${g}`,_.addEventListener("animationend",N)))},[d]),vn.createElement(vn.Fragment,null,s)}}function bx(t,e){return{content:x3(t.content,t.props),containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,reason:t.removalReason,status:e}}function x3(t,e,n=!1){return D.isValidElement(t)&&!dc(t.type)?D.cloneElement(t,{closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:n}):Pl(t)?t({closeToast:e.closeToast,toastProps:e,data:e.data,isPaused:n}):t}function h7({closeToast:t,theme:e,ariaLabel:n="close"}){return vn.createElement("button",{className:`Toastify__close-button Toastify__close-button--${e}`,type:"button",onClick:r=>{r.stopPropagation(),t(!0)},"aria-label":n},vn.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},vn.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function d7({delay:t,isRunning:e,closeToast:n,type:r="default",hide:a,className:s,controlledProgress:l,progress:u,rtl:c,isIn:h,theme:d}){let m=a||l&&u===0,y={animationDuration:`${t}ms`,animationPlayState:e?"running":"paused"};l&&(y.transform=`scaleX(${u})`);let g=cc("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${d}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":c}),x=Pl(s)?s({rtl:c,type:r,defaultClassName:g}):cc(g,s),_={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{h&&n()}};return vn.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":m},vn.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${d} Toastify__progress-bar--${r}`}),vn.createElement("div",{role:"progressbar","aria-hidden":m?"true":"false","aria-label":"notification timer","aria-valuenow":l?Math.round(u*100):void 0,"aria-valuemin":0,"aria-valuemax":100,className:x,style:y,..._}))}var p7=1,S3=()=>`${p7++}`;function m7(t,e,n){let r=1,a=0,s=[],l=[],u=e,c=new Map,h=new Set,d=j=>(h.add(j),()=>h.delete(j)),m=()=>{l=Array.from(c.values()),h.forEach(j=>j())},y=({containerId:j,toastId:L,updateId:R})=>{let I=j?j!==t:t!==1,ee=c.has(L)&&R==null;return I||ee},g=(j,L)=>{c.forEach(R=>{var I;(L==null||L===R.props.toastId)&&((I=R.toggle)==null||I.call(R,j))})},x=j=>{var L,R;j.isActive&&((R=(L=j.props)==null?void 0:L.onClose)==null||R.call(L,j.removalReason),j.isActive=!1,n(bx(j,"removed")))},_=j=>{if(j==null)c.forEach(x);else{let L=c.get(j);L&&x(L)}m()},N=()=>{a-=s.length,s=[]},A=j=>{var L,R;let{toastId:I,updateId:ee}=j.props,G=ee==null;j.staleId&&c.delete(j.staleId),j.isActive=!0,c.set(I,j),m(),n(bx(j,G?"added":"updated")),G&&((R=(L=j.props).onOpen)==null||R.call(L))};return{id:t,props:u,observe:d,toggle:g,removeToast:_,toasts:c,clearQueue:N,buildToast:(j,L)=>{if(y(L))return;let{toastId:R,updateId:I,data:ee,staleId:G,delay:P}=L,B=I==null;B&&a++;let X={...u,style:u.toastStyle,key:r++,...Object.fromEntries(Object.entries(L).filter(([$,K])=>K!=null)),toastId:R,updateId:I,data:ee,isIn:!1,className:Kv(L.className||u.toastClassName),progressClassName:Kv(L.progressClassName||u.progressClassName),autoClose:L.isLoading?!1:u7(L.autoClose,u.autoClose),closeToast($){let K=c.get(R);K&&(K.removalReason=$,_(R))},deleteToast(){if(c.get(R)!=null){if(c.delete(R),a--,a<0&&(a=0),s.length>0){A(s.shift());return}m()}}};X.closeButton=u.closeButton,L.closeButton===!1||Jv(L.closeButton)?X.closeButton=L.closeButton:L.closeButton===!0&&(X.closeButton=Jv(u.closeButton)?u.closeButton:!0);let F={content:j,props:X,staleId:G};u.limit&&u.limit>0&&a>u.limit&&B?s.push(F):kd(P)?setTimeout(()=>{A(F)},P):A(F)},setProps(j){u=j},setToggle:(j,L)=>{let R=c.get(j);R&&(R.toggle=L)},isToastActive:j=>{var L;return(L=c.get(j))==null?void 0:L.isActive},getSnapshot:()=>l}}var gi=new Map,yd=[],Xv=new Set,g7=t=>Xv.forEach(e=>e(t)),_3=()=>gi.size>0;function v7(){yd.forEach(t=>A3(t.content,t.options)),yd=[]}var y7=(t,{containerId:e})=>{var n;return(n=gi.get(e||1))==null?void 0:n.toasts.get(t)};function E3(t,e){var n;if(e)return!!((n=gi.get(e))!=null&&n.isToastActive(t));let r=!1;return gi.forEach(a=>{a.isToastActive(t)&&(r=!0)}),r}function b7(t){if(!_3()){yd=yd.filter(e=>t!=null&&e.options.toastId!==t);return}if(t==null||l7(t))gi.forEach(e=>{e.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){let e=gi.get(t.containerId);e?e.removeToast(t.id):gi.forEach(n=>{n.removeToast(t.id)})}}var w7=(t={})=>{gi.forEach(e=>{e.props.limit&&(!t.containerId||e.id===t.containerId)&&e.clearQueue()})};function A3(t,e){Jv(t)&&(_3()||yd.push({content:t,options:e}),gi.forEach(n=>{n.buildToast(t,e)}))}function x7(t){var e;(e=gi.get(t.containerId||1))==null||e.setToggle(t.id,t.fn)}function N3(t,e){gi.forEach(n=>{(e==null||!(e!=null&&e.containerId)||(e==null?void 0:e.containerId)===n.id)&&n.toggle(t,e==null?void 0:e.id)})}function S7(t){let e=t.containerId||1;return{subscribe(n){let r=m7(e,t,g7);gi.set(e,r);let a=r.observe(n);return v7(),()=>{a(),gi.delete(e)}},setProps(n){var r;(r=gi.get(e))==null||r.setProps(n)},getSnapshot(){var n;return(n=gi.get(e))==null?void 0:n.getSnapshot()}}}function _7(t){return Xv.add(t),()=>{Xv.delete(t)}}function E7(t){return t&&(dc(t.toastId)||kd(t.toastId))?t.toastId:S3()}function Dd(t,e){return A3(t,e),e.toastId}function jg(t,e){return{...e,type:e&&e.type||t,toastId:E7(e)}}function Og(t){return(e,n)=>Dd(e,jg(t,n))}function qn(t,e){return Dd(t,jg("default",e))}qn.loading=(t,e)=>Dd(t,jg("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...e}));function A7(t,{pending:e,error:n,success:r},a){let s;e&&(s=dc(e)?qn.loading(e,a):qn.loading(e.render,{...a,...e}));let l={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(h,d,m)=>{if(d==null){qn.dismiss(s);return}let y={type:h,...l,...a,data:m},g=dc(d)?{render:d}:d;return s?qn.update(s,{...y,...g}):qn(g.render,{...y,...g}),m},c=Pl(t)?t():t;return c.then(h=>u("success",r,h)).catch(h=>u("error",n,h)),c}qn.promise=A7;qn.success=Og("success");qn.info=Og("info");qn.error=Og("error");qn.warning=Og("warning");qn.warn=qn.warning;qn.dark=(t,e)=>Dd(t,jg("default",{theme:"dark",...e}));function N7(t){b7(t)}qn.dismiss=N7;qn.clearWaitingQueue=w7;qn.isActive=E3;qn.update=(t,e={})=>{let n=y7(t,e);if(n){let{props:r,content:a}=n,s={delay:100,...r,...e,toastId:e.toastId||t,updateId:S3()};s.toastId!==t&&(s.staleId=t);let l=s.render||a;delete s.render,Dd(l,s)}};qn.done=t=>{qn.update(t,{progress:1})};qn.onChange=_7;qn.play=t=>N3(!0,t);qn.pause=t=>N3(!1,t);function C7(t){var e;let{subscribe:n,getSnapshot:r,setProps:a}=D.useRef(S7(t)).current;a(t);let s=(e=D.useSyncExternalStore(n,r,r))==null?void 0:e.slice();function l(u){if(!s)return[];let c=new Map;return t.newestOnTop&&s.reverse(),s.forEach(h=>{let{position:d}=h.props;c.has(d)||c.set(d,[]),c.get(d).push(h)}),Array.from(c,h=>u(h[0],h[1]))}return{getToastToRender:l,isToastActive:E3,count:s==null?void 0:s.length}}function T7(t){let[e,n]=D.useState(!1),[r,a]=D.useState(!1),s=D.useRef(null),l=D.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:u,pauseOnHover:c,closeToast:h,onClick:d,closeOnClick:m}=t;x7({id:t.toastId,containerId:t.containerId,fn:n}),D.useEffect(()=>{if(t.pauseOnFocusLoss)return y(),()=>{g()}},[t.pauseOnFocusLoss]);function y(){document.hasFocus()||A(),window.addEventListener("focus",N),window.addEventListener("blur",A)}function g(){window.removeEventListener("focus",N),window.removeEventListener("blur",A)}function x(G){if(t.draggable===!0||t.draggable===G.pointerType){j();let P=s.current;l.canCloseOnClick=!0,l.canDrag=!0,P.style.transition="none",t.draggableDirection==="x"?(l.start=G.clientX,l.removalDistance=P.offsetWidth*(t.draggablePercent/100)):(l.start=G.clientY,l.removalDistance=P.offsetHeight*(t.draggablePercent===80?t.draggablePercent*1.5:t.draggablePercent)/100)}}function _(G){let{top:P,bottom:B,left:X,right:F}=s.current.getBoundingClientRect();G.pointerType==="mouse"&&t.pauseOnHover&&G.clientX>=X&&G.clientX<=F&&G.clientY>=P&&G.clientY<=B?A():N()}function N(){n(!0)}function A(){n(!1)}function j(){l.didMove=!1,document.addEventListener("pointermove",R),document.addEventListener("pointerup",I)}function L(){document.removeEventListener("pointermove",R),document.removeEventListener("pointerup",I)}function R(G){let P=s.current;if(l.canDrag&&P){l.didMove=!0,e&&A(),t.draggableDirection==="x"?l.delta=G.clientX-l.start:l.delta=G.clientY-l.start,l.start!==G.clientX&&(l.canCloseOnClick=!1);let B=t.draggableDirection==="x"?`${l.delta}px, var(--y)`:`0, calc(${l.delta}px + var(--y))`;P.style.transform=`translate3d(${B},0)`,P.style.opacity=`${1-Math.abs(l.delta/l.removalDistance)}`}}function I(){L();let G=s.current;if(l.canDrag&&l.didMove&&G){if(l.canDrag=!1,Math.abs(l.delta)>l.removalDistance){a(!0),t.closeToast(!0),t.collapseAll();return}G.style.transition="transform 0.2s, opacity 0.2s",G.style.removeProperty("transform"),G.style.removeProperty("opacity")}}let ee={onPointerDown:x,onPointerUp:_};return u&&c&&(ee.onMouseEnter=A,t.stacked||(ee.onMouseLeave=N)),m&&(ee.onClick=G=>{d&&d(G),l.canCloseOnClick&&h(!0)}),{playToast:N,pauseToast:A,isRunning:e,preventExitTransition:r,toastRef:s,eventHandlers:ee}}var C3=typeof window<"u"?D.useLayoutEffect:D.useEffect,Rg=({theme:t,type:e,isLoading:n,...r})=>vn.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${e})`,...r});function L7(t){return vn.createElement(Rg,{...t},vn.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function j7(t){return vn.createElement(Rg,{...t},vn.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function O7(t){return vn.createElement(Rg,{...t},vn.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function R7(t){return vn.createElement(Rg,{...t},vn.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function k7(){return vn.createElement("div",{className:"Toastify__spinner"})}var Zv={info:j7,warning:L7,success:O7,error:R7,spinner:k7},D7=t=>t in Zv;function P7({theme:t,type:e,isLoading:n,icon:r}){let a=null,s={theme:t,type:e};return r===!1||(Pl(r)?a=r({...s,isLoading:n}):D.isValidElement(r)?a=D.cloneElement(r,s):n?a=Zv.spinner():D7(e)&&(a=Zv[e](s))),a}var M7=t=>{let{isRunning:e,preventExitTransition:n,toastRef:r,eventHandlers:a,playToast:s}=T7(t),{closeButton:l,children:u,autoClose:c,onClick:h,type:d,hideProgressBar:m,closeToast:y,transition:g,position:x,className:_,style:N,progressClassName:A,updateId:j,role:L,progress:R,rtl:I,toastId:ee,deleteToast:G,isIn:P,isLoading:B,closeOnClick:X,theme:F,ariaLabel:$}=t,K=cc("Toastify__toast",`Toastify__toast-theme--${F}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":I},{"Toastify__toast--close-on-click":X}),Y=Pl(_)?_({rtl:I,position:x,type:d,defaultClassName:K}):cc(K,_),he=P7(t),te=!!R||!c,oe={closeToast:y,type:d,theme:F},le=null;return l===!1||(Pl(l)?le=l(oe):D.isValidElement(l)?le=D.cloneElement(l,oe):le=h7(oe)),vn.createElement(g,{isIn:P,done:G,position:x,preventExitTransition:n,nodeRef:r,playToast:s},vn.createElement("div",{id:ee,tabIndex:0,onClick:h,"data-in":P,className:Y,...a,style:N,ref:r,...P&&{role:L,"aria-label":$}},he!=null&&vn.createElement("div",{className:cc("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!B})},he),x3(u,t,!e),le,!t.customProgressBar&&vn.createElement(d7,{...j&&!te?{key:`p-${j}`}:{},rtl:I,theme:F,delay:c,isRunning:e,isIn:P,closeToast:y,hide:m,type:d,className:A,controlledProgress:te,progress:R||0})))},I7=(t,e=!1)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:e}),F7=f7(I7("bounce",!0)),U7={position:"top-right",transition:F7,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:t=>t.altKey&&t.code==="KeyT"};function B7(t){let e={...U7,...t},n=t.stacked,[r,a]=D.useState(!0),s=D.useRef(null),{getToastToRender:l,isToastActive:u,count:c}=C7(e),{className:h,style:d,rtl:m,containerId:y,hotKeys:g}=e;function x(N){let A=cc("Toastify__toast-container",`Toastify__toast-container--${N}`,{"Toastify__toast-container--rtl":m});return Pl(h)?h({position:N,rtl:m,defaultClassName:A}):cc(A,Kv(h))}function _(){n&&(a(!0),qn.play())}return C3(()=>{var N;if(n){let A=s.current.querySelectorAll('[data-in="true"]'),j=12,L=(N=e.position)==null?void 0:N.includes("top"),R=0,I=0;Array.from(A).reverse().forEach((ee,G)=>{let P=ee;P.classList.add("Toastify__toast--stacked"),G>0&&(P.dataset.collapsed=`${r}`),P.dataset.pos||(P.dataset.pos=L?"top":"bot");let B=R*(r?.2:1)+(r?0:j*G),X=Math.max(.5,1-(r?I:0));P.style.setProperty("--y",`${L?B:B*-1}px`),P.style.setProperty("--g",`${j}`),P.style.setProperty("--s",`${X}`),R+=P.offsetHeight,I+=.025})}},[r,c,n]),D.useEffect(()=>{function N(A){var j;let L=s.current;g(A)&&((j=L==null?void 0:L.querySelector('[tabIndex="0"]'))==null||j.focus(),a(!1),qn.pause()),A.key==="Escape"&&(document.activeElement===L||L!=null&&L.contains(document.activeElement))&&(a(!0),qn.play())}return document.addEventListener("keydown",N),()=>{document.removeEventListener("keydown",N)}},[g]),vn.createElement("section",{ref:s,className:"Toastify",id:y,onMouseEnter:()=>{n&&(a(!1),qn.pause())},onMouseLeave:_,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":e["aria-label"]},l((N,A)=>{let j=A.length?{...d}:{...d,pointerEvents:"none"};return vn.createElement("div",{tabIndex:-1,className:x(N),"data-stacked":n,style:j,key:`c-${N}`},A.map(({content:L,props:R})=>vn.createElement(M7,{...R,stacked:n,collapseAll:_,isIn:u(R.toastId,R.containerId),key:`t-${R.key}`},L)))}))}var $7=`:root {
|
|
105
|
+
--toastify-color-light: #fff;
|
|
106
|
+
--toastify-color-dark: #121212;
|
|
107
|
+
--toastify-color-info: #3498db;
|
|
108
|
+
--toastify-color-success: #07bc0c;
|
|
109
|
+
--toastify-color-warning: #f1c40f;
|
|
110
|
+
--toastify-color-error: hsl(6, 78%, 57%);
|
|
111
|
+
--toastify-color-transparent: rgba(255, 255, 255, 0.7);
|
|
112
|
+
|
|
113
|
+
--toastify-icon-color-info: var(--toastify-color-info);
|
|
114
|
+
--toastify-icon-color-success: var(--toastify-color-success);
|
|
115
|
+
--toastify-icon-color-warning: var(--toastify-color-warning);
|
|
116
|
+
--toastify-icon-color-error: var(--toastify-color-error);
|
|
117
|
+
|
|
118
|
+
--toastify-container-width: fit-content;
|
|
119
|
+
--toastify-toast-width: 320px;
|
|
120
|
+
--toastify-toast-offset: 16px;
|
|
121
|
+
--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));
|
|
122
|
+
--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));
|
|
123
|
+
--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));
|
|
124
|
+
--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));
|
|
125
|
+
--toastify-toast-background: #fff;
|
|
126
|
+
--toastify-toast-padding: 14px;
|
|
127
|
+
--toastify-toast-min-height: 64px;
|
|
128
|
+
--toastify-toast-max-height: 800px;
|
|
129
|
+
--toastify-toast-bd-radius: 6px;
|
|
130
|
+
--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);
|
|
131
|
+
--toastify-font-family: sans-serif;
|
|
132
|
+
--toastify-z-index: 9999;
|
|
133
|
+
--toastify-text-color-light: #757575;
|
|
134
|
+
--toastify-text-color-dark: #fff;
|
|
135
|
+
|
|
136
|
+
/* Used only for colored theme */
|
|
137
|
+
--toastify-text-color-info: #fff;
|
|
138
|
+
--toastify-text-color-success: #fff;
|
|
139
|
+
--toastify-text-color-warning: #fff;
|
|
140
|
+
--toastify-text-color-error: #fff;
|
|
141
|
+
|
|
142
|
+
--toastify-spinner-color: #616161;
|
|
143
|
+
--toastify-spinner-color-empty-area: #e0e0e0;
|
|
144
|
+
--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);
|
|
145
|
+
--toastify-color-progress-dark: #bb86fc;
|
|
146
|
+
--toastify-color-progress-info: var(--toastify-color-info);
|
|
147
|
+
--toastify-color-progress-success: var(--toastify-color-success);
|
|
148
|
+
--toastify-color-progress-warning: var(--toastify-color-warning);
|
|
149
|
+
--toastify-color-progress-error: var(--toastify-color-error);
|
|
150
|
+
/* used to control the opacity of the progress trail */
|
|
151
|
+
--toastify-color-progress-bgo: 0.2;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.Toastify__toast-container {
|
|
155
|
+
z-index: var(--toastify-z-index);
|
|
156
|
+
-webkit-transform: translate3d(0, 0, var(--toastify-z-index));
|
|
157
|
+
position: fixed;
|
|
158
|
+
width: var(--toastify-container-width);
|
|
159
|
+
box-sizing: border-box;
|
|
160
|
+
color: #fff;
|
|
161
|
+
display: flex;
|
|
162
|
+
flex-direction: column;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.Toastify__toast-container--top-left {
|
|
166
|
+
top: var(--toastify-toast-top);
|
|
167
|
+
left: var(--toastify-toast-left);
|
|
168
|
+
}
|
|
169
|
+
.Toastify__toast-container--top-center {
|
|
170
|
+
top: var(--toastify-toast-top);
|
|
171
|
+
left: 50%;
|
|
172
|
+
transform: translateX(-50%);
|
|
173
|
+
align-items: center;
|
|
174
|
+
}
|
|
175
|
+
.Toastify__toast-container--top-right {
|
|
176
|
+
top: var(--toastify-toast-top);
|
|
177
|
+
right: var(--toastify-toast-right);
|
|
178
|
+
align-items: end;
|
|
179
|
+
}
|
|
180
|
+
.Toastify__toast-container--bottom-left {
|
|
181
|
+
bottom: var(--toastify-toast-bottom);
|
|
182
|
+
left: var(--toastify-toast-left);
|
|
183
|
+
}
|
|
184
|
+
.Toastify__toast-container--bottom-center {
|
|
185
|
+
bottom: var(--toastify-toast-bottom);
|
|
186
|
+
left: 50%;
|
|
187
|
+
transform: translateX(-50%);
|
|
188
|
+
align-items: center;
|
|
189
|
+
}
|
|
190
|
+
.Toastify__toast-container--bottom-right {
|
|
191
|
+
bottom: var(--toastify-toast-bottom);
|
|
192
|
+
right: var(--toastify-toast-right);
|
|
193
|
+
align-items: end;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.Toastify__toast {
|
|
197
|
+
--y: 0px;
|
|
198
|
+
position: relative;
|
|
199
|
+
touch-action: none;
|
|
200
|
+
width: var(--toastify-toast-width);
|
|
201
|
+
min-height: var(--toastify-toast-min-height);
|
|
202
|
+
box-sizing: border-box;
|
|
203
|
+
margin-bottom: 1rem;
|
|
204
|
+
padding: var(--toastify-toast-padding);
|
|
205
|
+
border-radius: var(--toastify-toast-bd-radius);
|
|
206
|
+
box-shadow: var(--toastify-toast-shadow);
|
|
207
|
+
max-height: var(--toastify-toast-max-height);
|
|
208
|
+
font-family: var(--toastify-font-family);
|
|
209
|
+
/* webkit only issue #791 */
|
|
210
|
+
z-index: 0;
|
|
211
|
+
/* inner swag */
|
|
212
|
+
display: flex;
|
|
213
|
+
flex: 1 auto;
|
|
214
|
+
align-items: center;
|
|
215
|
+
word-break: break-word;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
@media only screen and (max-width: 480px) {
|
|
219
|
+
.Toastify__toast-container {
|
|
220
|
+
width: 100vw;
|
|
221
|
+
left: env(safe-area-inset-left);
|
|
222
|
+
margin: 0;
|
|
223
|
+
}
|
|
224
|
+
.Toastify__toast-container--top-left,
|
|
225
|
+
.Toastify__toast-container--top-center,
|
|
226
|
+
.Toastify__toast-container--top-right {
|
|
227
|
+
top: env(safe-area-inset-top);
|
|
228
|
+
transform: translateX(0);
|
|
229
|
+
}
|
|
230
|
+
.Toastify__toast-container--bottom-left,
|
|
231
|
+
.Toastify__toast-container--bottom-center,
|
|
232
|
+
.Toastify__toast-container--bottom-right {
|
|
233
|
+
bottom: env(safe-area-inset-bottom);
|
|
234
|
+
transform: translateX(0);
|
|
235
|
+
}
|
|
236
|
+
.Toastify__toast-container--rtl {
|
|
237
|
+
right: env(safe-area-inset-right);
|
|
238
|
+
left: initial;
|
|
239
|
+
}
|
|
240
|
+
.Toastify__toast {
|
|
241
|
+
--toastify-toast-width: 100%;
|
|
242
|
+
margin-bottom: 0;
|
|
243
|
+
border-radius: 0;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.Toastify__toast-container[data-stacked='true'] {
|
|
248
|
+
width: var(--toastify-toast-width);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
@media only screen and (max-width: 480px) {
|
|
252
|
+
.Toastify__toast-container[data-stacked='true'] {
|
|
253
|
+
width: 100vw;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.Toastify__toast--stacked {
|
|
258
|
+
position: absolute;
|
|
259
|
+
width: 100%;
|
|
260
|
+
transform: translate3d(0, var(--y), 0) scale(var(--s));
|
|
261
|
+
transition: transform 0.3s;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,
|
|
265
|
+
.Toastify__toast--stacked[data-collapsed] .Toastify__close-button {
|
|
266
|
+
transition: opacity 0.1s;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.Toastify__toast--stacked[data-collapsed='false'] {
|
|
270
|
+
overflow: visible;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
.Toastify__toast--stacked[data-collapsed='true']:not(:last-child) > * {
|
|
274
|
+
opacity: 0;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.Toastify__toast--stacked:after {
|
|
278
|
+
content: '';
|
|
279
|
+
position: absolute;
|
|
280
|
+
left: 0;
|
|
281
|
+
right: 0;
|
|
282
|
+
height: calc(var(--g) * 1px);
|
|
283
|
+
bottom: 100%;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.Toastify__toast--stacked[data-pos='top'] {
|
|
287
|
+
top: 0;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.Toastify__toast--stacked[data-pos='bot'] {
|
|
291
|
+
bottom: 0;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.Toastify__toast--stacked[data-pos='bot'].Toastify__toast--stacked:before {
|
|
295
|
+
transform-origin: top;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.Toastify__toast--stacked[data-pos='top'].Toastify__toast--stacked:before {
|
|
299
|
+
transform-origin: bottom;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.Toastify__toast--stacked:before {
|
|
303
|
+
content: '';
|
|
304
|
+
position: absolute;
|
|
305
|
+
left: 0;
|
|
306
|
+
right: 0;
|
|
307
|
+
bottom: 0;
|
|
308
|
+
height: 100%;
|
|
309
|
+
transform: scaleY(3);
|
|
310
|
+
z-index: -1;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.Toastify__toast--rtl {
|
|
314
|
+
direction: rtl;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.Toastify__toast--close-on-click {
|
|
318
|
+
cursor: pointer;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.Toastify__toast-icon {
|
|
322
|
+
margin-inline-end: 10px;
|
|
323
|
+
width: 22px;
|
|
324
|
+
flex-shrink: 0;
|
|
325
|
+
display: flex;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.Toastify--animate {
|
|
329
|
+
animation-fill-mode: both;
|
|
330
|
+
animation-duration: 0.5s;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
.Toastify--animate-icon {
|
|
334
|
+
animation-fill-mode: both;
|
|
335
|
+
animation-duration: 0.3s;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.Toastify__toast-theme--dark {
|
|
339
|
+
background: var(--toastify-color-dark);
|
|
340
|
+
color: var(--toastify-text-color-dark);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
.Toastify__toast-theme--light {
|
|
344
|
+
background: var(--toastify-color-light);
|
|
345
|
+
color: var(--toastify-text-color-light);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.Toastify__toast-theme--colored.Toastify__toast--default {
|
|
349
|
+
background: var(--toastify-color-light);
|
|
350
|
+
color: var(--toastify-text-color-light);
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
.Toastify__toast-theme--colored.Toastify__toast--info {
|
|
354
|
+
color: var(--toastify-text-color-info);
|
|
355
|
+
background: var(--toastify-color-info);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.Toastify__toast-theme--colored.Toastify__toast--success {
|
|
359
|
+
color: var(--toastify-text-color-success);
|
|
360
|
+
background: var(--toastify-color-success);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.Toastify__toast-theme--colored.Toastify__toast--warning {
|
|
364
|
+
color: var(--toastify-text-color-warning);
|
|
365
|
+
background: var(--toastify-color-warning);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
.Toastify__toast-theme--colored.Toastify__toast--error {
|
|
369
|
+
color: var(--toastify-text-color-error);
|
|
370
|
+
background: var(--toastify-color-error);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.Toastify__progress-bar-theme--light {
|
|
374
|
+
background: var(--toastify-color-progress-light);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
.Toastify__progress-bar-theme--dark {
|
|
378
|
+
background: var(--toastify-color-progress-dark);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.Toastify__progress-bar--info {
|
|
382
|
+
background: var(--toastify-color-progress-info);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
.Toastify__progress-bar--success {
|
|
386
|
+
background: var(--toastify-color-progress-success);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
.Toastify__progress-bar--warning {
|
|
390
|
+
background: var(--toastify-color-progress-warning);
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.Toastify__progress-bar--error {
|
|
394
|
+
background: var(--toastify-color-progress-error);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,
|
|
398
|
+
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,
|
|
399
|
+
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,
|
|
400
|
+
.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error {
|
|
401
|
+
background: var(--toastify-color-transparent);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.Toastify__close-button {
|
|
405
|
+
color: #fff;
|
|
406
|
+
position: absolute;
|
|
407
|
+
top: 6px;
|
|
408
|
+
right: 6px;
|
|
409
|
+
background: transparent;
|
|
410
|
+
outline: none;
|
|
411
|
+
border: none;
|
|
412
|
+
padding: 0;
|
|
413
|
+
cursor: pointer;
|
|
414
|
+
opacity: 0.7;
|
|
415
|
+
transition: 0.3s ease;
|
|
416
|
+
z-index: 1;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
.Toastify__toast--rtl .Toastify__close-button {
|
|
420
|
+
left: 6px;
|
|
421
|
+
right: unset;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
.Toastify__close-button--light {
|
|
425
|
+
color: #000;
|
|
426
|
+
opacity: 0.3;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.Toastify__close-button > svg {
|
|
430
|
+
fill: currentColor;
|
|
431
|
+
height: 16px;
|
|
432
|
+
width: 14px;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.Toastify__close-button:hover,
|
|
436
|
+
.Toastify__close-button:focus {
|
|
437
|
+
opacity: 1;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
@keyframes Toastify__trackProgress {
|
|
441
|
+
0% {
|
|
442
|
+
transform: scaleX(1);
|
|
443
|
+
}
|
|
444
|
+
100% {
|
|
445
|
+
transform: scaleX(0);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
.Toastify__progress-bar {
|
|
450
|
+
position: absolute;
|
|
451
|
+
bottom: 0;
|
|
452
|
+
left: 0;
|
|
453
|
+
width: 100%;
|
|
454
|
+
height: 100%;
|
|
455
|
+
z-index: 1;
|
|
456
|
+
opacity: 0.7;
|
|
457
|
+
transform-origin: left;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
.Toastify__progress-bar--animated {
|
|
461
|
+
animation: Toastify__trackProgress linear 1 forwards;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.Toastify__progress-bar--controlled {
|
|
465
|
+
transition: transform 0.2s;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.Toastify__progress-bar--rtl {
|
|
469
|
+
right: 0;
|
|
470
|
+
left: initial;
|
|
471
|
+
transform-origin: right;
|
|
472
|
+
border-bottom-left-radius: initial;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
.Toastify__progress-bar--wrp {
|
|
476
|
+
position: absolute;
|
|
477
|
+
overflow: hidden;
|
|
478
|
+
bottom: 0;
|
|
479
|
+
left: 0;
|
|
480
|
+
width: 100%;
|
|
481
|
+
height: 5px;
|
|
482
|
+
border-bottom-left-radius: var(--toastify-toast-bd-radius);
|
|
483
|
+
border-bottom-right-radius: var(--toastify-toast-bd-radius);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
.Toastify__progress-bar--wrp[data-hidden='true'] {
|
|
487
|
+
opacity: 0;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.Toastify__progress-bar--bg {
|
|
491
|
+
opacity: var(--toastify-color-progress-bgo);
|
|
492
|
+
width: 100%;
|
|
493
|
+
height: 100%;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
.Toastify__spinner {
|
|
497
|
+
width: 20px;
|
|
498
|
+
height: 20px;
|
|
499
|
+
box-sizing: border-box;
|
|
500
|
+
border: 2px solid;
|
|
501
|
+
border-radius: 100%;
|
|
502
|
+
border-color: var(--toastify-spinner-color-empty-area);
|
|
503
|
+
border-right-color: var(--toastify-spinner-color);
|
|
504
|
+
animation: Toastify__spin 0.65s linear infinite;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
@keyframes Toastify__bounceInRight {
|
|
508
|
+
from,
|
|
509
|
+
60%,
|
|
510
|
+
75%,
|
|
511
|
+
90%,
|
|
512
|
+
to {
|
|
513
|
+
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
514
|
+
}
|
|
515
|
+
from {
|
|
516
|
+
opacity: 0;
|
|
517
|
+
transform: translate3d(3000px, 0, 0);
|
|
518
|
+
}
|
|
519
|
+
60% {
|
|
520
|
+
opacity: 1;
|
|
521
|
+
transform: translate3d(-25px, 0, 0);
|
|
522
|
+
}
|
|
523
|
+
75% {
|
|
524
|
+
transform: translate3d(10px, 0, 0);
|
|
525
|
+
}
|
|
526
|
+
90% {
|
|
527
|
+
transform: translate3d(-5px, 0, 0);
|
|
528
|
+
}
|
|
529
|
+
to {
|
|
530
|
+
transform: none;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
@keyframes Toastify__bounceOutRight {
|
|
535
|
+
20% {
|
|
536
|
+
opacity: 1;
|
|
537
|
+
transform: translate3d(-20px, var(--y), 0);
|
|
538
|
+
}
|
|
539
|
+
to {
|
|
540
|
+
opacity: 0;
|
|
541
|
+
transform: translate3d(2000px, var(--y), 0);
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
@keyframes Toastify__bounceInLeft {
|
|
546
|
+
from,
|
|
547
|
+
60%,
|
|
548
|
+
75%,
|
|
549
|
+
90%,
|
|
550
|
+
to {
|
|
551
|
+
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
552
|
+
}
|
|
553
|
+
0% {
|
|
554
|
+
opacity: 0;
|
|
555
|
+
transform: translate3d(-3000px, 0, 0);
|
|
556
|
+
}
|
|
557
|
+
60% {
|
|
558
|
+
opacity: 1;
|
|
559
|
+
transform: translate3d(25px, 0, 0);
|
|
560
|
+
}
|
|
561
|
+
75% {
|
|
562
|
+
transform: translate3d(-10px, 0, 0);
|
|
563
|
+
}
|
|
564
|
+
90% {
|
|
565
|
+
transform: translate3d(5px, 0, 0);
|
|
566
|
+
}
|
|
567
|
+
to {
|
|
568
|
+
transform: none;
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
@keyframes Toastify__bounceOutLeft {
|
|
573
|
+
20% {
|
|
574
|
+
opacity: 1;
|
|
575
|
+
transform: translate3d(20px, var(--y), 0);
|
|
576
|
+
}
|
|
577
|
+
to {
|
|
578
|
+
opacity: 0;
|
|
579
|
+
transform: translate3d(-2000px, var(--y), 0);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
@keyframes Toastify__bounceInUp {
|
|
584
|
+
from,
|
|
585
|
+
60%,
|
|
586
|
+
75%,
|
|
587
|
+
90%,
|
|
588
|
+
to {
|
|
589
|
+
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
590
|
+
}
|
|
591
|
+
from {
|
|
592
|
+
opacity: 0;
|
|
593
|
+
transform: translate3d(0, 3000px, 0);
|
|
594
|
+
}
|
|
595
|
+
60% {
|
|
596
|
+
opacity: 1;
|
|
597
|
+
transform: translate3d(0, -20px, 0);
|
|
598
|
+
}
|
|
599
|
+
75% {
|
|
600
|
+
transform: translate3d(0, 10px, 0);
|
|
601
|
+
}
|
|
602
|
+
90% {
|
|
603
|
+
transform: translate3d(0, -5px, 0);
|
|
604
|
+
}
|
|
605
|
+
to {
|
|
606
|
+
transform: translate3d(0, 0, 0);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
@keyframes Toastify__bounceOutUp {
|
|
611
|
+
20% {
|
|
612
|
+
transform: translate3d(0, calc(var(--y) - 10px), 0);
|
|
613
|
+
}
|
|
614
|
+
40%,
|
|
615
|
+
45% {
|
|
616
|
+
opacity: 1;
|
|
617
|
+
transform: translate3d(0, calc(var(--y) + 20px), 0);
|
|
618
|
+
}
|
|
619
|
+
to {
|
|
620
|
+
opacity: 0;
|
|
621
|
+
transform: translate3d(0, -2000px, 0);
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
@keyframes Toastify__bounceInDown {
|
|
626
|
+
from,
|
|
627
|
+
60%,
|
|
628
|
+
75%,
|
|
629
|
+
90%,
|
|
630
|
+
to {
|
|
631
|
+
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
632
|
+
}
|
|
633
|
+
0% {
|
|
634
|
+
opacity: 0;
|
|
635
|
+
transform: translate3d(0, -3000px, 0);
|
|
636
|
+
}
|
|
637
|
+
60% {
|
|
638
|
+
opacity: 1;
|
|
639
|
+
transform: translate3d(0, 25px, 0);
|
|
640
|
+
}
|
|
641
|
+
75% {
|
|
642
|
+
transform: translate3d(0, -10px, 0);
|
|
643
|
+
}
|
|
644
|
+
90% {
|
|
645
|
+
transform: translate3d(0, 5px, 0);
|
|
646
|
+
}
|
|
647
|
+
to {
|
|
648
|
+
transform: none;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
@keyframes Toastify__bounceOutDown {
|
|
653
|
+
20% {
|
|
654
|
+
transform: translate3d(0, calc(var(--y) - 10px), 0);
|
|
655
|
+
}
|
|
656
|
+
40%,
|
|
657
|
+
45% {
|
|
658
|
+
opacity: 1;
|
|
659
|
+
transform: translate3d(0, calc(var(--y) + 20px), 0);
|
|
660
|
+
}
|
|
661
|
+
to {
|
|
662
|
+
opacity: 0;
|
|
663
|
+
transform: translate3d(0, 2000px, 0);
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
.Toastify__bounce-enter--top-left,
|
|
668
|
+
.Toastify__bounce-enter--bottom-left {
|
|
669
|
+
animation-name: Toastify__bounceInLeft;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
.Toastify__bounce-enter--top-right,
|
|
673
|
+
.Toastify__bounce-enter--bottom-right {
|
|
674
|
+
animation-name: Toastify__bounceInRight;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
.Toastify__bounce-enter--top-center {
|
|
678
|
+
animation-name: Toastify__bounceInDown;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
.Toastify__bounce-enter--bottom-center {
|
|
682
|
+
animation-name: Toastify__bounceInUp;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
.Toastify__bounce-exit--top-left,
|
|
686
|
+
.Toastify__bounce-exit--bottom-left {
|
|
687
|
+
animation-name: Toastify__bounceOutLeft;
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
.Toastify__bounce-exit--top-right,
|
|
691
|
+
.Toastify__bounce-exit--bottom-right {
|
|
692
|
+
animation-name: Toastify__bounceOutRight;
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
.Toastify__bounce-exit--top-center {
|
|
696
|
+
animation-name: Toastify__bounceOutUp;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
.Toastify__bounce-exit--bottom-center {
|
|
700
|
+
animation-name: Toastify__bounceOutDown;
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
@keyframes Toastify__zoomIn {
|
|
704
|
+
from {
|
|
705
|
+
opacity: 0;
|
|
706
|
+
transform: scale3d(0.3, 0.3, 0.3);
|
|
707
|
+
}
|
|
708
|
+
50% {
|
|
709
|
+
opacity: 1;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
@keyframes Toastify__zoomOut {
|
|
714
|
+
from {
|
|
715
|
+
opacity: 1;
|
|
716
|
+
}
|
|
717
|
+
50% {
|
|
718
|
+
opacity: 0;
|
|
719
|
+
transform: translate3d(0, var(--y), 0) scale3d(0.3, 0.3, 0.3);
|
|
720
|
+
}
|
|
721
|
+
to {
|
|
722
|
+
opacity: 0;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.Toastify__zoom-enter {
|
|
727
|
+
animation-name: Toastify__zoomIn;
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
.Toastify__zoom-exit {
|
|
731
|
+
animation-name: Toastify__zoomOut;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
@keyframes Toastify__flipIn {
|
|
735
|
+
from {
|
|
736
|
+
transform: perspective(400px) rotate3d(1, 0, 0, 90deg);
|
|
737
|
+
animation-timing-function: ease-in;
|
|
738
|
+
opacity: 0;
|
|
739
|
+
}
|
|
740
|
+
40% {
|
|
741
|
+
transform: perspective(400px) rotate3d(1, 0, 0, -20deg);
|
|
742
|
+
animation-timing-function: ease-in;
|
|
743
|
+
}
|
|
744
|
+
60% {
|
|
745
|
+
transform: perspective(400px) rotate3d(1, 0, 0, 10deg);
|
|
746
|
+
opacity: 1;
|
|
747
|
+
}
|
|
748
|
+
80% {
|
|
749
|
+
transform: perspective(400px) rotate3d(1, 0, 0, -5deg);
|
|
750
|
+
}
|
|
751
|
+
to {
|
|
752
|
+
transform: perspective(400px);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
@keyframes Toastify__flipOut {
|
|
757
|
+
from {
|
|
758
|
+
transform: translate3d(0, var(--y), 0) perspective(400px);
|
|
759
|
+
}
|
|
760
|
+
30% {
|
|
761
|
+
transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, -20deg);
|
|
762
|
+
opacity: 1;
|
|
763
|
+
}
|
|
764
|
+
to {
|
|
765
|
+
transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, 90deg);
|
|
766
|
+
opacity: 0;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.Toastify__flip-enter {
|
|
771
|
+
animation-name: Toastify__flipIn;
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
.Toastify__flip-exit {
|
|
775
|
+
animation-name: Toastify__flipOut;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
@keyframes Toastify__slideInRight {
|
|
779
|
+
from {
|
|
780
|
+
transform: translate3d(110%, 0, 0);
|
|
781
|
+
visibility: visible;
|
|
782
|
+
}
|
|
783
|
+
to {
|
|
784
|
+
transform: translate3d(0, var(--y), 0);
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
@keyframes Toastify__slideInLeft {
|
|
789
|
+
from {
|
|
790
|
+
transform: translate3d(-110%, 0, 0);
|
|
791
|
+
visibility: visible;
|
|
792
|
+
}
|
|
793
|
+
to {
|
|
794
|
+
transform: translate3d(0, var(--y), 0);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
@keyframes Toastify__slideInUp {
|
|
799
|
+
from {
|
|
800
|
+
transform: translate3d(0, 110%, 0);
|
|
801
|
+
visibility: visible;
|
|
802
|
+
}
|
|
803
|
+
to {
|
|
804
|
+
transform: translate3d(0, var(--y), 0);
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
@keyframes Toastify__slideInDown {
|
|
809
|
+
from {
|
|
810
|
+
transform: translate3d(0, -110%, 0);
|
|
811
|
+
visibility: visible;
|
|
812
|
+
}
|
|
813
|
+
to {
|
|
814
|
+
transform: translate3d(0, var(--y), 0);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
@keyframes Toastify__slideOutRight {
|
|
819
|
+
from {
|
|
820
|
+
transform: translate3d(0, var(--y), 0);
|
|
821
|
+
}
|
|
822
|
+
to {
|
|
823
|
+
visibility: hidden;
|
|
824
|
+
transform: translate3d(110%, var(--y), 0);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
@keyframes Toastify__slideOutLeft {
|
|
829
|
+
from {
|
|
830
|
+
transform: translate3d(0, var(--y), 0);
|
|
831
|
+
}
|
|
832
|
+
to {
|
|
833
|
+
visibility: hidden;
|
|
834
|
+
transform: translate3d(-110%, var(--y), 0);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
@keyframes Toastify__slideOutDown {
|
|
839
|
+
from {
|
|
840
|
+
transform: translate3d(0, var(--y), 0);
|
|
841
|
+
}
|
|
842
|
+
to {
|
|
843
|
+
visibility: hidden;
|
|
844
|
+
transform: translate3d(0, 500px, 0);
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
@keyframes Toastify__slideOutUp {
|
|
849
|
+
from {
|
|
850
|
+
transform: translate3d(0, var(--y), 0);
|
|
851
|
+
}
|
|
852
|
+
to {
|
|
853
|
+
visibility: hidden;
|
|
854
|
+
transform: translate3d(0, -500px, 0);
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
.Toastify__slide-enter--top-left,
|
|
859
|
+
.Toastify__slide-enter--bottom-left {
|
|
860
|
+
animation-name: Toastify__slideInLeft;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
.Toastify__slide-enter--top-right,
|
|
864
|
+
.Toastify__slide-enter--bottom-right {
|
|
865
|
+
animation-name: Toastify__slideInRight;
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
.Toastify__slide-enter--top-center {
|
|
869
|
+
animation-name: Toastify__slideInDown;
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
.Toastify__slide-enter--bottom-center {
|
|
873
|
+
animation-name: Toastify__slideInUp;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
.Toastify__slide-exit--top-left,
|
|
877
|
+
.Toastify__slide-exit--bottom-left {
|
|
878
|
+
animation-name: Toastify__slideOutLeft;
|
|
879
|
+
animation-timing-function: ease-in;
|
|
880
|
+
animation-duration: 0.3s;
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.Toastify__slide-exit--top-right,
|
|
884
|
+
.Toastify__slide-exit--bottom-right {
|
|
885
|
+
animation-name: Toastify__slideOutRight;
|
|
886
|
+
animation-timing-function: ease-in;
|
|
887
|
+
animation-duration: 0.3s;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
.Toastify__slide-exit--top-center {
|
|
891
|
+
animation-name: Toastify__slideOutUp;
|
|
892
|
+
animation-timing-function: ease-in;
|
|
893
|
+
animation-duration: 0.3s;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
.Toastify__slide-exit--bottom-center {
|
|
897
|
+
animation-name: Toastify__slideOutDown;
|
|
898
|
+
animation-timing-function: ease-in;
|
|
899
|
+
animation-duration: 0.3s;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
@keyframes Toastify__spin {
|
|
903
|
+
from {
|
|
904
|
+
transform: rotate(0deg);
|
|
905
|
+
}
|
|
906
|
+
to {
|
|
907
|
+
transform: rotate(360deg);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
`,wx=new Map,z7=(t,e)=>{C3(()=>{if(typeof document>"u")return;let n=document,r=wx.get(n);if(r){e&&r.setAttribute("nonce",e);return}let a=n.createElement("style");a.textContent=t,e&&a.setAttribute("nonce",e),n.head.appendChild(a),wx.set(n,a)},[e])};function q7(t){return z7($7,t.nonce),vn.createElement(B7,{...t})}const Rn=(t,e)=>{const n=`${t}:${e}`;if(qn.isActive(n))return;const r={position:"bottom-left",autoClose:5e3,toastId:n};switch(t){case"success":qn.success(e,r);break;case"warning":qn.warn(e,r);break;case"error":qn.error(e,r);break;default:qn.info(e,r)}},aa=async(t,e={})=>{const n={message:t.message||String(t),stack:t.stack||null,context:e,url:typeof window<"u"?window.location.href:null,useragent:typeof navigator<"u"?navigator.userAgent:null,created_at:new Date().toISOString()};try{const{error:r}=await ot.from("logs").insert([n]);r&&console.error("Supabase insert error:",r)}catch(r){console.error("Failed to send log:",r)}},Hy=async(t,e)=>{try{if(t){const{data:n,error:r}=await ot.from("mosque_t").select("*").eq("organisasjonsnummer",t).single();if(!n)throw new Error("Mosque not found");if(r)throw r;return n}else if(e){const{data:n,error:r}=await ot.from("location_t").select("asr_method, prayer_method").eq("location_iso",e).single();if(r)throw r;return n}}catch(n){return console.log("Error fetching mosque data: ",n),null}},H7=async t=>{try{const{data:e,error:n}=await ot.from("location_postnumber").select("post_no").eq("location_iso",t);if(n)return console.error(`Error fetching post ids of location ${t}: `,n.message),await aa(n,{message:`Error fetching post ids of location ${t}:`,function:"fetchMosquesInALocation"}),Rn("error","Error fetching post ids"),null;if(!e||e.length===0)return[];const r=e.map(d=>d.post_no),{data:a,error:s}=await ot.from("mosque_t").select("organisasjonsnummer, reg_navn, org_name2, post_no, reg_postnummer").order("org_name2");if(s)return console.error("Error fetching mosques: ",s.message),await aa(s,{message:"Error fetching mosques"}),Rn("error","Error fetching mosques"),null;const l=a.filter(d=>r.includes(d.reg_postnummer||d.post_no)),u=a.filter(d=>!r.includes(d.reg_postnummer||d.post_no)),c=l.map(d=>({id:d.organisasjonsnummer,name:d.reg_navn||d.org_name2})),h=u.map(d=>({id:d.organisasjonsnummer,name:d.reg_navn||d.org_name2}));return[...c,{name:"Other Masjids",id:"",isDisabled:!0},...h]}catch(e){return console.error(`Some error occurred while fetching mosques in location ${t}: `,e.message),await aa(e,{message:`Some error occurred while fetching mosques in location: ${t}`,function:"fetchMosquesInALocation"}),Rn("error","Unexpected error occurred while fetching mosques"),null}},V7=async t=>{try{const{data:e,error:n}=await ot.from("mosque_t").select("org_name2, reg_navn").eq("organisasjonsnummer",t).single();if(n)throw n;return{value:t,label:e.org_name2||e.reg_navn}}catch(e){console.log(e)}};function Pd(t){const[e,n]=D.useState(""),[r,a]=D.useState(""),[s,l]=D.useState(""),[u,c]=D.useState(""),[h,d]=D.useState(""),[m,y]=D.useState(""),[g,x]=D.useState(""),[_,N]=D.useState(""),[A,j]=D.useState(""),[L,R]=D.useState(!0),I=(G,P,B)=>{const X=[],F=G==null?void 0:G.trim();F&&X.push(F);const $=[];return P!=null&&P.trim()&&$.push(P.trim()),B!=null&&B.trim()&&$.push(B.trim()),$.length>0&&X.push($.join(" ")),X.join(", ")},ee=G=>{const P=B=>{const X=G[B];return typeof X=="string"?X:""};return P("reg_hjemmeside")||P("homepage")||""};return D.useEffect(()=>{if(!t){R(!1);return}R(!0);const G=async()=>{var X,F,$,K;if(!navigator.onLine){const Y=await yx(t);if(Y){n(Y.org_name2||Y.reg_navn||""),a(Y.logo||""),c(ee(Y)),d(Y.post_name||((X=Y.postData)==null?void 0:X.post_name)||""),l(I(Y.reg_adresse||Y.address||"",Y.post_no||Y.reg_postnummer||"",Y.post_name||((F=Y.postData)==null?void 0:F.post_name)||"")),y(Y.contact_name||""),x(Y.reg_mobil||Y.contact_phone||""),N(Y.reg_epostadresse||Y.contact_email||""),j(Y.org_info||""),R(!1);return}}try{const Y=await Hy(t);if(!Y)n(""),a(""),y(""),x(""),N("");else{if(n(Y.org_name2||Y.reg_navn||""),c(ee(Y)),y(Y.contact_name||""),x(Y.reg_mobil||Y.contact_phone||""),N(Y.reg_epostadresse||Y.contact_email||""),j(Y.org_info||""),Y.logo)a(Y.logo);else{const{data:oe,error:le}=await ot.from("mosque_t").select("logo").eq("organisasjonsnummer",982842840).single();if(le)throw Error(le.message);a(oe.logo)}const{data:he,error:te}=await ot.from("location_postnumber").select("post_name").eq("post_no",Y.reg_postnummer||Y.post_no).single();te?(console.error("Error fetching post info: ",te),await aa(te,{message:"Error fetching post info",function:"useMasjidInfo"}),Rn("error","Error fetching post info"),l(I(Y.reg_adresse||Y.address||"",Y.post_no||Y.reg_postnummer||"",""))):(d(he.post_name),l(I(Y.reg_adresse||Y.address||"",Y.post_no||Y.reg_postnummer||"",he.post_name))),await o7(t,{...Y,postData:he})}}catch(Y){console.error("Error fetching mosque info:",Y);const he=await yx(t);he?(n(he.org_name2||""),a(he.logo||""),c(ee(he)),d(he.post_name||(($=he.postData)==null?void 0:$.post_name)||""),l(I(he.reg_adresse||he.address||"",he.post_no||he.reg_postnummer||"",he.post_name||((K=he.postData)==null?void 0:K.post_name)||"")),y(he.contact_name||""),x(he.reg_mobil||he.contact_phone||""),N(he.reg_epostadresse||he.contact_email||""),j(he.org_info||"")):(n(""),a(""),l(""),d(""),y(""),x(""),N(""),j(""))}finally{R(!1)}};G();const P=`masjid_info_changes:${t}:${Date.now()}:${Math.random().toString(36).slice(2)}`,B=ot.channel(P).on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${t}`},()=>{G()}).subscribe();return()=>{ot.removeChannel(B)}},[t]),{masjidName:e,masjidLogo:r,masjidAddress:s,masjidWebsite:u,masjidPostName:h,contactName:m,masjidContact:g,masjidEmail:_,masjidInfo:A,loading:L}}function zo({hijriDayObj:t,language:e="en",t:n,hijriMonthNames:r}){if(!t)return console.warn("formatHijriDate: hijriDayObj is null",{language:e,t:n}),"";const{hijri_date_day:a,hijri_date_month:s,hijri_date_year:l}=t;let u="";return u=r[s-1]||"",e==="ar"?`${l}-${u}-${a}`:`${a}-${u}-${l}`}const T3="hijri-date-db",Xm="hijri_dates";async function Dl(t){return await(await Xr(T3,1,{upgrade(n){n.createObjectStore(Xm)}})).get(Xm,t)}async function kg(t,e){await(await Xr(T3,1,{upgrade(r){r.createObjectStore(Xm)}})).put(Xm,e,t)}async function Dg(t,e){try{const{data:n,error:r}=await ot.from("hijri_dates").select("gregorian_date, hijri_date_day, hijri_date_month, hijri_date_year").gte("gregorian_date",t).lte("gregorian_date",e);if(r)throw new Error(r.message);const a=new Map;return(n||[]).forEach(s=>{a.set(s.gregorian_date,{hijri_date_day:s.hijri_date_day,hijri_date_month:s.hijri_date_month,hijri_date_year:s.hijri_date_year})}),a}catch(n){return console.error("Error fetching all Hijri dates: ",n),await aa(n,{message:"Failed to load Hijri dates at fetchAllHijriDates"}),Rn("error","Failed to load Hijri dates"),new Map}}const G7=async t=>{try{const e=new Date,n=e.toLocaleDateString("en-CA"),r=new Date(e);r.setFullYear(r.getFullYear()+1),r.setDate(r.getDate()-1);const a=r.toLocaleDateString("en-CA",{timeZone:"Europe/Oslo"}),s={en:"special_date_en",no:"special_date_no",ar:"special_date_ar"},l=s[t]??s.en,{data:u,error:c}=await ot.from("hijri_dates").select(`${l}, gregorian_date`).gte("gregorian_date",n).lte("gregorian_date",a).not(l,"is",null);if(c)throw c;return u.map(h=>({date:h.gregorian_date,description:h[l],formatted:new Date(h.gregorian_date).toLocaleDateString("en-US",{month:"long",day:"numeric",timeZone:"Europe/Oslo"})})).sort((h,d)=>new Date(h.date).getTime()-new Date(d.date).getTime())}catch(e){return console.error("Failed to load special dates: ",e.message),await aa(e,{message:"Failed to load special dates (in getSpecialDates helper)"}),Rn("error","Failed to load special dates"),[]}},L3=async()=>{try{const{data:t,error:e}=await ot.from("hijri_month").select("name_long").order("hijri_date_month");if(e)throw e;return t?t.map(n=>n.name_long):[]}catch(t){return console.error("Error fetching hijri month names: ",t),await aa(t,{message:"Error fetching hijri month names",function:"fetchHijriMonthNames"}),Rn("error","Error fetching hijri month names"),[]}};let Gp=null,ff=null;function Pg(){const[t,e]=D.useState(()=>Gp||[]);return D.useEffect(()=>{if(Gp){e(Gp);return}if(ff){ff.then(n=>{e(n)});return}ff=L3(),ff.then(n=>{Gp=n,e(n),ff=null}).catch(n=>{console.error("Error fetching Hijri month names:",n),ff=null})},[]),t}const j3=({date:t,color:e,isLobby:n})=>{const{i18n:r,t:a}=Ar(),s=r.language||"en",{darkMode:l}=Aa(),u=Pg(),[c,h]=D.useState(()=>new Date(t).toLocaleDateString(s==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}));D.useEffect(()=>{const y=new Date(t);h(y.toLocaleDateString(s==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[t,s]);const[d,m]=D.useState(null);return D.useEffect(()=>{(async()=>{if(t){if(!navigator.onLine){const g=await Dl(t);if(g){m(g);return}}try{const{data:g,error:x}=await ot.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",t).maybeSingle();if(x){console.error("Error fetching hijri date: ",x),await aa(x,{message:"Error fetching hijri date"}),Rn("error","Error fetching hijri date in DateInfo");return}if(!g){console.warn(`No hijri date found for gregorian date: ${t}`);const _=await Dl(t);_&&m(_);return}m(g),await kg(t,g)}catch(g){const x=await Dl(t);x&&m(x),console.error(g)}}})()},[t]),E.jsxs("div",{className:`mt- text-base font-bold ${n?"sm:text-xl lg:text-2xl":"sm:mt-4 sm:text-2xl lg:text-3xl text-center"}`,style:{color:l?"#DDF4E7":e},children:[d&&u.length>0?zo({hijriDayObj:d,language:s,t:a,hijriMonthNames:u}):" ",n?" | ":E.jsx("br",{}),c]})},Md=({nr:t,textColor:e,orgNr:n,isLobby:r,date:a,isDefault:s})=>{const{org_nr:l}=ia(),{darkMode:u}=Aa(),{masjidName:c,masjidLogo:h,masjidInfo:d,loading:m}=Pd(l||n),y=u?t===1?"#F2E7D5":t===2?"#F5C45E":"#DDF4E7":s&&t===2?"#F5C45E":e;return m?E.jsx("div",{children:E.jsx("h1",{className:"text-base sm:text-lg md:text-xl",children:"Logo"})}):E.jsxs("div",{className:`flex mt-2 flex-row gap-x-4 items-center ${t===3?"font-DM":"font-montserrat"}`,style:{color:y},children:[E.jsx("img",{src:h!=null&&h.startsWith("http")?h:h?`data:image/png;base64,${h}`:"/default-logo.png",alt:"logo",className:"block h-12 sm:h-14 2xl:h-16 w-auto max-w-[50%] sm:max-w-[40%]"}),E.jsxs("div",{className:"flex flex-col 2xl:gap-2",children:[E.jsx("h2",{className:"font-bold text-lg md:text-xl lg:text-3xl",children:c}),!r&&E.jsx("h4",{className:"text-xl font-medium",style:{color:u?t===1?"#F2E7D5":t===2?"#F5C45E":"#DDF4E7":s?t===1?"#0D0E0E":"":e},children:d}),t===3&&r&&E.jsx(j3,{date:a,color:y,isLobby:!0})]})]})},Vy=()=>E.jsxs("div",{className:"flex flex-col justify-center items-center gap-10",children:[E.jsx("h2",{className:"text-5xl font-bold text-red-600 text-center",children:"Please switch off your mobile phones"}),E.jsx("img",{src:"/img/instruction.jpg",alt:"",className:"h-120"})]}),Bh=120;function Gy(t,e){const[n,r]=D.useState(null),[a,s]=D.useState(null);return D.useEffect(()=>{if(!t||t.length===0)return;let l=null;const u=()=>{var x;const c=new Date,h=c.getHours()*3600+c.getMinutes()*60+c.getSeconds();let d=null,m=1/0;const y=[...t];if(new Date().getDay()===5){const _=e==null?void 0:e.find(A=>{var j;return((j=A.label)==null?void 0:j.toLowerCase())==="jumuah"}),N=y.findIndex(A=>A.name.toLowerCase()==="dhuhr");if(N!==-1){const A=((x=_==null?void 0:_.time)==null?void 0:x.map(j=>({name:"Jumuah",adhan:j,iqamah:j})))??[];y.splice(N,1,...A)}}for(const _ of y){if(!(_!=null&&_.iqamah)||!(_!=null&&_.name)||_.name==="Fajr end")continue;const[N,A]=_.iqamah.split(":").map(Number);if(isNaN(N)||isNaN(A))continue;const L=N*3600+A*60-h;if(L>=0&&L<m)m=L,d=_;else if(L>=-Bh&&L<0){r(Bh-Math.abs(L)),s({iqamah:_.iqamah,name:_.name}),console.log("useIqamahCheck - Iqamah found:",_,"Duration:",Bh-Math.abs(L));return}}d&&(l=setTimeout(()=>{r(Bh),s({iqamah:d.iqamah,name:d.name}),console.log("useIqamahCheck - Iqamah triggered:",d),l=setTimeout(()=>{r(null),s(null),console.log("useIqamahCheck - Iqamah window ended, rescheduling"),u()},Bh*1e3)},m*1e3))};return u(),()=>{l&&clearTimeout(l)}},[t]),{iqamahDuration:n,currentPrayer:a}}const Wy=60,W7=({prayerTimes:t,extraInfo:e,textColor:n="#53452E",prayerTimesColor:r,extraInfoColor:a,isDefault:s})=>{const[l,u]=D.useState(null),{org_nr:c}=ia(),{iqamahDuration:h,currentPrayer:d}=Gy(t,e);D.useEffect(()=>{const y=setInterval(()=>{u(()=>{const g=new Date,x=g.getHours()*3600+g.getMinutes()*60+g.getSeconds();let _=1/0;for(const N of t){const A=N==null?void 0:N.iqamah;if(!A)continue;const[j,L]=A.split(":").map(Number);if(Number.isNaN(j)||Number.isNaN(L))continue;const I=j*3600+L*60-x;I>0&&I<_&&(_=I)}return _===1/0?null:_})},1e3);return()=>clearInterval(y)},[t]);const m=l!==null&&l<=Wy&&l>0;return D.useEffect(()=>{if(h&&d&&c){const y=Date.now()+h*1e3,g=new URLSearchParams({name:d.name,endTime:String(y)});window.location.href=`/${c}/masjid/iqamah?${g.toString()}`}},[h,d,c]),E.jsxs("div",{className:"flex flex-col h-full w-full px-6 py-8",children:[E.jsx("div",{className:"flex items-center gap-x-3 mb-6",children:E.jsx(Md,{nr:1,textColor:n,isDefault:s})}),E.jsx("div",{className:"flex-1 min-h-0 flex flex-col justify-center",children:m?E.jsx(Vy,{}):E.jsx(s7,{prayerTimes:t,extraInfo:e,prayerTimesColor:r,extraInfoColor:a,isDefault:s})})]})};function C1(t){if(!t||typeof t!="string"||!t.includes(":"))return null;const[e,n]=t.split(":").map(Number),r=new Date;return r.setHours(e,n,0,0),r}function T1(t){const e=Math.ceil(t/1e3),n=Math.floor(e/3600),r=Math.floor(e%3600/60),a=e%60;return{hours:n,minutes:r,seconds:a}}function Mg(t,e){var l,u;const n=new Date,r=[...t];if(new Date().getDay()===5){const c=e==null?void 0:e.find(d=>{var m;return((m=d.label)==null?void 0:m.toLowerCase())==="jumuah"}),h=r.findIndex(d=>d.name.toLowerCase()==="dhuhr");if(h!==-1){const d=((l=c==null?void 0:c.time)==null?void 0:l.map(m=>({name:"Jumuah",adhan:m,iqamah:m})))??[];r.splice(h,1,...d)}}for(let c=0;c<r.length;c++){const h=r[c],d=C1(h.adhan),m=C1(h.iqamah);if(d&&n<d){const{hours:y,minutes:g,seconds:x}=T1(d.getTime()-n.getTime());return{label:`${h.name.charAt(0).toUpperCase()+h.name.slice(1).toLowerCase()}`,iqamah:!1,hours:y,minutes:g,seconds:x}}if(m&&d&&n>=d&&n<m){const{hours:y,minutes:g,seconds:x}=T1(m.getTime()-n.getTime());return{label:`${h.name.charAt(0).toUpperCase()+h.name.slice(1).toLowerCase()}`,iqamah:!0,hours:y,minutes:g,seconds:x}}}const s=C1((u=r[0])==null?void 0:u.adhan);if(s){s.setDate(s.getDate()+1);const{hours:c,minutes:h,seconds:d}=T1(s.getTime()-n.getTime());return{label:"Fajr",iqamah:!1,hours:c,minutes:h,seconds:d}}return{label:"",iqamah:!1,hours:0,minutes:0,seconds:0}}const Y7={1:{light:{day:"#ECDCC3",dayOpacity:1,night:"#A5A6A5",nightOpacity:1,border:"#A08963",bg:"#DBDBDB",text:"#706D54",centerOuter:"#DBDBDB",centerMid:"#A08963",center:"#6D9886",handStart:"#6D9886",handEnd:"#A08963",shadow:"#000000",shadowOpacity:1},dark:{day:"#ECDCC3",dayOpacity:.75,night:"#4A4A49",nightOpacity:1,border:"#A08963",bg:"#1E1E1E",text:"#F2E7D5",centerOuter:"#1E1E1E",centerMid:"#DBDBDB",center:"#6D9886",handStart:"#6D9886",handEnd:"#F2E7D5",shadow:"#DBDBDB",shadowOpacity:1}},2:{light:{day:"#E78B48",dayOpacity:.5,night:"#102E50",nightOpacity:.5,border:"#BE3D2A",bg:"#F5C45E",text:"#102E50",centerOuter:"#F5C45E",centerMid:"#BE3D2A",center:"#E78B48",shadow:"#BE3D2A",shadowOpacity:.5},dark:{day:"#E78B48",dayOpacity:.5,night:"#03070C",nightOpacity:.5,border:"#BE3D2A",bg:"#102E50",text:"#F5C45E",centerOuter:"#102E50",centerMid:"#F5C45E",center:"#E78B48",shadow:"#F5C45E",shadowOpacity:.2}}},Al=t=>{if(typeof t!="string"||!t.includes(":"))return 0;const[e,n]=t.split(":").map(Number);return e+n/60};function Nl(t){return(t%24*15+180)%360}function K7(t,e){return e>=t?e-t:24-t+e}function xu(t,e,n,r){const a=(r-90)*Math.PI/180;return{x:t+n*Math.cos(a),y:e+n*Math.sin(a)}}function xx(t,e,n,r,a){r=r%360,a=a%360,a<=r&&(a+=360);const s=xu(t,e,n,a),l=xu(t,e,n,r),u=a-r<=180?"0":"1";return["M",s.x,s.y,"A",n,n,0,u,0,l.x,l.y,"L",t,e,"Z"].join(" ")}function J7(t,e,n){const r=Math.floor(e*60),s=t.map((l,u)=>({p:l,i:u})).filter(l=>l.p.name!==n).map(l=>l.i).find(l=>Math.floor(t[l].time*60)>r);return t.map((l,u)=>{if(l.name===n)return"none";const c=Math.floor(l.time*60);return u===s?"next":c<r?"past":"future"})}const Id=({width:t,height:e,prayerTimes:n,asrInfo:r,theme:a})=>{const{t:s}=Ar(),{darkMode:l}=Aa(),u=l?"dark":"light",c=Y7[a][u],[h,d]=D.useState(()=>{const L=new Date;return L.getHours()+L.getMinutes()/60+L.getSeconds()/3600});D.useEffect(()=>{const L=setInterval(()=>{const R=new Date;d(R.getHours()+R.getMinutes()/60+R.getSeconds()/3600)},1e3);return()=>clearInterval(L)},[]);const m={fajr:Al(n.fajr),sunrise:Al(n["fajr end"]),dhuhr:Al(n.dhuhr),asr:Al(n.asr),asr_1x:Al(r.one_x),asr_2x:Al(r.two_x),asr_50p:Al(r.fifty_percent),maghrib:Al(n.maghrib),isha:Al(n.isha)},y=K7(m.maghrib,m.fajr),g=(m.maghrib+y*2/3)%24,x=[{startLabel:"Dhuhr",endLabel:"",start:m.dhuhr,end:m.asr-.01,color:"#B7CD8E",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"1X",endLabel:null,start:m.asr_1x,end:m.asr_50p,color:"#FFDF77",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"50%",endLabel:null,start:m.asr_50p,end:m.asr_2x,color:"E1B936",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"2X",endLabel:"Asr end",start:m.asr_2x,end:m.maghrib-10/60,color:"#B38F17",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:null,endLabel:null,start:m.maghrib-20/60,end:m.maghrib-1/60,color:"#C53434",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Maghrib",endLabel:"Dusk",start:m.maghrib,end:m.isha-1/60,color:"#D8702B",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Isha",endLabel:null,start:m.isha,end:23.9833,color:"#254465",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Thahajjud",endLabel:"Thahajjud end",start:g,end:m.fajr,color:"#232E3A",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Fajr",endLabel:"Fajr end",start:m.fajr,end:m.sunrise-1/60,color:"#D8702B",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:null,endLabel:null,start:m.sunrise,end:m.sunrise+20/60,color:"#C53434",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:"Dhuha",endLabel:"Dhuha end",start:m.sunrise+20/60,end:m.dhuhr-20/60,color:"#E8C85E",textPosition:["start","end"],textColor:"#ffffff"},{startLabel:null,endLabel:null,start:m.dhuhr-20/60,end:m.dhuhr,color:"#C53434",textPosition:["start","end"],textColor:"#ffffff"}],_=[{name:"FAJR",time:m.fajr},{name:s("SUNRISE"),time:m.sunrise},{name:"DHUHR",time:m.dhuhr},{name:"ASR",time:m.asr},{name:"MAGHRIB",time:m.maghrib},{name:"ISHA",time:m.isha}],N=J7(_,h,s("SUNRISE")),A=180,j=Nl(h);return E.jsxs("svg",{width:t||"100%",height:e||"100%",viewBox:"0 0 400 400",className:`rounded-full shadow-lg font-chakra font-light text-${c.text}`,children:[E.jsx("defs",{children:E.jsx("filter",{id:"inner-shadow",x:"-10%",y:"-10%",width:"120%",height:"120%",children:E.jsx("feGaussianBlur",{stdDeviation:"7"})})}),E.jsx("circle",{cx:200,cy:200,r:200,fill:c.border}),E.jsx("circle",{cx:200,cy:200,r:190,fill:c.bg}),E.jsx("path",{d:`
|
|
911
|
+
M 200,200
|
|
912
|
+
m -190,0
|
|
913
|
+
a 190,190 0 1,0 380,0
|
|
914
|
+
a 190,190 0 1,0 -380,0
|
|
915
|
+
M 200,200
|
|
916
|
+
m -183,0
|
|
917
|
+
a 183,183 0 1,1 366,0
|
|
918
|
+
a 183,183 0 1,1 -366,0
|
|
919
|
+
Z
|
|
920
|
+
`,fill:c.shadow,opacity:c.shadowOpacity,filter:"url(#inner-shadow)"}),x.map((L,R)=>{const B=Nl(L.start);let X=Nl(L.end);X<=B&&(X+=360);const F=X-B<=180?"0":"1",$=le=>(le-90)*(Math.PI/180),K={x:200+190*Math.cos($(B)),y:200+190*Math.sin($(B))},Y={x:200+190*Math.cos($(X)),y:200+190*Math.sin($(X))},he={x:200+172*Math.cos($(X)),y:200+172*Math.sin($(X))},te={x:200+172*Math.cos($(B)),y:200+172*Math.sin($(B))},oe=[`M ${K.x} ${K.y}`,`A 190 190 0 ${F} 1 ${Y.x} ${Y.y}`,`L ${he.x} ${he.y}`,`A 172 172 0 ${F} 0 ${te.x} ${te.y}`,"Z"].join(" ");return E.jsxs("g",{children:[E.jsx("path",{id:`arcPath-${R}`,d:oe,fill:L.color,opacity:L.startLabel||L.endLabel?.5:1}),E.jsx("path",{id:`textArc-${R}`,d:`M ${K.x} ${K.y} A 190 190 0 ${F} 1 ${Y.x} ${Y.y}`,fill:"none",stroke:"none"}),L.startLabel&&E.jsx("text",{fontSize:10,dx:1,dy:10,fill:"#ffffff",children:E.jsx("textPath",{href:`#textArc-${R}`,startOffset:"0%",textAnchor:"start",dominantBaseline:"middle",children:L.startLabel})})]},`seg-${R}`)}),E.jsx("path",{d:xx(200,200,135,Nl(m.sunrise),Nl(m.maghrib)),fill:c.day,opacity:c.dayOpacity}),E.jsx("path",{d:xx(200,200,135,Nl(m.maghrib),Nl(m.sunrise+24)),fill:c.night,opacity:c.nightOpacity}),Array.from({length:24},(L,R)=>{if(R===0||R===6||R===12||R===18)return null;const I=Nl(R),ee=A-30,G=xu(200,200,ee,I);return E.jsx("text",{x:G.x,y:G.y+8,fontSize:18,fill:c.text,textAnchor:"middle",children:R},R)}),a===1&&E.jsx("defs",{children:E.jsxs("linearGradient",{id:"clockHandGradient",x1:"0%",y1:"0%",x2:"100%",y2:"0%",children:[E.jsx("stop",{offset:"0%",stopColor:c.handStart}),E.jsx("stop",{offset:"100%",stopColor:c.handEnd})]})}),E.jsxs("g",{children:[E.jsx("circle",{cx:200,cy:200,r:22,fill:c.centerOuter}),E.jsx("circle",{cx:200,cy:200,r:14,fill:c.centerMid}),E.jsx("line",{x1:200,y1:200,x2:xu(200,200,120,j).x,y2:xu(200,200,120,j).y,stroke:a===1?"url(#clockHandGradient)":c.centerMid,strokeWidth:14,strokeLinecap:"round"}),E.jsx("circle",{cx:200,cy:200,r:6,fill:c.center})]}),_.map((L,R)=>{if(L.name===s("SUNRISE"))return null;const I=Nl(L.time),ee=70,G=xu(200,200,ee,I),P=ee+30,B=A-50,X=xu(200,200,P,I),F=xu(200,200,B,I),$=N[R],K=c.text,Y=$==="past"?.5:1,he=$==="next"?"bold":"normal";let te=I;return L.name==="FAJR"?te+=90:te+=-90,E.jsxs(vn.Fragment,{children:[E.jsx("line",{x1:X.x,y1:X.y,x2:F.x,y2:F.y,stroke:"#0000004D",strokeWidth:1}),E.jsx("text",{x:G.x,y:G.y,textAnchor:"middle",dominantBaseline:"middle",fontSize:L.name===s("SUNRISE")?10:18,fontWeight:he,fill:K,opacity:Y,transform:`rotate(${te} ${G.x} ${G.y})`,children:L.name})]},L.name)}),E.jsx("text",{x:"200",y:"60",textAnchor:"middle",fontSize:40,fill:c.text,fontWeight:"",children:"12"}),E.jsx("text",{x:"200",y:"368",textAnchor:"middle",fontSize:40,fill:c.text,fontWeight:"",children:"0"}),E.jsx("text",{x:"42",y:"210",textAnchor:"middle",fontSize:40,fill:c.text,fontWeight:"",children:"6"}),E.jsx("text",{x:"352",y:"210",textAnchor:"middle",fontSize:40,fill:c.text,fontWeight:"",children:"18"})]})},X7=({prayerTimes:t,extraInfo:e,asrInfo:n,date:r})=>{var j;const{i18n:a,t:s}=Ar(),l=a.language||"en",u=Pg(),[c,h]=D.useState(()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})),[d,m]=D.useState(()=>new Date(r).toLocaleDateString(l==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"})),[y,g]=D.useState({label:"",iqamah:!1,hours:0,minutes:0,seconds:0});D.useEffect(()=>{const L=setInterval(()=>{h(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}))},1e3);return()=>clearInterval(L)},[]),D.useEffect(()=>{const L=new Date(r);m(L.toLocaleDateString(l==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[r,l]),D.useEffect(()=>{if(!t.length)return;function L(){g(Mg(t,e))}L();const R=setInterval(L,1e3);return()=>clearInterval(R)},[t]);const x=Tg(t),[_,N]=D.useState(null);D.useEffect(()=>{(async()=>{if(r){if(!navigator.onLine){const R=await Dl(r);if(R){N(R);return}}try{const{data:R,error:I}=await ot.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",r).single();if(I)throw new Error(I.message);if(!R)throw new Error("No corresponding hijri day found!");N(R),await kg(r,R)}catch(R){const I=await Dl(r);I&&N(I),console.log(R)}}})()},[r]);const A=(j=y==null?void 0:y.label)==null?void 0:j.split(" ").map(L=>s(L.toUpperCase())).join(" ");return E.jsxs("div",{className:"font-chakra w-full h-full flex flex-col justify-center items-center text-center gap-4 p-4 dark:text-[#F2E7D5]",children:[E.jsxs("div",{className:"",children:[E.jsx("h2",{className:"font-bold text-2xl md:text-3xl lg:text-5xl mb-2",children:c}),E.jsxs("h4",{className:"font-semibold text-lg md:text-xl lg:text-2xl",children:[_&&u.length>0?zo({hijriDayObj:_,language:l,t:s,hijriMonthNames:u}):" "," | ",d]})]}),E.jsx("div",{className:"w-full",children:E.jsx(Id,{prayerTimes:x,asrInfo:n,theme:1})}),y&&y.label&&E.jsxs("div",{children:[E.jsxs("h2",{className:"font-semibold text-lg md:text-xl lg:text-2xl mb-1",children:[A," ",y.iqamah&&s("IQAMAH")," ",s("IN")]}),E.jsx("h4",{className:"font-bold text-2xl md:text-3xl lg:text-5xl",children:`${String(y.hours).padStart(2,"0")}:${String(y.minutes).padStart(2,"0")}:${String(y.seconds).padStart(2,"0")}`})]})]})},Z7=({date:t,textColor:e})=>{const{i18n:n,t:r}=Ar(),a=n.language||"en",{darkMode:s}=Aa(),l=Pg(),[u,c]=D.useState(()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})),[h,d]=D.useState(()=>new Date(t).toLocaleDateString(a==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}));D.useEffect(()=>{const g=setInterval(()=>{c(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}))},1e3);return()=>clearInterval(g)},[]),D.useEffect(()=>{const g=new Date(t);d(g.toLocaleDateString(a==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[t,a]);const[m,y]=D.useState(null);return D.useEffect(()=>{(async()=>{if(t){if(!navigator.onLine){const x=await Dl(t);if(x){y(x);return}}try{const{data:x,error:_}=await ot.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",t).single();if(_)throw new Error(_.message);if(!x)throw new Error("No corresponding hijri day found!");y(x),await kg(t,x)}catch(x){const _=await Dl(t);_&&y(_),console.log(x)}}})()},[t]),E.jsxs("div",{className:"flex flex-col items-end font-montserrat pr-6",style:{color:s?"#F5C45E":e},children:[E.jsx("h2",{className:"font-bold text-lg md:text-xl lg:text-3xl",children:u}),E.jsxs("h4",{className:"font-semibold text-sm md:text-base lg:text-xl text-right",children:[m&&l.length>0?zo({hijriDayObj:m,language:a,t:r,hijriMonthNames:l}):"-"," | ",h]})]})},O3=({name:t,arabic:e,adhan:n,iqamah:r,tomorrow:a,isNext:s,isPast:l,isSmall:u=!1,color:c,bg:h,isDefault:d,isPreview:m})=>{const{t:y}=Ar(),{darkMode:g}=Aa(),{language:x}=Tu(),_=x==="ar";return E.jsxs("div",{className:`
|
|
921
|
+
w-${u?m?"w-40":"w-52":"w-55"} flex flex-col mx-auto
|
|
922
|
+
py-1 rounded-lg shadow-md text-center transition
|
|
923
|
+
${s?"dark:border-4 dark:border-[#CE5C36]":""}
|
|
924
|
+
`,style:{backgroundColor:g?"#102E50":d?s?"#F5C45E":"#E78B48":h,color:g?"#F5C45E":c},children:[E.jsxs("div",{className:`flex justify-between font-montserrat font-semibold border-b-2 ${u?m?"px-0.5 py-1.5":"py-1.5 lg:text-2xl px-3":"py-2 text-2xl px-3"}`,children:[E.jsx("h2",{children:t}),E.jsx("h4",{className:"font-bold",children:e})]}),E.jsxs("div",{className:`flex flex-col px-3 font-montserrat font-medium ${u?"py-3 gap-2 lg:text-xl":"py-1.5 gap-1.5 text-lg lg:text-xl"}`,style:{direction:_?"rtl":"ltr"},children:[E.jsxs("div",{className:`flex justify-between ${l?"opacity-40":""}`,children:[E.jsx("h2",{children:y("ADHAN")}),E.jsx("h4",{className:"font-bold",children:n})]}),E.jsxs("div",{className:`flex justify-between ${l?"opacity-40":""}`,children:[E.jsx("h2",{children:y("IQAMAH")}),E.jsx("h4",{className:"font-bold",children:r})]}),E.jsxs("div",{className:"flex justify-between",children:[E.jsx("h2",{children:y("TOMORROW")}),E.jsx("h4",{className:"font-bold",children:a})]})]})]})},R3="prayer-times-db",Zm="prayerTimes";async function Q7(t,e,n){await(await Xr(R3,1,{upgrade(a){a.createObjectStore(Zm)}})).put(Zm,n,`${t}_${e}`)}async function L1(t,e){return(await Xr(R3,1,{upgrade(r){r.createObjectStore(Zm)}})).get(Zm,`${t}_${e}`)}const $h={Fajr:"فجر",Dhuhr:"ظهر",Asr:"عصر",Maghrib:"مغرب",Isha:"عشاء",Sunrise:"شروق",Jumuah:"جمعة","Fajr end":""},Qv={Fajr:"fajr",Dhuhr:"duhr",Asr:t=>{switch(t){case 1:return"shadow_1x";case 2:return"shadow_2x";case 3:return"wusta_noon_sunset";default:return"asr"}},Maghrib:"maghrib",Isha:"isha",Sunrise:"shuruq_sunrise","Fajr end":"fajr_endtime"};async function k3(t,e,n,r){var a;try{const{data:s,error:l}=await ot.from("mosque_t").select(`
|
|
925
|
+
*,
|
|
926
|
+
location_postnumber (
|
|
927
|
+
location_iso
|
|
928
|
+
)
|
|
929
|
+
`).eq("organisasjonsnummer",t).single();if(l)throw l;if(!s)throw new Error("Mosque not found");const u=(a=s.location_postnumber)==null?void 0:a.location_iso;let c=0,h=1;if(u){const{data:B,error:X}=await ot.from("location_t").select("asr_method, prayer_method").eq("location_iso",u).maybeSingle();if(X)throw X;c=(B==null?void 0:B.asr_method)||0,h=(B==null?void 0:B.prayer_method)||0}const d=new Date(e);d.setDate(d.getDate()+1);const m=d.toISOString().split("T")[0],y=s.location_postnumber.location_iso,g=r??s.prayer_method,x=g===1||g===null?h:g,_=n??s.asr_method,N=_||c,[{data:A},{data:j},{data:L},{data:R}]=await Promise.all([ot.from("prayertime").select("*").eq("location_iso",y).eq("date",e).eq("prayer_method",x).maybeSingle(),ot.from("prayertime").select("*").eq("location_iso",y).eq("date",m).eq("prayer_method",x).maybeSingle(),ot.from("mosque_jamatperiode").select("*").eq("mosque_id",t).lte("start_date",e).gte("end_date",e).order("created_at",{ascending:!1}).limit(1).maybeSingle(),ot.from("mosque_jamatperiode").select("*").eq("mosque_id",t).lte("start_date",m).gte("end_date",m).order("created_at",{ascending:!1}).limit(1).maybeSingle()]);if(!A)throw new Error(`No prayer times found: Location: ${y}, Prayer Method: ${x}`);const I={one_x:A.shadow_1x.slice(0,5)||"",two_x:A.shadow_2x.slice(0,5)||"",fifty_percent:A.wusta_noon_sunset.slice(0,5)||""},ee=["Fajr","Fajr end","Dhuhr","Asr","Maghrib","Isha"].map(B=>{var oe,le,pe,Ne,U;const X=Qv[B],F=typeof X=="function"?X(N):X,$=B==="Asr"?"asr":B==="Dhuhr"?"dhuhr":F,K=((oe=A==null?void 0:A[F])==null?void 0:oe.slice(0,5))||"",Y=((le=j==null?void 0:j[F])==null?void 0:le.slice(0,5))||"";let he=(pe=L==null?void 0:L[$])==null?void 0:pe.slice(0,5),te=B==="Fajr end"?(Ne=j==null?void 0:j.fajr_endtime)==null?void 0:Ne.slice(0,5):(U=R==null?void 0:R[$])==null?void 0:U.slice(0,5);if(!he&&K){const O=`${B.toLowerCase()}_offset`,V=L==null?void 0:L[O];if(typeof V=="number"){const[Z,ie]=K.split(":").map(Number),z=Z*60+ie+V,se=String(Math.floor(z/60)%24).padStart(2,"0"),ge=String(z%60).padStart(2,"0");he=`${se}:${ge}`}else he=""}if(!te&&Y){const O=`${B.toLowerCase()}_offset`,V=R==null?void 0:R[O];if(typeof V=="number"){const[Z,ie]=Y.split(":").map(Number),z=Z*60+ie+V,se=String(Math.floor(z/60)%24).padStart(2,"0"),ge=String(z%60).padStart(2,"0");te=`${se}:${ge}`}else te=""}return{name:B,arabic:$h[B],adhan:K,iqamah:he,tomorrow:te}});let G;if(!(L!=null&&L.id))console.warn("Today's Jamaat is missing, skipping jummah query"),G=[];else{const{data:B,error:X}=await ot.from("mosque_jummah").select("jummah").eq("mosque_id",t).eq("jamat_id",L==null?void 0:L.id);if(X)throw X;G=B||null}const P=await Promise.all(["Jumuah","Eid"].map(async B=>{var $,K,Y,he;const X=Qv[B],F=typeof X=="function"?X(s.asr_method):X;if(B==="Jumuah"){const te=G.map(oe=>{var le;return(le=oe.jummah)==null?void 0:le.slice(0,5)}).filter(Boolean).sort((oe,le)=>{const[pe,Ne]=oe.split(":").map(Number),[U,O]=le.split(":").map(Number),V=(pe===12?12:pe+12)*60+Ne,Z=(U===12?12:U+12)*60+O;return V-Z});return{label:B,arabic:$h[B],time:te||""}}if(B==="Eid"){const{data:te,error:oe}=await ot.from("mosque_t").select("show_eid").eq("organisasjonsnummer",t).single(),le=te==null?void 0:te.show_eid;if(oe||!le)return{label:B,arabic:$h[B],time:[]};const pe=[($=s.eidprayer_time1)==null?void 0:$.slice(0,5),(K=s.eidprayer_time2)==null?void 0:K.slice(0,5),(Y=s.eidprayer_time3)==null?void 0:Y.slice(0,5)].filter(Boolean);return{label:B,arabic:$h[B],time:pe}}return{label:B,arabic:$h[B],time:((he=A==null?void 0:A[F])==null?void 0:he.slice(0,5))||""}}));return{prayerTimes:ee,extraInfo:P,asrInfo:I}}catch(s){console.error("Error fetching prayer times: ",s);const l=[{name:"Fajr",arabic:"فجر",adhan:"",iqamah:"",tomorrow:""},{name:"Fajr end",arabic:"الشروق",adhan:"",iqamah:"",tomorrow:""},{name:"Dhuhr",arabic:"ظهر",adhan:"",iqamah:"",tomorrow:""},{name:"Asr",arabic:"عصر",adhan:"",iqamah:"",tomorrow:""},{name:"Maghrib",arabic:"مغرب",adhan:"",iqamah:"",tomorrow:""},{name:"Isha",arabic:"عشاء",adhan:"",iqamah:"",tomorrow:""}],u=[{label:"Jumuah",arabic:"جمعة",time:["",""]}],c={one_x:"",two_x:"",fifty_percent:""};return await aa(s,{message:"Error fetching prayer times",function:"fetchPrayerTimesFromSupabase"}),Rn("error","Failed to fetch prayer times, try selecting other prayer method"),{prayerTimes:l,extraInfo:u,asrInfo:c}}}const eP=async(t,e,n,r)=>{var a,s,l;try{const{data:u}=await ot.from("prayertime").select(`
|
|
930
|
+
*,
|
|
931
|
+
location_t (
|
|
932
|
+
asr_method
|
|
933
|
+
)
|
|
934
|
+
`).eq("location_iso",t).eq("date",e).eq("prayer_method",r).single(),c={one_x:((a=u==null?void 0:u.shadow_1x)==null?void 0:a.slice(0,5))||"",two_x:((s=u==null?void 0:u.shadow_2x)==null?void 0:s.slice(0,5))||"",fifty_percent:((l=u==null?void 0:u.wusta_noon_sunset)==null?void 0:l.slice(0,5))||""};return{prayerTimes:["Fajr","Fajr end","Dhuhr","Asr","Maghrib","Isha"].map(d=>{var _;const m=Qv[d],y=u==null?void 0:u.location_t.asr_method,g=typeof m=="function"?m(n===0?y:n??0):m,x=((_=u==null?void 0:u[g])==null?void 0:_.slice(0,5))||"";return{name:d,adhan:x,iqamah:"",tomorrow:""}}),asrInfo:c}}catch(u){console.error("Error fetching prayer times: ",u);const c=[{name:"Fajr",adhan:"",iqamah:"",tomorrow:""},{name:"Fajr end",adhan:"",iqamah:"",tomorrow:""},{name:"Dhuhr",adhan:"",iqamah:"",tomorrow:""},{name:"Asr",adhan:"",iqamah:"",tomorrow:""},{name:"Maghrib",adhan:"",iqamah:"",tomorrow:""},{name:"Isha",adhan:"",iqamah:"",tomorrow:""}],h={one_x:"",two_x:"",fifty_percent:""};return await aa(u,{message:"Error fetching prayer times",function:"fetchPrayerTimesFromSupabase"}),Rn("error","Failed to fetch prayer times"),{prayerTimes:c,asrInfo:h}}},tP=async(t,e,n,r,a)=>{try{const{data:s,error:l}=await ot.from("prayertime").select("*").eq("location_iso",t).eq("prayer_method",a).gte("date",e).lte("date",n).order("date");if(l)throw l;if(!s||s.length===0)return[];const c=(d=>{switch(d){case 1:return"shadow_1x";case 2:return"shadow_2x";case 3:return"wusta_noon_sunset";default:return"asr"}})(r);return s.map(d=>{var m,y,g,x,_,N;return{date:d.date,fajr:((m=d.fajr)==null?void 0:m.slice(0,5))||"",sunrise:((y=d.shuruq_sunrise)==null?void 0:y.slice(0,5))||"",dhuhr:((g=d.duhr)==null?void 0:g.slice(0,5))||"",asr:((x=d[c])==null?void 0:x.slice(0,5))||"",maghrib:((_=d.maghrib)==null?void 0:_.slice(0,5))||"",isha:((N=d.isha)==null?void 0:N.slice(0,5))||""}})}catch(s){throw console.error("Unexpected error in getPrayerTimesInADateRange:",s),s}},j1={one_x:"",two_x:"",fifty_percent:""};function D3(t,e){const[n,r]=D.useState([]),[a,s]=D.useState([]),[l,u]=D.useState(j1),[c,h]=D.useState(!0);return D.useEffect(()=>{if(!t)return;r([]),s([]),h(!0);const d=async()=>{if(!navigator.onLine){const g=await L1(t,e);g?(r(g.prayerTimes),s(g.extraInfo)):(r([]),s([])),h(!1);return}try{const{prayerTimes:g,extraInfo:x,asrInfo:_}=await k3(t,e);if(r(g||[]),s(x||[]),u(_||j1),(g==null?void 0:g.length)>0&&x)await Q7(t,e,{prayerTimes:g,extraInfo:x,asrInfo:_});else{const N=await L1(t,e);N&&(r(N.prayerTimes),s(N.extraInfo),u(N.asrInfo))}}catch(g){console.error("Failed to fetch prayer times:",g);const x=await L1(t,e);x?(r(x.prayerTimes),s(x.extraInfo),u(x.asrInfo)):(r([]),s([]),u(j1))}finally{h(!1)}};d();const m=ot.channel("prayer_times_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_jamatperiode",filter:`mosque_id=eq.${t}`},()=>{d()}).subscribe(),y=ot.channel("mosque_t_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${t}`},()=>{d()}).subscribe();return()=>{ot.removeChannel(m),ot.removeChannel(y)}},[t,e]),D.useEffect(()=>{const d=()=>{Rn("success","Back online!")},m=()=>{Rn("warning","You are offline!")};return window.addEventListener("online",d),window.addEventListener("offline",m),()=>{window.removeEventListener("online",d),window.removeEventListener("offline",m)}},[]),{prayerTimes:n,extraInfo:a,asrInfo:l,loading:c}}const nP=({prayerTimes:t,extraInfo:e,color:n})=>{const[r,a]=D.useState({label:"",iqamah:!1,hours:0,minutes:0,seconds:0}),[s,l]=D.useState(0),{darkMode:u}=Aa(),{t:c}=Ar();if(D.useEffect(()=>{if(!(t!=null&&t.length))return;function N(){const j=Mg(t,e),L=j.label.split(" ").map(P=>c(P.toUpperCase())).join(" ");a({...j,label:L});const R=new Date,I=R.getHours()*60+R.getMinutes(),ee=[];for(const P of t)if(P.name!=="SUNRISE"){if(P.adhan){const[B,X]=P.adhan.split(":").map(Number);ee.push({time:B*60+X,label:`${P.name} Adhan`})}if(P.iqamah){const[B,X]=P.iqamah.split(":").map(Number);ee.push({time:B*60+X,label:`${P.name} Iqamah`})}}ee.sort((P,B)=>P.time-B.time);let G=!1;for(let P=0;P<ee.length-1;P++){const B=ee[P],X=ee[P+1];if(I>=B.time&&I<X.time){const F=X.time-B.time,K=(I-B.time)/F*100;l(Math.max(0,Math.min(100,K))),G=!0;break}}if(!G&&ee.length>0){const P=ee[ee.length-1],B={...ee[0],time:ee[0].time+1440};if(I>=P.time){const X=B.time-P.time,$=(I-P.time)/X*100;l(Math.max(0,Math.min(100,$))),G=!0}}G||l(0)}N();const A=setInterval(N,1e3);return()=>clearInterval(A)},[t]),!r.label)return null;const h=u?"#0C221F":"#67C090",d="#FFFFFF",m=500,y=280,g=220,x=40,_=40;return E.jsxs("div",{className:"flex flex-col items-center justify-center w-full text-white text-center font-ubuntu p-10",style:{color:u?"#DDF4E7":n},children:[E.jsxs("div",{className:"relative flex items-center justify-center",children:[E.jsxs("svg",{width:m,height:y,viewBox:`0 0 ${m} ${y}`,className:"absolute",style:{display:"block"},children:[E.jsx("path",{d:`M ${_} ${y-_} A ${g} ${g} 0 0 1 ${m-_} ${y-_}`,stroke:u?"#67C090":n,strokeWidth:x+2,fill:"none",strokeLinecap:"butt"}),E.jsx("path",{d:`M ${_} ${y-_} A ${g} ${g} 0 0 1 ${m-_} ${y-_}`,stroke:d,strokeWidth:x,fill:"none",strokeLinecap:"butt"}),E.jsx("path",{d:`M ${_} ${y-_} A ${g} ${g} 0 0 1 ${m-_} ${y-_}`,stroke:h,strokeWidth:x,fill:"none",strokeDasharray:Math.PI*g,strokeDashoffset:Math.PI*g-s/100*Math.PI*g,strokeLinecap:"butt",style:{transition:"stroke-dashoffset 1s linear"}})]}),E.jsx("div",{className:"mt-14 flex flex-col items-center z-10",children:E.jsxs("span",{className:"text-4xl font-bold",children:[r.label,!r.iqamah&&E.jsx("br",{}),r.iqamah&&E.jsxs(E.Fragment,{children:[E.jsx("br",{}),c("IQAMAH")]})," ",c("IN")]})})]}),E.jsx("div",{className:`${r.iqamah&&"mt-2"} text-6xl font-bold`,children:`${String(r.hours).padStart(2,"0")}:${String(r.minutes).padStart(2,"0")}:${String(r.seconds).padStart(2,"0")}`})]})},hf=t=>t.toString().padStart(2,"0"),P3=({isLobby:t=!1,color:e="#0c1844"})=>{const{darkMode:n}=Aa(),[r,a]=D.useState(()=>{const s=new Date;return{hours:hf(s.getHours()),minutes:hf(s.getMinutes()),seconds:hf(s.getSeconds())}});return D.useEffect(()=>{const s=setInterval(()=>{const l=new Date;a({hours:hf(l.getHours()),minutes:hf(l.getMinutes()),seconds:hf(l.getSeconds())})},1e3);return()=>clearInterval(s)},[]),E.jsx("div",{className:`flex flex-col justify-center font-ubuntu ${t?"py-4 sm:py-6 2xl:py-8":""} w-full`,style:{color:n?"#DDF4E7":e},children:E.jsx("div",{className:"flex justify-center",children:E.jsxs("span",{className:`${t?"text-4xl sm:text-6xl lg:text-7xl":"text-5xl sm:text-7xl lg:text-[120px]"} font-extrabold leading-none`,children:[r.hours,":",r.minutes,":",r.seconds]})})})},rP=({prayerTimes:t,extraInfo:e,date:n,textColor:r,org_nr:a})=>E.jsxs("div",{className:"h-full flex flex-col px-4",children:[E.jsx(Md,{nr:3,textColor:r,orgNr:a}),E.jsx("div",{className:"flex-1 flex items-center justify-center",children:E.jsxs("div",{className:"flex flex-col h-full justify-between py-10",children:[E.jsx(j3,{date:n,color:r}),E.jsx(P3,{color:r}),E.jsx(nP,{prayerTimes:t,extraInfo:e,color:r})]})})]}),M3=({prayerTimes:t,extraInfo:e,prayerTimesColor:n,extraInfoColor:r,isLobby:a,isDefault:s})=>{const{org_nr:l}=ia(),{iqamahDuration:u,currentPrayer:c}=Gy(t,e),[h,d]=D.useState(null),{language:m}=Tu(),y=m==="ar",{darkMode:g}=Aa(),{t:x}=Ar(),_=Rd(t);D.useEffect(()=>{if(u&&c&&l){const j=Date.now()+u*1e3,L=new URLSearchParams({name:c.name,endTime:String(j)});window.location.href=`/${l}/masjid/iqamah?${L.toString()}`}},[u,c,l]),D.useEffect(()=>{const j=setInterval(()=>{const L=new Date,R=L.getHours()*3600+L.getMinutes()*60+L.getSeconds();let I=1/0;for(const ee of t){const G=ee==null?void 0:ee.iqamah;if(!G)continue;const[P,B]=G.split(":").map(Number);if(Number.isNaN(P)||Number.isNaN(B))continue;const F=P*3600+B*60-R;F>0&&F<I&&(I=F)}d(I===1/0?null:I)},1e3);return()=>clearInterval(j)},[t]);const N=h!==null&&h<=Wy&&h>0,A=g?"#3F5551":n.bg;return E.jsx("div",{className:"font-ubuntu h-full w-full",children:N?E.jsx(Vy,{}):E.jsx("div",{className:`w-full h-full ${a?"":"border-l-3"}`,style:{borderColor:g?"#0C221F":n.text,direction:y?"rtl":"ltr"},children:E.jsxs("table",{className:"w-full h-full min-h-0 text-center",children:[E.jsx("thead",{style:{color:g?"#DDF4E7":n.text},children:E.jsxs("tr",{className:"border-b-2",style:{borderColor:g?"#DDF4E7":n.text},children:[E.jsx("th",{className:`${a?"py-3":"py-4"} ${y?"text-right pr-6":"text-left pl-6"} text-2xl font-light`,style:{backgroundColor:g?"#3F5551":n.bg},children:x("PRAYER")}),E.jsx("th",{className:`${a?"py-3":"py-4"} text-2xl font-light`,style:{backgroundColor:g?"#3F5551":n.bg},children:x("ADHAN")}),E.jsx("th",{className:`${a?"py-3":"py-4"} text-2xl font-light`,style:{backgroundColor:g?"#3F5551":n.bg},children:x("IQAMAH")}),E.jsx("th",{className:`${a?"py-3":"py-4"} text-2xl font-light`,style:{backgroundColor:g?"#3F5551":n.bg},children:x("TOMORROW")})]})}),E.jsxs("tbody",{children:[t.map((j,L)=>{const R=L===_,I=Lg(L,t),ee=R?g?"#F30303":"#E01919":g?"#DDF4E7":n.text;return E.jsxs("tr",{children:[E.jsx("td",{className:`font-bold text-3xl ${a?"py-1":"py-3"} ${y?"text-right pr-6":"text-left pl-6"}`,style:{color:ee,backgroundColor:A},children:j.name==="Fajr end"?E.jsx(jd,{color:"orange",size:28}):x(j.name.toUpperCase())}),E.jsx("td",{className:`font-bold text-3xl ${a?"py-1":"py-3"}`,style:{backgroundColor:A},children:E.jsx("span",{className:I?"opacity-40":"",style:{color:ee},children:j.adhan})}),E.jsx("td",{className:`font-bold text-3xl ${a?"":"py-3"}`,style:{backgroundColor:A},children:j.iqamah&&E.jsx("span",{className:"p-3 w-[92px] h-full text-center rounded-lg",style:{backgroundColor:a?"":g?"#DDF4E7":s?"#124170":r.text,color:a?R?g?"#F30303":"#DE0404":g?"#D6EBDF":n.text:g?"#0C221F":s?"white":r.bg,fontWeight:"bold"},children:E.jsx("span",{className:I?"opacity-40":"opacity-100",children:j.iqamah})})}),E.jsx("td",{className:`font-extrabold text-3xl ${a?"py-1":"py-3"}`,style:{backgroundColor:A},children:E.jsx("span",{style:{color:ee},children:j.tomorrow})})]},j.name||L)}),E.jsxs("tr",{className:`${a?"":"border-t-2"}`,style:{borderColor:g?"#DDF4E733":n.text+"33",color:g?"#DDF4E7":n.text},children:[E.jsx("td",{className:"pt-6",style:{backgroundColor:g?"#0C221F":n.bg}}),[1,2,3].map(j=>E.jsxs("td",{className:"text-xl font-medium pt-2",style:{backgroundColor:g?"#0C221F":n.bg,color:g?"#DDF4E7":n.text},children:[x("JAMAAT")," ",j]},j))]}),e.filter(j=>j.label==="Eid"?Array.isArray(j.time)&&j.time.some(L=>L&&L.trim()!==""):!0).map((j,L)=>E.jsxs("tr",{children:[E.jsx("td",{className:`font-bold text-3xl ${a?"py-1":"py-3"} w-65 ${y?"text-right pr-6":"text-left pl-6"}`,style:{color:g?"#DDF4E7":r.text,backgroundColor:g?"#0C221F":r.bg},children:x(j.label.toUpperCase())}),[0,1,2].map(R=>E.jsx("td",{className:"text-center",style:{backgroundColor:g?"#0C221F":r.bg},children:E.jsx("p",{className:"text-3xl font-bold",style:{color:g?"#DDF4E7":r.text,minWidth:"4rem"},children:Array.isArray(j.time)?j.time[R]||"_":j.time||"_"})},R))]},j.label||L))]})]})})})},aP=[{label:"Jumuah",arabic:"الجمعة",time:["19:57","20:00"]},{label:"Eid",arabic:"صلاة العيد",time:["08:00"]}],vu=270,Sx=400,_x=180*Math.PI/180,iP=0*Math.PI/180,sP=Array.from({length:5},(t,e)=>_x+(iP-_x)*e/4),oP=t=>{const[e,n]=t.split(":").map(Number);return e*60+n},lP=({prayerTimes:t,prayerTimesColor:e,asrInfo:n,isDefault:r})=>{const{org_nr:a}=ia(),{iqamahDuration:s,currentPrayer:l}=Gy(t,aP),[u,c]=D.useState(null),h=new Date,d=h.getHours()*60+h.getMinutes(),m=Rd(t),y=Tg(t);D.useEffect(()=>{if(s&&l&&a){const x=Date.now()+s*1e3,_=new URLSearchParams({name:l.name,endTime:String(x)});window.location.href=`/${a}/masjid/iqamah?${_.toString()}`}},[s,l,a]),D.useEffect(()=>{const x=setInterval(()=>{const _=new Date,N=_.getHours()*3600+_.getMinutes()*60+_.getSeconds();let A=1/0;for(const j of t){const L=j==null?void 0:j.iqamah;if(!L)continue;const[R,I]=L.split(":").map(Number);if(Number.isNaN(R)||Number.isNaN(I))continue;const G=R*3600+I*60-N;G>0&&G<A&&(A=G)}c(A===1/0?null:A)},1e3);return()=>clearInterval(x)},[t]);const g=u!==null&&u<=Wy&&u>0;return E.jsx("div",{className:"flex flex-col items-center text-[#102E50] dark:text-[#F5C45E]",children:g?E.jsx("div",{className:"flex items-center justify-center",style:{width:2*vu,height:2*vu,minHeight:2*vu},children:E.jsx(Vy,{})}):E.jsxs("div",{className:"relative flex items-center",style:{width:2*vu,height:2*vu,minHeight:2*vu},children:[E.jsx("div",{className:"absolute left-1/2 top-1/2 rounded-full w-100 h-100 flex items-center justify-center bg-white",style:{transform:"translate(-50%, -80%)",zIndex:10},children:E.jsx(Id,{prayerTimes:y,asrInfo:n,theme:1})}),t.filter(x=>x.name!=="Fajr end").map((x,_)=>{const N=sP[_],A=vu+Sx*Math.cos(N),j=vu+Sx*Math.sin(N),L=oP(x.adhan),R=_===m,I=L<d;return E.jsx("div",{className:"absolute",style:{left:A,top:j,transform:"translate(-55%, -160%)",width:200,zIndex:20},children:E.jsx(O3,{name:x.name,arabic:x.arabic,adhan:x.adhan,iqamah:x.iqamah,tomorrow:x.tomorrow,isNext:R,isPast:I,color:e.text,bg:e.bg,isDefault:r})},_)})]})})},I3=({extraInfo:t,extraInfoColor:e,isLobby:n,isDefault:r,isPreview:a})=>{const{t:s}=Ar(),{darkMode:l}=Aa(),{language:u}=Tu(),c=u==="ar",h=(d,m)=>{const y=Array.isArray(d.time)&&d.time.length>1,g=Array.isArray(d.time)?d.time:[d.time];return n&&y?E.jsxs("div",{className:"py-1 flex flex-col",children:[E.jsxs("div",{className:"flex justify-between gap-4",children:[E.jsxs("h4",{children:[s(d.label.toUpperCase())," :"]}),E.jsx("h4",{className:"font-bold",children:g[0]})]}),g.slice(1).map((x,_)=>E.jsx("div",{className:"flex justify-end",children:E.jsx("h4",{className:"font-bold",children:x})},_))]},m):E.jsxs("div",{className:"flex justify-between gap-6 py-1",children:[E.jsxs("h4",{className:"text-start w-32 font-semibold",children:[s(d.label.toUpperCase())," :"]}),E.jsxs("div",{className:"font-bold flex justify-between gap-6",children:[E.jsx("h4",{children:g[0]||""}),E.jsx("h4",{children:g[1]||""}),E.jsx("h4",{children:g[2]||""})]})]},m)};return E.jsx("div",{className:"w- flex flex-col gap-4",children:E.jsx("div",{className:`
|
|
935
|
+
${n?a?"w-40 py-4 px-0.5":"w-52 py-4 text-base md:text-lg lg:text-xl":"min-w-70 max-w-110 min-h-20 flex justify-center"}
|
|
936
|
+
flex flex-col mx-auto py-1 px-4 rounded-lg shadow-md text-center transition
|
|
937
|
+
font-montserrat font-medium text-lg md:text-xl lg:text-2xl
|
|
938
|
+
`,style:{color:l?"#F5C45E":e.text,backgroundColor:l?"#03182D":r?"#DBDBDB":e.bg,direction:c?"rtl":"ltr"},children:t.filter(d=>d.label==="Eid"?Array.isArray(d.time)&&d.time.some(m=>m&&m.trim()!==""):!0).map((d,m)=>h(d,m))})})},uP=({prayerTimes:t,extraInfo:e,extraInfoColor:n})=>{var c;const{t:r}=Ar(),[a,s]=D.useState({label:"",iqamah:!1,hours:0,minutes:0,seconds:0}),{darkMode:l}=Aa();D.useEffect(()=>{if(!t.length)return;function h(){s(Mg(t,e))}h();const d=setInterval(h,1e3);return()=>clearInterval(d)},[t]);const u=(c=a==null?void 0:a.label)==null?void 0:c.split(" ").map(h=>r(h.toUpperCase())).join(" ");return E.jsx("div",{className:`\r
|
|
939
|
+
w-75 h-30 flex flex-col mx-auto\r
|
|
940
|
+
p-2 px-6 rounded-lg shadow-md text-center transition\r
|
|
941
|
+
font-montserrat justify-center\r
|
|
942
|
+
`,style:{color:l?"#F5C45E":n.text,backgroundColor:l?"#03182D":n.bg},children:a&&a.label&&E.jsxs("div",{className:"",children:[E.jsxs("h2",{className:"font-semibold mb-2 text-base md:text-lg lg:text-2xl",children:[u," ",a.iqamah&&r("IQAMAH")," ",r("IN")]}),E.jsx("h4",{className:"font-bold text-xl md:text-2xl lg:text-4xl",children:`${String(a.hours).padStart(2,"0")}:${String(a.minutes).padStart(2,"0")}:${String(a.seconds).padStart(2,"0")}`})]})})},F3=D.createContext(null),O1={didCatch:!1,error:null};let cP=class extends D.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=O1}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){var r,a;const{error:n}=this.state;n!==null&&((a=(r=this.props).onReset)==null||a.call(r,{args:e,reason:"imperative-api"}),this.setState(O1))}componentDidCatch(e,n){var r,a;(a=(r=this.props).onError)==null||a.call(r,e,n)}componentDidUpdate(e,n){var s,l;const{didCatch:r}=this.state,{resetKeys:a}=this.props;r&&n.error!==null&&fP(e.resetKeys,a)&&((l=(s=this.props).onReset)==null||l.call(s,{next:a,prev:e.resetKeys,reason:"keys"}),this.setState(O1))}render(){const{children:e,fallbackRender:n,FallbackComponent:r,fallback:a}=this.props,{didCatch:s,error:l}=this.state;let u=e;if(s){const c={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof n=="function")u=n(c);else if(r)u=D.createElement(r,c);else if(a!==void 0)u=a;else throw l}return D.createElement(F3.Provider,{value:{didCatch:s,error:l,resetErrorBoundary:this.resetErrorBoundary}},u)}};function fP(t=[],e=[]){return t.length!==e.length||t.some((n,r)=>!Object.is(n,e[r]))}function hP(t){return t!==null&&typeof t=="object"&&"didCatch"in t&&typeof t.didCatch=="boolean"&&"error"in t&&"resetErrorBoundary"in t&&typeof t.resetErrorBoundary=="function"}function dP(t){if(!hP(t))throw new Error("ErrorBoundaryContext not found")}function U3(){const t=D.useContext(F3);dP(t);const{error:e,resetErrorBoundary:n}=t,[r,a]=D.useState({error:null,hasError:!1}),s=D.useMemo(()=>({error:e,resetBoundary:()=>{n(),a({error:null,hasError:!1})},showBoundary:l=>a({error:l,hasError:!0})}),[e,n]);if(r.hasError)throw r.error;return s}const pP={BackgroundDiv:t=>{const{prayerTimes:e,prayerTimesWithSunrise:n,extraInfo:r,asrInfo:a,date:s,isDefault:l,textColor:u,prayerTimesColor:c,extraInfoColor:h,...d}=t;return E.jsx("div",{...d})},TimeTablePart:W7,ClockPart:X7,MasjidLogo:Md,TimeAndDate:Z7,ClockAndPrayers:lP,ExtraInfo:I3,CountdownBox:uP,DigitalClockPart:rP,TimeTable:M3};function ey({components:t,componentProps:e}){const{darkMode:n}=Aa();return E.jsx(E.Fragment,{children:t.map((r,a)=>{var l,u,c,h,d,m,y,g;const s=pP[r.type];if(s){const x={...r.props||{},...e};let _={};return n?(l=r.style)!=null&&l.darkBackgroundImage?_={backgroundImage:`url(${"https://irn-api.bonnetider.eu/storage/v1/object/public"+r.style.darkBackgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:(u=r.style)!=null&&u.backgroundColor?_={backgroundColor:r.style.backgroundColor}:(c=r.style)!=null&&c.darkBackground&&(_={backgroundColor:r.style.darkBackground}):(h=r.style)!=null&&h.backgroundColor?_={backgroundColor:r.style.backgroundColor}:(d=r.style)!=null&&d.background?_={backgroundColor:r.style.background}:(m=r.style)!=null&&m.backgroundImage?_={backgroundImage:`url(${"https://irn-api.bonnetider.eu/storage/v1/object/public"+r.style.backgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",filter:(y=r.style)==null?void 0:y.backgroundBlur}:(g=r.style)!=null&&g.background&&(_={backgroundColor:r.style.background}),E.jsx("div",{className:r.className||"",style:_,children:E.jsx(s,{...x})},a)}else return r.components&&r.gridConfig?E.jsx("div",{className:r.gridConfig.className+" "+(r.className||""),children:E.jsx(ey,{components:r.components,componentProps:e})},a):r.components?E.jsx("div",{className:r.className||"",children:E.jsx(ey,{components:r.components,componentProps:e})},a):null})})}function mP({config:t,componentProps:e={}}){const[n,r]=D.useState("loading"),{error:a,showBoundary:s}=U3();return D.useEffect(()=>{if(!t)return;const l=setTimeout(()=>{n==="loading"&&(!t||!t.components||!t.gridConfig)&&s(new Error("No Prayer hall layout configuration Found"))},5e3);return()=>clearTimeout(l)},[t,s]),D.useEffect(()=>{t!=null&&t.components&&t.gridConfig&&r("ready")},[t]),a?null:n==="loading"?E.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-gradient-to-br from-emerald-50 to-teal-50",children:E.jsxs("div",{className:"text-center max-w-md",children:[E.jsx("div",{className:"w-16 h-16 border-4 border-emerald-200 border-t-emerald-600 rounded-full animate-spin mx-auto mb-4"}),E.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Loading prayer hall..."}),E.jsx("p",{className:"text-gray-600",children:"Preparing prayer space"})]})}):E.jsx("div",{className:t.gridConfig.className||"",style:t.gridConfig.style,children:E.jsx(ey,{components:t.components,componentProps:e})})}const qf=({classNames:t="border-black"})=>E.jsx("div",{className:"flex items-center justify-center h-full",children:E.jsx("div",{className:`w-8 h-8 border-3 border-t-transparent rounded-full animate-spin ${t}`})}),gP="layout-db",Qm="layoutConfig";async function B3(){return Xr(gP,2,{upgrade(t){t.objectStoreNames.contains(Qm)||t.createObjectStore(Qm)}})}async function fc(t,e){await(await B3()).put(Qm,e,t)}async function Hf(t){return(await B3()).get(Qm,t)}function vP(t){const[e,n]=D.useState(null),[r,a]=D.useState(!0);return D.useEffect(()=>{let s=null;if(!t){n(null),a(!1);return}const l=async()=>{if(a(!0),!navigator.onLine){const u=await Hf(`${t}-prayerhall`);if(u){n(u),a(!1);return}}try{const{data:u,error:c}=await ot.from("mosque_t").select("organisasjonsnummer").eq("organisasjonsnummer",t).single();if(!u||c){Rn("error","Please enter a valid org_nr!");return}const{data:h,error:d}=await ot.from("layout").select("prayerhall_theme_id, prayerhall_layout").eq("mosque_id",t).single();if(!d&&h.prayerhall_layout){n(h.prayerhall_layout),await fc(`${t}-prayerhall`,h.prayerhall_layout);return}const{data:m,error:y}=await ot.from("layout").select("prayerhall_theme_id, prayerhall_layout").eq("mosque_id",982842840).single();if(y)throw y;const{error:g}=await ot.from("layout").upsert([{mosque_id:t,prayerhall_theme_id:m.prayerhall_theme_id,prayerhall_layout:m==null?void 0:m.prayerhall_layout}],{onConflict:"mosque_id"}).single();if(g)throw g;n(m==null?void 0:m.prayerhall_layout),await fc(`${t}-prayerhall`,m==null?void 0:m.prayerhall_layout)}catch(u){const c=await Hf(`${t}-prayerhall`);n(c||null),console.log("Error fetching or creating config: ",u),await aa(u,{mosqueId:t})}finally{a(!1)}};return l(),s=ot.channel(`prayerhall_layout_changes:${t}`).on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${t}`},()=>{l()}).subscribe(),()=>{s==null||s.unsubscribe()}},[t]),{config:e,loading:r}}function yP(t){return Na({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M5 16h3v3h2v-5H5v2zm3-8H5v2h5V5H8v3zm6 11h2v-3h3v-2h-5v5zm2-11V5h-2v5h5V8h-3z"},child:[]}]})(t)}function bP(t){return Na({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"},child:[]}]})(t)}function Yy(t){return Na({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M7 8h10c.29 0 .57.06.84.13.09-.33.16-.67.16-1.04 0-1.31-.65-2.53-1.74-3.25L12 1 7.74 3.84A3.887 3.887 0 0 0 6 7.09c0 .37.07.71.16 1.04.27-.07.55-.13.84-.13z"},child:[]},{tag:"path",attr:{d:"M24 7c0-1.1-2-3-2-3s-2 1.9-2 3c0 .74.4 1.38 1 1.72V13h-2v-2c0-1.1-.9-2-2-2H7c-1.1 0-2 .9-2 2v2H3V8.72c.6-.34 1-.98 1-1.72 0-1.1-2-3-2-3S0 5.9 0 7c0 .74.4 1.38 1 1.72V21h9v-4c0-1.1.9-2 2-2s2 .9 2 2v4h9V8.72c.6-.34 1-.98 1-1.72z"},child:[]}]})(t)}const $3=({targetRef:t})=>{const[e,n]=D.useState(!1);D.useEffect(()=>{const a=()=>{n(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",a),()=>{document.removeEventListener("fullscreenchange",a)}},[]);const r=()=>{var a;document.fullscreenElement?document.exitFullscreen():(a=t.current)==null||a.requestFullscreen()};return E.jsx("button",{onClick:r,className:`absolute top-4 right-4 z-50 ${e?"bg-white/40 hover:bg-white/50":"bg-white/80 hover:bg-white/90"} rounded shadow hover:cursor-pointer`,title:e?"Exit Fullscreen":"Enter Fullscreen",children:e?E.jsx(yP,{size:30}):E.jsx(bP,{size:30})})};function z3(t){if(!t[1].adhan||!t[4].adhan)return"light";const e=new Date;function n(s){const[l,u]=s.split(":").map(Number),c=new Date(e);return c.setHours(l,u,0,0),c}const r=n(t[1].adhan),a=n(t[4].adhan);return e>=r&&e<a?"light":"dark"}function q3(t){return Na({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M256 128c35.35 0 64-28.65 64-64S291.35 0 256 0s-64 28.65-64 64 28.65 64 64 64zm-30.63 169.75c14.06 16.72 39 19.09 55.97 5.22l88-72.02c17.09-13.98 19.59-39.19 5.62-56.28-13.97-17.11-39.19-19.59-56.31-5.62l-57.44 47-38.91-46.31c-15.44-18.39-39.22-27.92-64-25.33-24.19 2.48-45.25 16.27-56.37 36.92l-49.37 92.03c-23.4 43.64-8.69 96.37 34.19 123.75L131.56 432H40c-22.09 0-40 17.91-40 40s17.91 40 40 40h208c34.08 0 53.77-42.79 28.28-68.28L166.42 333.86l34.8-64.87 24.15 28.76z"},child:[]}]})(t)}function wP(t){return Na({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497.39 361.8l-112-48a24 24 0 0 0-28 6.9l-49.6 60.6A370.66 370.66 0 0 1 130.6 204.11l60.6-49.6a23.94 23.94 0 0 0 6.9-28l-48-112A24.16 24.16 0 0 0 122.6.61l-104 24A24 24 0 0 0 0 48c0 256.5 207.9 464 464 464a24 24 0 0 0 23.4-18.6l24-104a24.29 24.29 0 0 0-14.01-27.6z"},child:[]}]})(t)}function H3(t){return Na({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M272 0H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h224c26.5 0 48-21.5 48-48V48c0-26.5-21.5-48-48-48zM160 480c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm112-108c0 6.6-5.4 12-12 12H60c-6.6 0-12-5.4-12-12V60c0-6.6 5.4-12 12-12h200c6.6 0 12 5.4 12 12v312z"},child:[]}]})(t)}function xP(t){return Na({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M285.476 272.971L91.132 467.314c-9.373 9.373-24.569 9.373-33.941 0l-22.667-22.667c-9.357-9.357-9.375-24.522-.04-33.901L188.505 256 34.484 101.255c-9.335-9.379-9.317-24.544.04-33.901l22.667-22.667c9.373-9.373 24.569-9.373 33.941 0L285.475 239.03c9.373 9.372 9.373 24.568.001 33.941z"},child:[]}]})(t)}function SP(t){return Na({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M34.52 239.03L228.87 44.69c9.37-9.37 24.57-9.37 33.94 0l22.67 22.67c9.36 9.36 9.37 24.52.04 33.9L131.49 256l154.02 154.75c9.34 9.38 9.32 24.54-.04 33.9l-22.67 22.67c-9.37 9.37-24.57 9.37-33.94 0L34.52 272.97c-9.37-9.37-9.37-24.57 0-33.94z"},child:[]}]})(t)}function _P(t){return Na({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34zm192-34l-136-136c-9.4-9.4-24.6-9.4-33.9 0l-22.6 22.6c-9.4 9.4-9.4 24.6 0 33.9l96.4 96.4-96.4 96.4c-9.4 9.4-9.4 24.6 0 33.9l22.6 22.6c9.4 9.4 24.6 9.4 33.9 0l136-136c9.4-9.2 9.4-24.4 0-33.8z"},child:[]}]})(t)}function EP(t){return Na({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M223.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L319.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L393.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34zm-192 34l136 136c9.4 9.4 24.6 9.4 33.9 0l22.6-22.6c9.4-9.4 9.4-24.6 0-33.9L127.9 256l96.4-96.4c9.4-9.4 9.4-24.6 0-33.9L201.7 103c-9.4-9.4-24.6-9.4-33.9 0l-136 136c-9.5 9.4-9.5 24.6-.1 34z"},child:[]}]})(t)}function R1(t){return Na({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M148 288h-40c-6.6 0-12-5.4-12-12v-40c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12zm108-12v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 96v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm-96 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm192 0v-40c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12v40c0 6.6 5.4 12 12 12h40c6.6 0 12-5.4 12-12zm96-260v352c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V112c0-26.5 21.5-48 48-48h48V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h128V12c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v52h48c26.5 0 48 21.5 48 48zm-48 346V160H48v298c0 3.3 2.7 6 6 6h340c3.3 0 6-2.7 6-6z"},child:[]}]})(t)}function AP(){const{org_nr:t}=ia(),e=Bi(),n=new Date().toISOString().split("T")[0],{config:r}=vP(t),{isDefault:a,textColor:s,prayerTimesColor:l,extraInfoColor:u,...c}=r||{},{prayerTimes:h,extraInfo:d,asrInfo:m,loading:y}=D3(t,n),{setDarkMode:g}=Aa();D.useEffect(()=>{if(!h||h.length===0)return;const j=()=>{const R=z3(h);R==="dark"?g(!0):R==="light"&&g(!1)};j();const L=setInterval(j,60*1e3);return()=>clearInterval(L)},[h,g]);const{language:x}=Tu();D.useEffect(()=>{x&&Ir.changeLanguage(x)},[x]);const _=D.useRef(null),[N,A]=D.useState(!1);return D.useEffect(()=>{const j=()=>{A(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",j),()=>document.removeEventListener("fullscreenchange",j)},[]),y?E.jsx("div",{className:"h-screen",children:E.jsx(qf,{})}):h?E.jsxs("div",{ref:_,className:"relative",children:[!N&&E.jsxs(E.Fragment,{children:[E.jsx("button",{onClick:()=>e(`/${t||"982842840"}`),className:"absolute top-4 right-26 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:s||"#4F46E5"},children:E.jsx(H3,{size:24,className:"cursor-pointer"})}),E.jsx("button",{onClick:()=>e(`/${t||"982842840"}/lobby`),className:"absolute top-4 right-13 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:s||"#4F46E5"},children:E.jsx(Yy,{size:24,className:"cursor-pointer"})})]}),E.jsx($3,{targetRef:_}),E.jsx(mP,{config:c,componentProps:{date:n,prayerTimes:h,extraInfo:d,asrInfo:m,textColor:s,prayerTimesColor:l,extraInfoColor:u,isDefault:a}})]}):E.jsx("div",{children:"Prayer times not found."})}const V3=({nr:t,prayerTimes:e,asrInfo:n,date:r,color:a,reverse:s=!1})=>{const{i18n:l,t:u}=Ar(),c=l.language||"en",{org_nr:h}=ia(),d=Pg(),{darkMode:m}=Aa(),[y,g]=D.useState(()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})),[x,_]=D.useState(()=>new Date(r).toLocaleDateString(c==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}));D.useEffect(()=>{const L=setInterval(()=>{g(new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}))},1e3);return()=>clearInterval(L)},[]),D.useEffect(()=>{const L=new Date(r);_(L.toLocaleDateString(c==="no"?"nb-NO":"en-IN",{year:"numeric",month:"long",day:"numeric"}))},[r,c]);const[N,A]=D.useState(null);D.useEffect(()=>{(async()=>{if(r){if(!navigator.onLine){const R=await Dl(r);if(R){A(R);return}}try{const{data:R,error:I}=await ot.from("hijri_dates").select("hijri_date_day, hijri_date_month, hijri_date_year").eq("gregorian_date",r).single();if(I)throw new Error(I.message);if(!R)throw new Error("No corresponding hijri day found!");A(R),await kg(r,R)}catch(R){const I=await Dl(r);I&&A(I),console.log(R)}}})()},[r]);const j=Tg(e);return E.jsxs("div",{className:`w-full h-full flex flex-col sm:flex-row ${s?"sm:flex-row-reverse ml-4":"-ml-2 2xl:-ml-4"}`,children:[E.jsxs("div",{className:`w-full sm:w-[55%] flex flex-col ${s?"pl-8":"pl-4"} justify-between py-2 2xl:py-4 font-chakra dark:text-[#F2E7D5]`,style:{color:m?t===1?"#F2E7D5":"#F5C45E":a},children:[E.jsx(Md,{nr:t,orgNr:h,textColor:a,isLobby:!0}),E.jsxs("div",{children:[E.jsx("h2",{className:"font-bold leading-none mb-2 sm:mb-3 whitespace-nowrap",style:{fontSize:"clamp(2rem, 5vw, 7rem)"},children:y}),E.jsx("h4",{className:"font-bold text-base lg:text-2xl",children:N&&d.length>0?zo({hijriDayObj:N,language:c,t:u,hijriMonthNames:d}):"-"}),E.jsx("h4",{className:"font-bold text-base lg:text-2xl",children:x})]})]}),E.jsx("div",{className:"w-full h-full sm:w-[45%] flex items-center justify-center",children:E.jsx("div",{className:"w-full max-w-[100%] scale-110",children:E.jsx(Id,{prayerTimes:j,asrInfo:n,theme:1})})})]})},NP=({prayerTimes:t,extraInfo:e,prayerTimesColor:n,extraInfoColor:r,isDefault:a})=>{const{darkMode:s}=Aa(),{language:l}=Tu(),{t:u}=Ar(),c=Rd(t),h=l==="ar";return E.jsx("div",{className:"font-chakra w-full mt-auto",style:{color:s?"#F2E7D5":n.text},children:E.jsxs("div",{className:" dark:text-[#F2E7D5] backdrop-blur-md rounded-2xl 2xl:rounded-3xl shadow-sm min-w-0 dark:bg-gradient-to-r dark:from-[#1C1B1BBF] dark:to-[#13121299]",style:{backgroundColor:s?"":a?F4(n.bg,.75):n.bg},dir:h?"rtl":"ltr",children:[E.jsxs("div",{className:"table w-full border-b-2 border-[#00000026] dark:border-[#F2E7D530] p-2 2xl:px-4 py-3",children:[E.jsx("div",{className:"table-header-group w-full text-sm sm:text-base 2xl:text-xl font-bold",style:{color:s?"#F2E7D5":a?"#53452E":n.text},children:E.jsxs("div",{className:"table-row",children:[E.jsx("div",{className:`table-cell py-1 pl-2 ${h?"text-right":"text-left"} border-b-2 border-[#00000026] dark:border-[#F2E7D530]`,children:u("SALAH")}),!h&&E.jsx("div",{className:"table-cell text-right border-b-2 border-[#00000026] dark:border-[#F2E7D530]"}),E.jsx("div",{className:"table-cell text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:u("ADHAN")}),E.jsx("div",{className:"table-cell text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:u("IQAMAH")}),E.jsx("div",{className:"table-cell text-center border-b-2 border-[#00000026] dark:border-[#F2E7D530]",children:u("TMRW")})]})}),E.jsx("div",{className:"table-row-group w-full text-base sm:text-lg 2xl:text-2xl",children:t.map((d,m)=>{const y=m===c,x=Lg(m,t)&&!y?"dark:text-[#F2E7D5] opacity-40":"",_={backgroundColor:s?"#54462E":a?"#CFB78F":r.bg,color:a?"":r.text,borderBlockColor:s?"#F2E7DF":a?"#53452E":r.text};return E.jsxs("div",{className:"table-row",children:[E.jsx("div",{className:`table-cell py-1 pl-2 ${h?"text-right":"text-left"} font-bold ${y?h?"border-r-2 border-y-2 rounded-r-xl":"border-l-2 border-y-2 rounded-l-xl":""}`,style:y?_:{},children:d.name==="Fajr end"?E.jsx(jd,{color:"orange",size:28}):u(d.name.toUpperCase())}),!h&&E.jsx("div",{className:`table-cell py-1 text-right ${y&&"border-y-2"}`,style:y?_:{},children:d.arabic}),E.jsx("div",{className:`table-cell py-1 text-center font-bold ${x} ${y&&"border-y-2"}`,style:y?_:{},children:d.adhan}),E.jsx("div",{className:`table-cell py-1 text-center font-semibold ${x} ${y?h?"border-l-2 border-y-2 rounded-l-xl":"border-r-2 border-y-2 rounded-r-xl":""}`,style:y?_:{},children:d.iqamah}),E.jsx("div",{className:"table-cell py-1 text-center font-semibold",children:d.tomorrow})]},m)})})]}),E.jsx("div",{className:"px-6 py-4 text-sm sm:text-base 2xl:text-xl font-bold rounded-b-3xl",style:{color:s?"#F2E7D5":r.text,backgroundColor:s?"#54462E":a?"#CFB78F":r.bg},children:E.jsx("div",{className:h?"w-[60%]":"",children:e.filter(d=>d.label==="Eid"?Array.isArray(d.time)&&d.time.some(m=>m&&m.trim()!==""):!0).map((d,m)=>E.jsxs("div",{className:"flex justify-between py-2",children:[E.jsx("div",{className:"w-2/5",children:u(d==null?void 0:d.label.toUpperCase())}),Array.isArray(d.time)?(h?[2,1,0]:[0,1,2]).map(y=>E.jsx("div",{className:"w-1/4 md:w-1/5 text-center ",children:d.time[y]||"_"},y)):E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"w-1/5 text-center ",children:d.time}),E.jsx("div",{className:"w-1/5"}),E.jsx("div",{className:"w-1/5"})]})]},m))})})]})})},CP=({prayerTimes:t,extraInfo:e,asrInfo:n,date:r,textColor:a,prayerTimesColor:s,extraInfoColor:l,isDefault:u})=>E.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[E.jsx("div",{className:"overflow-hidden flex flex-col bg-red- flex-2 p-1 2xl:p-2 justify-center h-full",children:E.jsx(V3,{nr:1,color:a,prayerTimes:t,asrInfo:n,date:r})}),E.jsx("div",{className:"overflow-hidden min-h-0 flex flex-col flex-3 justify-center h-full",children:E.jsx(NP,{prayerTimes:t,extraInfo:e,prayerTimesColor:s,extraInfoColor:l,isDefault:u})})]}),TP=({date:t,prayerTimes:e,extraInfo:n,textColor:r,prayerTimesColor:a,extraInfoColor:s,isDefault:l})=>{const{org_nr:u}=ia();return E.jsxs("div",{className:"w-full h-full flex flex-col dark:bg-[#0C221F]",children:[E.jsxs("div",{className:"px-2 sm:px-4",children:[E.jsx(Md,{nr:3,textColor:r,orgNr:u,isLobby:!0,date:t}),E.jsx(P3,{isLobby:!0,color:r})]}),E.jsx("div",{className:"flex-1 flex justify-center 2xl:pb-4 overflow-hidden",children:E.jsx(M3,{prayerTimes:e,extraInfo:n,prayerTimesColor:a,extraInfoColor:s,isLobby:!0,isDefault:l})})]})},LP=({prayerTimes:t,extraInfo:e,prayerTimesColor:n,extraInfoColor:r,isDefault:a,isPreview:s})=>{const l=Rd(t);return E.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[t.filter(u=>u.name!=="Fajr end").map((u,c)=>{const h=c===l,d=Lg(c,t);return E.jsx("div",{children:E.jsx(O3,{name:u.name,arabic:u.arabic,adhan:u.adhan,iqamah:u.iqamah,tomorrow:u.tomorrow,isNext:h,isPast:d,isSmall:!0,color:n.text,bg:n.bg,isDefault:a,isPreview:s})},u.name)}),E.jsx("div",{className:"col-span-1 row-span-2 flex",children:E.jsx(I3,{extraInfo:e,extraInfoColor:r,isLobby:!0,isDefault:a,isPreview:s})})]})},jP=({date:t,prayerTimes:e,extraInfo:n,asrInfo:r,textColor:a,prayerTimesColor:s,extraInfoColor:l,isDefault:u,isPreview:c})=>E.jsxs("div",{className:"flex flex-col justify-center h-full min-h-0",children:[E.jsx("div",{className:"flex mb-10 mt-8",children:E.jsx(V3,{nr:2,prayerTimes:e,asrInfo:r,date:t,color:a,reverse:!0})}),E.jsx("div",{className:"flex h-full w-full",children:E.jsx(LP,{prayerTimes:e,extraInfo:n,prayerTimesColor:s,extraInfoColor:l,isDefault:u,isPreview:c})})]}),G3="mosque-media-db",eg="media";async function OP(t,e){await(await Xr(G3,1,{upgrade(r){r.createObjectStore(eg)}})).put(eg,e,t)}async function Ex(t){return await(await Xr(G3,1,{upgrade(n){n.createObjectStore(eg)}})).get(eg,t)}function RP(t){const[e,n]=D.useState([]),[r,a]=D.useState(3e3),[s,l]=D.useState(!0),u="https://irn-api.bonnetider.eu/storage/v1/object/public/mosques/982842840/multimedia/default.png";return D.useEffect(()=>{let c=null;if(!t){n([]),l(!1);return}const h=async()=>{if(l(!0),!navigator.onLine){const d=await Ex(t);if(d){n(d),l(!1);return}}try{const{data:d,error:m}=await ot.from("multimedia").select("path, type, enabled").eq("mosque_id",t).order("order");if(m)throw m;let y=(d||[]).filter(_=>_.enabled===!0).map(_=>({type:_.type,path:_.path}));if(d.length===0){const _={created_at:new Date().toISOString(),mosque_id:t,path:u,type:"image",enabled:!0,order:1},{data:N}=await ot.from("multimedia").select("id").eq("mosque_id",t).eq("path",_.path);if(!N||N.length===0){const{error:A}=await ot.from("multimedia").upsert(_,{onConflict:"mosque_id, order"});if(A&&!A.message.includes("duplicate key"))throw A;y=[{type:_.type,path:_.path}]}}n(y),await OP(t,y);const{data:g,error:x}=await ot.from("mosque_t").select("multimedia_duration").eq("organisasjonsnummer",t).single();if(x)throw x;a(g.multimedia_duration*1e3||5e3)}catch(d){const m=await Ex(t);m&&n(m),console.log("Error fetching media: ",d)}finally{l(!1)}};return h(),c=ot.channel("multimedia-changes").on("postgres_changes",{event:"*",schema:"public",table:"multimedia"},d=>{var m,y;(d.eventType==="DELETE"||((m=d.new)==null?void 0:m.mosque_id)===t||((y=d.old)==null?void 0:y.mosque_id)===t)&&h()}),c.subscribe(),()=>{c==null||c.unsubscribe()}},[t]),{mediaItems:e,duration:r,loading:s}}var k1={exports:{}},D1,Ax;function kP(){if(Ax)return D1;Ax=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return D1=t,D1}var P1,Nx;function DP(){if(Nx)return P1;Nx=1;var t=kP();function e(){}function n(){}return n.resetWarningCache=e,P1=function(){function r(l,u,c,h,d,m){if(m!==t){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function a(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:e};return s.PropTypes=s,s},P1}var Cx;function PP(){return Cx||(Cx=1,k1.exports=DP()()),k1.exports}var MP=PP();const Ya=yg(MP);var M1,Tx;function IP(){return Tx||(Tx=1,M1=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,a,s;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!t(e[a],n[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(s=Object.keys(e),r=s.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,s[a]))return!1;for(a=r;a--!==0;){var l=s[a];if(!t(e[l],n[l]))return!1}return!0}return e!==e&&n!==n}),M1}var FP=IP();const UP=yg(FP);var Wp={exports:{}},I1,Lx;function BP(){if(Lx)return I1;Lx=1;var t;/**
|
|
943
|
+
* @link https://github.com/gajus/sister for the canonical source repository
|
|
944
|
+
* @license https://github.com/gajus/sister/blob/master/LICENSE BSD 3-Clause
|
|
945
|
+
*/return t=function(){var e={},n={};return e.on=function(r,a){var s={name:r,handler:a};return n[r]=n[r]||[],n[r].unshift(s),s},e.off=function(r){var a=n[r.name].indexOf(r);a!==-1&&n[r.name].splice(a,1)},e.trigger=function(r,a){var s=n[r],l;if(s)for(l=s.length;l--;)s[l].handler(a)},e},I1=t,I1}var Yp={exports:{}},F1,jx;function $P(){if(jx)return F1;jx=1,F1=function(a,s,l){var u=document.head||document.getElementsByTagName("head")[0],c=document.createElement("script");typeof s=="function"&&(l=s,s={}),s=s||{},l=l||function(){},c.type=s.type||"text/javascript",c.charset=s.charset||"utf8",c.async="async"in s?!!s.async:!0,c.src=a,s.attrs&&t(c,s.attrs),s.text&&(c.text=""+s.text);var h="onload"in c?e:n;h(c,l),c.onload||e(c,l),u.appendChild(c)};function t(r,a){for(var s in a)r.setAttribute(s,a[s])}function e(r,a){r.onload=function(){this.onerror=this.onload=null,a(null,r)},r.onerror=function(){this.onerror=this.onload=null,a(new Error("Failed to load "+this.src),r)}}function n(r,a){r.onreadystatechange=function(){this.readyState!="complete"&&this.readyState!="loaded"||(this.onreadystatechange=null,a(null,r))}}return F1}var Ox;function zP(){return Ox||(Ox=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=$P(),r=a(n);function a(s){return s&&s.__esModule?s:{default:s}}e.default=function(s){var l=new Promise(function(u){if(window.YT&&window.YT.Player&&window.YT.Player instanceof Function){u(window.YT);return}else{var c=window.location.protocol==="http:"?"http:":"https:";(0,r.default)(c+"//www.youtube.com/iframe_api",function(d){d&&s.trigger("error",d)})}var h=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=function(){h&&h(),u(window.YT)}});return l},t.exports=e.default})(Yp,Yp.exports)),Yp.exports}var Kp={exports:{}},Jp={exports:{}},Xp={exports:{}},U1,Rx;function qP(){if(Rx)return U1;Rx=1;var t=1e3,e=t*60,n=e*60,r=n*24,a=r*365.25;U1=function(h,d){d=d||{};var m=typeof h;if(m==="string"&&h.length>0)return s(h);if(m==="number"&&isNaN(h)===!1)return d.long?u(h):l(h);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(h))};function s(h){if(h=String(h),!(h.length>100)){var d=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(h);if(d){var m=parseFloat(d[1]),y=(d[2]||"ms").toLowerCase();switch(y){case"years":case"year":case"yrs":case"yr":case"y":return m*a;case"days":case"day":case"d":return m*r;case"hours":case"hour":case"hrs":case"hr":case"h":return m*n;case"minutes":case"minute":case"mins":case"min":case"m":return m*e;case"seconds":case"second":case"secs":case"sec":case"s":return m*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return m;default:return}}}}function l(h){return h>=r?Math.round(h/r)+"d":h>=n?Math.round(h/n)+"h":h>=e?Math.round(h/e)+"m":h>=t?Math.round(h/t)+"s":h+"ms"}function u(h){return c(h,r,"day")||c(h,n,"hour")||c(h,e,"minute")||c(h,t,"second")||h+" ms"}function c(h,d,m){if(!(h<d))return h<d*1.5?Math.floor(h/d)+" "+m:Math.ceil(h/d)+" "+m+"s"}return U1}var kx;function HP(){return kx||(kx=1,(function(t,e){e=t.exports=a.debug=a.default=a,e.coerce=c,e.disable=l,e.enable=s,e.enabled=u,e.humanize=qP(),e.names=[],e.skips=[],e.formatters={};var n;function r(h){var d=0,m;for(m in h)d=(d<<5)-d+h.charCodeAt(m),d|=0;return e.colors[Math.abs(d)%e.colors.length]}function a(h){function d(){if(d.enabled){var m=d,y=+new Date,g=y-(n||y);m.diff=g,m.prev=n,m.curr=y,n=y;for(var x=new Array(arguments.length),_=0;_<x.length;_++)x[_]=arguments[_];x[0]=e.coerce(x[0]),typeof x[0]!="string"&&x.unshift("%O");var N=0;x[0]=x[0].replace(/%([a-zA-Z%])/g,function(j,L){if(j==="%%")return j;N++;var R=e.formatters[L];if(typeof R=="function"){var I=x[N];j=R.call(m,I),x.splice(N,1),N--}return j}),e.formatArgs.call(m,x);var A=d.log||e.log||console.log.bind(console);A.apply(m,x)}}return d.namespace=h,d.enabled=e.enabled(h),d.useColors=e.useColors(),d.color=r(h),typeof e.init=="function"&&e.init(d),d}function s(h){e.save(h),e.names=[],e.skips=[];for(var d=(typeof h=="string"?h:"").split(/[\s,]+/),m=d.length,y=0;y<m;y++)d[y]&&(h=d[y].replace(/\*/g,".*?"),h[0]==="-"?e.skips.push(new RegExp("^"+h.substr(1)+"$")):e.names.push(new RegExp("^"+h+"$")))}function l(){e.enable("")}function u(h){var d,m;for(d=0,m=e.skips.length;d<m;d++)if(e.skips[d].test(h))return!1;for(d=0,m=e.names.length;d<m;d++)if(e.names[d].test(h))return!0;return!1}function c(h){return h instanceof Error?h.stack||h.message:h}})(Xp,Xp.exports)),Xp.exports}var Dx;function VP(){return Dx||(Dx=1,(function(t,e){var n={};e=t.exports=HP(),e.log=s,e.formatArgs=a,e.save=l,e.load=u,e.useColors=r,e.storage=typeof chrome<"u"&&typeof chrome.storage<"u"?chrome.storage.local:c(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"];function r(){return typeof window<"u"&&window.process&&window.process.type==="renderer"?!0:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(h){try{return JSON.stringify(h)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}};function a(h){var d=this.useColors;if(h[0]=(d?"%c":"")+this.namespace+(d?" %c":" ")+h[0]+(d?"%c ":" ")+"+"+e.humanize(this.diff),!!d){var m="color: "+this.color;h.splice(1,0,m,"color: inherit");var y=0,g=0;h[0].replace(/%[a-zA-Z%]/g,function(x){x!=="%%"&&(y++,x==="%c"&&(g=y))}),h.splice(g,0,m)}}function s(){return typeof console=="object"&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function l(h){try{h==null?e.storage.removeItem("debug"):e.storage.debug=h}catch{}}function u(){var h;try{h=e.storage.debug}catch{}return!h&&typeof process<"u"&&"env"in process&&(h=n.DEBUG),h}e.enable(u());function c(){try{return window.localStorage}catch{}}})(Jp,Jp.exports)),Jp.exports}var Zp={exports:{}},Px;function GP(){return Px||(Px=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=["cueVideoById","loadVideoById","cueVideoByUrl","loadVideoByUrl","playVideo","pauseVideo","stopVideo","getVideoLoadedFraction","cuePlaylist","loadPlaylist","nextVideo","previousVideo","playVideoAt","setShuffle","setLoop","getPlaylist","getPlaylistIndex","setOption","mute","unMute","isMuted","setVolume","getVolume","seekTo","getPlayerState","getPlaybackRate","setPlaybackRate","getAvailablePlaybackRates","getPlaybackQuality","setPlaybackQuality","getAvailableQualityLevels","getCurrentTime","getDuration","removeEventListener","getVideoUrl","getVideoEmbedCode","getOptions","getOption","addEventListener","destroy","setSize","getIframe"],t.exports=e.default})(Zp,Zp.exports)),Zp.exports}var Qp={exports:{}},Mx;function WP(){return Mx||(Mx=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=["ready","stateChange","playbackQualityChange","playbackRateChange","error","apiChange","volumeChange"],t.exports=e.default})(Qp,Qp.exports)),Qp.exports}var em={exports:{}},tm={exports:{}},Ix;function YP(){return Ix||(Ix=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default={BUFFERING:3,ENDED:0,PAUSED:2,PLAYING:1,UNSTARTED:-1,VIDEO_CUED:5},t.exports=e.default})(tm,tm.exports)),tm.exports}var Fx;function KP(){return Fx||(Fx=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=YP(),r=a(n);function a(s){return s&&s.__esModule?s:{default:s}}e.default={pauseVideo:{acceptableStates:[r.default.ENDED,r.default.PAUSED],stateChangeRequired:!1},playVideo:{acceptableStates:[r.default.ENDED,r.default.PLAYING],stateChangeRequired:!1},seekTo:{acceptableStates:[r.default.ENDED,r.default.PLAYING,r.default.PAUSED],stateChangeRequired:!0,timeout:3e3}},t.exports=e.default})(em,em.exports)),em.exports}var Ux;function JP(){return Ux||(Ux=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=VP(),r=d(n),a=GP(),s=d(a),l=WP(),u=d(l),c=KP(),h=d(c);function d(g){return g&&g.__esModule?g:{default:g}}var m=(0,r.default)("youtube-player"),y={};y.proxyEvents=function(g){var x={},_=function(G){var P="on"+G.slice(0,1).toUpperCase()+G.slice(1);x[P]=function(B){m('event "%s"',P,B),g.trigger(G,B)}},N=!0,A=!1,j=void 0;try{for(var L=u.default[Symbol.iterator](),R;!(N=(R=L.next()).done);N=!0){var I=R.value;_(I)}}catch(ee){A=!0,j=ee}finally{try{!N&&L.return&&L.return()}finally{if(A)throw j}}return x},y.promisifyPlayer=function(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,_={},N=function(P){x&&h.default[P]?_[P]=function(){for(var B=arguments.length,X=Array(B),F=0;F<B;F++)X[F]=arguments[F];return g.then(function($){var K=h.default[P],Y=$.getPlayerState(),he=$[P].apply($,X);return K.stateChangeRequired||Array.isArray(K.acceptableStates)&&K.acceptableStates.indexOf(Y)===-1?new Promise(function(te){var oe=function le(){var pe=$.getPlayerState(),Ne=void 0;typeof K.timeout=="number"&&(Ne=setTimeout(function(){$.removeEventListener("onStateChange",le),te()},K.timeout)),Array.isArray(K.acceptableStates)&&K.acceptableStates.indexOf(pe)!==-1&&($.removeEventListener("onStateChange",le),clearTimeout(Ne),te())};$.addEventListener("onStateChange",oe)}).then(function(){return he}):he})}:_[P]=function(){for(var B=arguments.length,X=Array(B),F=0;F<B;F++)X[F]=arguments[F];return g.then(function($){return $[P].apply($,X)})}},A=!0,j=!1,L=void 0;try{for(var R=s.default[Symbol.iterator](),I;!(A=(I=R.next()).done);A=!0){var ee=I.value;N(ee)}}catch(G){j=!0,L=G}finally{try{!A&&R.return&&R.return()}finally{if(j)throw L}}return _},e.default=y,t.exports=e.default})(Kp,Kp.exports)),Kp.exports}var Bx;function XP(){return Bx||(Bx=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(m){return typeof m}:function(m){return m&&typeof Symbol=="function"&&m.constructor===Symbol&&m!==Symbol.prototype?"symbol":typeof m},r=BP(),a=h(r),s=zP(),l=h(s),u=JP(),c=h(u);function h(m){return m&&m.__esModule?m:{default:m}}var d=void 0;e.default=function(m){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,x=(0,a.default)();if(d||(d=(0,l.default)(x)),y.events)throw new Error("Event handlers cannot be overwritten.");if(typeof m=="string"&&!document.getElementById(m))throw new Error('Element "'+m+'" does not exist.');y.events=c.default.proxyEvents(x);var _=new Promise(function(A){if((typeof m>"u"?"undefined":n(m))==="object"&&m.playVideo instanceof Function){var j=m;A(j)}else d.then(function(L){var R=new L.Player(m,y);return x.on("ready",function(){A(R)}),null})}),N=c.default.promisifyPlayer(_,g);return N.on=x.on,N.off=x.off,N},t.exports=e.default})(Wp,Wp.exports)),Wp.exports}var ZP=XP();const QP=yg(ZP);var eM=Object.defineProperty,tM=Object.defineProperties,nM=Object.getOwnPropertyDescriptors,$x=Object.getOwnPropertySymbols,rM=Object.prototype.hasOwnProperty,aM=Object.prototype.propertyIsEnumerable,zx=(t,e,n)=>e in t?eM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ty=(t,e)=>{for(var n in e||(e={}))rM.call(e,n)&&zx(t,n,e[n]);if($x)for(var n of $x(e))aM.call(e,n)&&zx(t,n,e[n]);return t},ny=(t,e)=>tM(t,nM(e)),iM=(t,e,n)=>new Promise((r,a)=>{var s=c=>{try{u(n.next(c))}catch(h){a(h)}},l=c=>{try{u(n.throw(c))}catch(h){a(h)}},u=c=>c.done?r(c.value):Promise.resolve(c.value).then(s,l);u((n=n.apply(t,e)).next())});function sM(t,e){var n,r;if(t.videoId!==e.videoId)return!0;const a=((n=t.opts)==null?void 0:n.playerVars)||{},s=((r=e.opts)==null?void 0:r.playerVars)||{};return a.start!==s.start||a.end!==s.end}function qx(t={}){return ny(ty({},t),{height:0,width:0,playerVars:ny(ty({},t.playerVars),{autoplay:0,start:0,end:0})})}function oM(t,e){return t.videoId!==e.videoId||!UP(qx(t.opts),qx(e.opts))}function lM(t,e){var n,r,a,s;return t.id!==e.id||t.className!==e.className||((n=t.opts)==null?void 0:n.width)!==((r=e.opts)==null?void 0:r.width)||((a=t.opts)==null?void 0:a.height)!==((s=e.opts)==null?void 0:s.height)||t.iframeClassName!==e.iframeClassName||t.title!==e.title}var uM={videoId:"",id:"",className:"",iframeClassName:"",style:{},title:"",loading:void 0,opts:{},onReady:()=>{},onError:()=>{},onPlay:()=>{},onPause:()=>{},onEnd:()=>{},onStateChange:()=>{},onPlaybackRateChange:()=>{},onPlaybackQualityChange:()=>{}},cM={videoId:Ya.string,id:Ya.string,className:Ya.string,iframeClassName:Ya.string,style:Ya.object,title:Ya.string,loading:Ya.oneOf(["lazy","eager"]),opts:Ya.objectOf(Ya.any),onReady:Ya.func,onError:Ya.func,onPlay:Ya.func,onPause:Ya.func,onEnd:Ya.func,onStateChange:Ya.func,onPlaybackRateChange:Ya.func,onPlaybackQualityChange:Ya.func},Sm=class extends vn.Component{constructor(t){super(t),this.destroyPlayerPromise=void 0,this.onPlayerReady=e=>{var n,r;return(r=(n=this.props).onReady)==null?void 0:r.call(n,e)},this.onPlayerError=e=>{var n,r;return(r=(n=this.props).onError)==null?void 0:r.call(n,e)},this.onPlayerStateChange=e=>{var n,r,a,s,l,u,c,h;switch((r=(n=this.props).onStateChange)==null||r.call(n,e),e.data){case Sm.PlayerState.ENDED:(s=(a=this.props).onEnd)==null||s.call(a,e);break;case Sm.PlayerState.PLAYING:(u=(l=this.props).onPlay)==null||u.call(l,e);break;case Sm.PlayerState.PAUSED:(h=(c=this.props).onPause)==null||h.call(c,e);break}},this.onPlayerPlaybackRateChange=e=>{var n,r;return(r=(n=this.props).onPlaybackRateChange)==null?void 0:r.call(n,e)},this.onPlayerPlaybackQualityChange=e=>{var n,r;return(r=(n=this.props).onPlaybackQualityChange)==null?void 0:r.call(n,e)},this.destroyPlayer=()=>this.internalPlayer?(this.destroyPlayerPromise=this.internalPlayer.destroy().then(()=>this.destroyPlayerPromise=void 0),this.destroyPlayerPromise):Promise.resolve(),this.createPlayer=()=>{if(typeof document>"u")return;if(this.destroyPlayerPromise){this.destroyPlayerPromise.then(this.createPlayer);return}const e=ny(ty({},this.props.opts),{videoId:this.props.videoId});this.internalPlayer=QP(this.container,e),this.internalPlayer.on("ready",this.onPlayerReady),this.internalPlayer.on("error",this.onPlayerError),this.internalPlayer.on("stateChange",this.onPlayerStateChange),this.internalPlayer.on("playbackRateChange",this.onPlayerPlaybackRateChange),this.internalPlayer.on("playbackQualityChange",this.onPlayerPlaybackQualityChange),(this.props.title||this.props.loading)&&this.internalPlayer.getIframe().then(n=>{this.props.title&&n.setAttribute("title",this.props.title),this.props.loading&&n.setAttribute("loading",this.props.loading)})},this.resetPlayer=()=>this.destroyPlayer().then(this.createPlayer),this.updatePlayer=()=>{var e;(e=this.internalPlayer)==null||e.getIframe().then(n=>{this.props.id?n.setAttribute("id",this.props.id):n.removeAttribute("id"),this.props.iframeClassName?n.setAttribute("class",this.props.iframeClassName):n.removeAttribute("class"),this.props.opts&&this.props.opts.width?n.setAttribute("width",this.props.opts.width.toString()):n.removeAttribute("width"),this.props.opts&&this.props.opts.height?n.setAttribute("height",this.props.opts.height.toString()):n.removeAttribute("height"),this.props.title?n.setAttribute("title",this.props.title):n.setAttribute("title","YouTube video player"),this.props.loading?n.setAttribute("loading",this.props.loading):n.removeAttribute("loading")})},this.getInternalPlayer=()=>this.internalPlayer,this.updateVideo=()=>{var e,n,r,a;if(typeof this.props.videoId>"u"||this.props.videoId===null){(e=this.internalPlayer)==null||e.stopVideo();return}let s=!1;const l={videoId:this.props.videoId};if((n=this.props.opts)!=null&&n.playerVars&&(s=this.props.opts.playerVars.autoplay===1,"start"in this.props.opts.playerVars&&(l.startSeconds=this.props.opts.playerVars.start),"end"in this.props.opts.playerVars&&(l.endSeconds=this.props.opts.playerVars.end)),s){(r=this.internalPlayer)==null||r.loadVideoById(l);return}(a=this.internalPlayer)==null||a.cueVideoById(l)},this.refContainer=e=>{this.container=e},this.container=null,this.internalPlayer=null}componentDidMount(){this.createPlayer()}componentDidUpdate(t){return iM(this,null,function*(){lM(t,this.props)&&this.updatePlayer(),oM(t,this.props)&&(yield this.resetPlayer()),sM(t,this.props)&&this.updateVideo()})}componentWillUnmount(){this.destroyPlayer()}render(){return vn.createElement("div",{className:this.props.className,style:this.props.style},vn.createElement("div",{id:this.props.id,className:this.props.iframeClassName,ref:this.refContainer}))}},Ig=Sm;Ig.propTypes=cM;Ig.defaultProps=uM;Ig.PlayerState={UNSTARTED:-1,ENDED:0,PLAYING:1,PAUSED:2,BUFFERING:3,CUED:5};var fM=Ig;function hM({orgNr:t,color1:e}){var j,L,R,I,ee,G,P,B;const[n,r]=D.useState(0),a=D.useRef(null),s=D.useRef(null),{org_nr:l}=ia(),{mediaItems:u,duration:c,loading:h}=RP(l||t),{darkMode:d}=Aa(),m=((j=u[n])==null?void 0:j.type)==="video",y=((L=u[n])==null?void 0:L.type)==="youtube",g=((R=u[n])==null?void 0:R.type)==="webpage";function x(X){if(!X)return null;const F=/(?:youtube\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|embed|shorts)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/,$=X.match(F);return $?$[1]:null}const _=()=>{r(X=>(X+1)%u.length)},N={height:"100%",width:"100%",playerVars:{autoplay:1,mute:1,controls:1,playlist:x((I=u[n])==null?void 0:I.path)||"",origin:window.location.origin}};D.useEffect(()=>(s.current&&clearInterval(s.current),!m&&!y&&u.length>0&&(s.current=setInterval(()=>{r(X=>(X+1)%u.length)},c)),()=>{s.current&&clearInterval(s.current)}),[n,m,y,u.length,c]),D.useEffect(()=>{if(m&&a.current){const X=a.current,F=()=>{r($=>($+1)%u.length)};return X.addEventListener("ended",F),()=>{X.removeEventListener("ended",F)}}},[n,m,u.length]);const A=X=>r(X);if(!h)return u.length===0?E.jsx("div",{className:"flex items-center justify-center h-full",children:E.jsx("div",{className:"text-2xl font-semibold",style:{color:d?"#F5C45E":e},children:"No media found"})}):E.jsxs("div",{className:"relative w-full h-full flex flex-col",children:[E.jsx("div",{className:"overflow-hidden w-full h-full flex items-center justify-center",children:g?E.jsx("iframe",{src:(ee=u[n])==null?void 0:ee.path,className:"w-full h-full object-contain",style:{border:"none"},sandbox:"allow-scripts allow-same-origin allow-forms allow-popups"}):y?E.jsx(fM,{videoId:x((G=u[n])==null?void 0:G.path)||"",opts:N,onEnd:_,className:"w-full h-full object-contain"}):m?E.jsx("video",{ref:a,src:(P=u[n])==null?void 0:P.path,autoPlay:!0,muted:!0,playsInline:!0,className:"w-full h-full object-contain"}):E.jsx("img",{src:(B=u[n])==null?void 0:B.path,alt:"carousel item",className:"w-full h-full object-contain"})}),E.jsx("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 z-50",children:u.map((X,F)=>E.jsx("button",{type:"button",onClick:()=>A(F),className:`w-3 h-3 rounded-full ${F===n?"bg-white":"bg-gray-500"} transition duration-300`,"aria-label":`Go to slide ${F+1}`,tabIndex:0},F))})]})}const W3="mosque-announcements",tg="announcements";async function Hx(t){return await(await Xr(W3,1,{upgrade(n){n.createObjectStore(tg)}})).get(tg,t)??null}async function dM(t,e){return(await Xr(W3,1,{upgrade(r){r.createObjectStore(tg)}})).put(tg,e,t)}function pM(t){const[e,n]=D.useState(null),[r,a]=D.useState(!0);return D.useEffect(()=>{let s=null;const l=async()=>{if(a(!0),!navigator.onLine){const u=await Hx(t);if(u!==null){n(u),a(!1);return}}try{const{data:u,error:c}=await ot.from("mosque_t").select("announcement").eq("organisasjonsnummer",t).single();if(c)throw c;n(u.announcement??""),await dM(t,u.announcement??"")}catch(u){const c=await Hx(t);c!==null&&n(c),console.log("error fetching announcement: ",u)}finally{a(!1)}};return l(),s=ot.channel(`announcement-changes-${t}`).on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${t}`},()=>{l()}).subscribe(),()=>{s==null||s.unsubscribe()}},[t]),{announcement:e,loading:r}}const Ky=()=>{const{org_nr:t}=ia(),{announcement:e,loading:n}=pM(t||"982842840"),r=n?"Loading...":e!=null&&e.trim()?e:"No announcements at the moment";return E.jsx("div",{className:"relative w-full overflow-hidden text-black bg-white py-0.5 lg:py-1.5 text-xl lg:text-2xl",children:E.jsx("div",{className:"ticker-text font-semibold",children:r})})},mM=({nr:t,prayerTimes:e,extraInfo:n,color:r,bg:a,isDefault:s})=>{const{darkMode:l}=Aa(),{t:u,i18n:c}=Ar(),h=c.language==="ar",[d,m]=D.useState({label:"",iqamah:!1,hours:0,minutes:0,seconds:0});if(D.useEffect(()=>{if(!e.length)return;function x(){const N=Mg(e,n),A=N.label.split(" ").map(j=>u(j.toUpperCase())).join(" ");m({...N,label:A})}x();const _=setInterval(x,1e3);return()=>clearInterval(_)},[e]),!d.label)return null;const g=`${d.label.includes("iqamah")?d.label:d.label.split(" ")[0]} ${d.iqamah?u("IQAMAH"):""} ${u("IN")}`;return E.jsxs("div",{className:"text-center font-bold text-lg sm:text-xl lg:text-2xl h-full flex justify-center items-center",style:{direction:h?"rtl":"ltr",color:l?t===1?"#F2E7D5":t===2?"#F5C35E":"#0C221F":s?t===3?"#124170":"#000000":r,backgroundColor:l?t===1?"#53452D":t===2?"#102E50":"#67C090":s?t===1?"#C7B08A":t===2?"#F5C45E":"#67C090":a},children:[E.jsxs("span",{className:"",children:[g," "]}),E.jsx("span",{className:"",children:`${String(d.hours).padStart(2,"0")}:${String(d.minutes).padStart(2,"0")}:${String(d.seconds).padStart(2,"0")}`})]})},gM=({nr:t,prayerTimes:e,extraInfo:n,prayerTimesColor:r,isDefault:a})=>E.jsxs("div",{className:"flex",children:[E.jsx("div",{className:"w-[30%]",children:E.jsx(mM,{nr:t,prayerTimes:e,extraInfo:n,color:r.text,bg:r.bg,isDefault:a})}),E.jsx(Ky,{})]}),vM={BackgroundDiv:t=>{const{prayerTimes:e,prayerTimesWithSunrise:n,extraInfo:r,asrInfo:a,date:s,isDefault:l,textColor:u,prayerTimesColor:c,extraInfoColor:h,isPreview:d,announcement:m,...y}=t;return E.jsx("div",{...y})},TablePart:CP,AnnouncementPart:gM,PrayerPart:jP,TimePart:TP,Carousel:hM};function ry({components:t,componentProps:e}){const{darkMode:n}=Aa();return E.jsx(E.Fragment,{children:t.map((r,a)=>{var l,u,c,h,d,m,y,g,x,_,N,A;const s=vM[r.type];if(s){const j={...r.props||{},...e};let L={};return n?(l=r.style)!=null&&l.darkBackgroundImage?L={backgroundImage:`url(${"https://irn-api.bonnetider.eu/storage/v1/object/public"+r.style.darkBackgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat"}:(u=r.style)!=null&&u.backgroundColor?L={backgroundColor:r.style.backgroundColor}:(c=r.style)!=null&&c.darkBackground&&(L={backgroundColor:r.style.darkBackground}):(h=r.style)!=null&&h.backgroundColor?L={backgroundColor:r.style.backgroundColor,backgroundImage:"none"}:(d=r.style)!=null&&d.backgroundImage?L={backgroundImage:`url(${"https://irn-api.bonnetider.eu/storage/v1/object/public"+r.style.backgroundImage})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",filter:(m=r.style)==null?void 0:m.backgroundBlur}:(y=r.style)!=null&&y.background&&(L={backgroundColor:r.style.background}),E.jsx("div",{className:r.className||"",style:L,children:E.jsx(s,{...j})},a)}else if(r.components&&r.gridConfig){let j={};if((g=r.gridConfig.style)!=null&&g.backgroundImage){const L=n?(x=r.gridConfig.style)==null?void 0:x.darkBackgroundImage:(_=r.gridConfig.style)==null?void 0:_.backgroundImage;j=L?{backgroundImage:`url(${L})`,backgroundSize:"cover",backgroundPosition:"center",backgroundRepeat:"no-repeat",backgroundColor:n?"#1a1a1a":"#ffffff"}:{backgroundColor:((N=r.gridConfig.style)==null?void 0:N.backgroundColor)||(n?"#1a1a1a":"#ffffff")}}else(A=r.gridConfig.style)!=null&&A.backgroundColor&&(j=r.gridConfig.style);return E.jsx("div",{className:r.gridConfig.className+" "+(r.className||""),style:j,children:E.jsx(ry,{components:r.components,componentProps:e})},a)}else return r.components?E.jsx("div",{className:r.className||"",children:E.jsx(ry,{components:r.components,componentProps:e})},a):null})})}function yM({config:t,componentProps:e={}}){var l;const[n,r]=D.useState("loading"),{error:a,showBoundary:s}=U3();return D.useEffect(()=>{const u=setTimeout(()=>{n==="loading"&&(!t||!t.components)&&s(new Error("No Lobby layout configuration Found"))},5e3);return()=>clearTimeout(u)},[t,n]),D.useEffect(()=>{t!=null&&t.components&&t.gridConfig&&r("ready")},[t]),a?null:n==="loading"?E.jsx("div",{className:"min-h-screen flex items-center justify-center p-8 bg-gradient-to-br from-indigo-50 to-purple-50",children:E.jsxs("div",{className:"text-center max-w-md",children:[E.jsx("div",{className:"w-16 h-16 border-4 border-indigo-200 border-t-indigo-600 rounded-full animate-spin mx-auto mb-4"}),E.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Loading lobby..."}),E.jsx("p",{className:"text-gray-600",children:"Setting up your space"})]})}):E.jsx("div",{className:((l=t.gridConfig)==null?void 0:l.className)||"",children:E.jsx(ry,{components:t.components,componentProps:e})})}function bM(t){const[e,n]=D.useState(null),[r,a]=D.useState(!0);return D.useEffect(()=>{let s=null;if(!t){n(null),a(!1);return}const l=async()=>{if(a(!0),!navigator.onLine){const u=await Hf(`${t}-lobby`);if(u){n(u),a(!1);return}}try{const{data:u,error:c}=await ot.from("mosque_t").select("organisasjonsnummer").eq("organisasjonsnummer",t).single();if(c||!u){Rn("error","Please enter a valid org_nr!"),n(null);return}const{data:h,error:d}=await ot.from("layout").select("lobby_theme_id, lobby_layout").eq("mosque_id",t).single();if(!d&&(h!=null&&h.lobby_layout)){n(h.lobby_layout),await fc(`${t}-lobby`,h.lobby_layout);return}const{data:m,error:y}=await ot.from("layout").select("lobby_theme_id, lobby_layout").eq("mosque_id",982842840).single();if(y||!m)throw y;const{error:g}=await ot.from("layout").upsert([{mosque_id:t,lobby_theme_id:m.lobby_theme_id,lobby_layout:m.lobby_layout}],{onConflict:"mosque_id"});if(g)throw g;n(m.lobby_layout),await fc(`${t}-lobby`,m.lobby_layout)}catch(u){const c=await Hf(`${t}-lobby`);c&&n(c),console.error("Error fetching config:",u)}finally{a(!1)}};return l(),s=ot.channel(`lobby_layout_changes: ${t}`).on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${t}`},()=>{l()}),s.subscribe(),()=>{s==null||s.unsubscribe()}},[t]),{config:e,loading:r}}function wM(){const{org_nr:t}=ia(),e=Bi(),n=new Date().toISOString().split("T")[0],{config:r}=bM(t),{isDefault:a,textColor:s,prayerTimesColor:l,extraInfoColor:u,...c}=r||{},{prayerTimes:h,extraInfo:d,asrInfo:m,loading:y}=D3(t,n),{setDarkMode:g}=Aa();D.useEffect(()=>{if(!h||h.length===0)return;const j=()=>{const R=z3(h);R==="dark"?g(!0):R==="light"&&g(!1)};j();const L=setInterval(j,60*1e3);return()=>clearInterval(L)},[h,g]);const{language:x}=Tu();D.useEffect(()=>{x&&Ir.changeLanguage(x)},[x]);const _=D.useRef(null),[N,A]=D.useState(!1);return D.useEffect(()=>{const j=()=>{A(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",j),()=>document.removeEventListener("fullscreenchange",j)},[]),y?E.jsx("div",{className:"h-screen",children:E.jsx(qf,{})}):h?E.jsxs("div",{ref:_,className:"relative",children:[!N&&E.jsxs(E.Fragment,{children:[E.jsx("button",{onClick:()=>e(`/${t||"982842840"}`),className:"absolute top-4 right-26 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:s||"#4F46E5"},children:E.jsx(H3,{size:24,className:"cursor-pointer"})}),E.jsx("button",{onClick:()=>e(`/${t}/masjid`),className:"absolute top-4 right-13 z-50 px-3 py-1 text-sm text-white font-semibold rounded-lg shadow-md hover:opacity-90 hover:cursor-pointer transition",style:{backgroundColor:s||"#4F46E5"},children:E.jsx(q3,{size:24,className:"cursor-pointer"})})]}),E.jsx($3,{targetRef:_}),E.jsx(yM,{config:c,componentProps:{date:n,prayerTimes:h,extraInfo:d,asrInfo:m,textColor:s,prayerTimesColor:l,extraInfoColor:u,isDefault:a,isPreview:!1}})]}):E.jsx("div",{children:"Prayer times not found."})}function xM(t){return Na({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M261.56 101.28a8 8 0 0 0-11.06 0L66.4 277.15a8 8 0 0 0-2.47 5.79L63.9 448a32 32 0 0 0 32 32H192a16 16 0 0 0 16-16V328a8 8 0 0 1 8-8h80a8 8 0 0 1 8 8v136a16 16 0 0 0 16 16h96.06a32 32 0 0 0 32-32V282.94a8 8 0 0 0-2.47-5.79z"},child:[]},{tag:"path",attr:{d:"m490.91 244.15-74.8-71.56V64a16 16 0 0 0-16-16h-48a16 16 0 0 0-16 16v32l-57.92-55.38C272.77 35.14 264.71 32 256 32c-8.68 0-16.72 3.14-22.14 8.63l-212.7 203.5c-6.22 6-7 15.87-1.34 22.37A16 16 0 0 0 43 267.56L250.5 69.28a8 8 0 0 1 11.06 0l207.52 198.28a16 16 0 0 0 22.59-.44c6.14-6.36 5.63-16.86-.76-22.97z"},child:[]}]})(t)}function SM(t){return Na({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M215.7 499.2C267 435 384 279.4 384 192C384 86 298 0 192 0S0 86 0 192c0 87.4 117 243 168.3 307.2c12.3 15.3 35.1 15.3 47.4 0zM192 128a64 64 0 1 1 0 128 64 64 0 1 1 0-128z"},child:[]}]})(t)}const Y3="prayer-times-db",kf="prayerTimes";async function Vx(t,e){await(await Xr(Y3,1,{upgrade(r){r.objectStoreNames.contains(kf)||r.createObjectStore(kf)}})).put(kf,e,t)}async function Gx(t){return(await Xr(Y3,1,{upgrade(n){n.objectStoreNames.contains(kf)||n.createObjectStore(kf)}})).get(kf,t)}function _M(t,e,n,r){return t?`mosque_${t}_${n}`:`location_${e}_${n}_${r}`}function EM({locationId:t,org_nr:e,date:n,asrMethod:r,prayerMethod:a,methodsLoaded:s}){const l={one_x:"",two_x:"",fifty_percent:""},[u,c]=D.useState([]),[h,d]=D.useState([]),[m,y]=D.useState(l),[g,x]=D.useState(!1),[_]=D.useState(navigator.onLine);return D.useEffect(()=>{if(!s)return;let A=null,j=null;const L=n.toISOString().split("T")[0],R=_M(e,t,L,r),I=async()=>{const ee=await Gx(R),G=ee&&ee.prayerTimes&&ee.prayerTimes.length>0;if(G||x(!1),G&&(c(ee.prayerTimes),d(ee.extraInfo),x(!0)),!_){G||x(!0);return}try{if(e){const{prayerTimes:P,extraInfo:B,asrInfo:X}=await k3(e,L,r,a);c(P||[]),d(B||[]),y(X||l),(P==null?void 0:P.length)>0&&await Vx(R,{prayerTimes:P,extraInfo:B||[],asrInfo:X})}else{const{prayerTimes:P,asrInfo:B}=await eP(t,L,r,a);c(P||[]),y(B||l),(P==null?void 0:P.length)>0&&await Vx(R,{prayerTimes:P,extraInfo:[],asrInfo:B})}}catch(P){console.error("Failed to fetch prayer times:",P);const B=[{name:"Fajr",adhan:"",iqamah:"",tomorrow:""},{name:"Fajr end",adhan:"",iqamah:"",tomorrow:""},{name:"Dhuhr",adhan:"",iqamah:"",tomorrow:""},{name:"Asr",adhan:"",iqamah:"",tomorrow:""},{name:"Maghrib",adhan:"",iqamah:"",tomorrow:""},{name:"Isha",adhan:"",iqamah:"",tomorrow:""}],X=[{label:"Jumuah",arabic:"جمعة",time:["",""]}],F=await Gx(R);F?(c(F.prayerTimes),d(F.extraInfo),y(F.asrInfo)):(c(B),d(X),y(l))}x(!0)};return I(),e&&_&&(A=ot.channel("prayer_times_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_jamatperiode",filter:`mosque_id=eq.${e}`},I).subscribe(),j=ot.channel("mosque_t_changes").on("postgres_changes",{event:"*",schema:"public",table:"mosque_t",filter:`organisasjonsnummer=eq.${e}`},I).subscribe()),()=>{A&&ot.removeChannel(A),j&&ot.removeChannel(j)}},[t,e,n,r,a,s,_]),{prayerTimes:Tg(u),prayerTimesWithSunrise:u,extraInfo:h,asrInfo:m,ready:g,isOnline:_}}const AM=async()=>{try{const{data:t,error:e}=await ot.from("location_t").select("location_name, location_iso");if(e){console.error("Error fetching locations: ",e),await aa(e,{message:"Error fetching locations",function:"fetchAllLocations"}),Rn("error","Error fetching locations");return}if(!t||t.length===0){console.error("No data fetched"),Rn("error","No data fetched");return}const n=new Intl.Collator("nb-NO");return t.map(({location_name:a,location_iso:s})=>({name:a,id:s})).sort((a,s)=>n.compare(a.name,s.name))}catch(t){console.error("Error fetching locations: ",t),await aa(t,{message:"Error fetching locations",function:"fetchAllLocations"}),Rn("error","Error fetching locations");return}},NM=async t=>{var e;try{const{data:n,error:r}=await ot.from("mosque_t").select(`
|
|
946
|
+
reg_postnummer,
|
|
947
|
+
post_no,
|
|
948
|
+
lat,
|
|
949
|
+
lon,
|
|
950
|
+
location_iso,
|
|
951
|
+
location_postnumber (
|
|
952
|
+
location_iso
|
|
953
|
+
)
|
|
954
|
+
`).eq("organisasjonsnummer",t).maybeSingle();if(r)throw r;if(!n)return;let a=null,s=null;const l=n,u=l.location_iso||((e=l.location_postnumber)==null?void 0:e.location_iso);if(u){const{data:c,error:h}=await ot.from("location_t").select("lat_n_s, long_e_w").eq("location_iso",u).maybeSingle();if(h)throw h;a=(c==null?void 0:c.lat_n_s)??null,s=(c==null?void 0:c.long_e_w)??null}return{location_iso:u,lat:n.lat??a,lon:n.lon??s}}catch(n){console.error(`Error fetching location for mosque ${t}: `,n),await aa(n,{message:`Error fetching location for mosque ${t}`,function:"fetchLocationOfMosque"}),Rn("error","Error fetching location of selected mosque!");return}},CM=async t=>{try{const{data:e,error:n}=await ot.from("location_t").select("lat_n_s, long_e_w").eq("location_iso",t).single();if(n||!e)throw n||new Error("No locTation data found");return{lat:e.lat_n_s,lon:e.long_e_w}}catch(e){console.error(`Error fetching coordinates of location ${t}: `,e),await aa(e,{message:`Error fetching coordinates for location ${t}`,function:"fetchCoordsOfLocation"}),Rn("error","Error fetching coordinates for selected location");return}};function TM(t){const[e,n]=D.useState([]),[r,a]=D.useState(!0);return D.useEffect(()=>{n([]),a(!0),(async()=>{try{const s=await G7(t);n(s)}catch(s){console.error("Error fetching special dates: ",s),await aa(s,{message:"Error fetching special dates",function:"useEvents"}),Rn("error","Failed to load special dates"),n([])}finally{a(!1)}})()},[t]),{events:e,loading:r}}const LM="layoutDB",ng="colorSchemeStore",jM=1;async function K3(){return Xr(LM,jM,{upgrade(t){t.objectStoreNames.contains(ng)||t.createObjectStore(ng)}})}async function OM(t,e){await(await K3()).put(ng,e,t)}async function Wx(t){return await(await K3()).get(ng,t)}function RM(t="982842840",e){const[n,r]=D.useState({isDefault:!0,bgImage:"",bgOpacity:1,bgRepeat:"",bgColor:"",textColor:"",prayerTimesColor:{bg:"",text:""}}),[a,s]=D.useState(!0);return D.useEffect(()=>{if(!t&&!e)return;const l=t||e||"982842840",u=async()=>{var h,d,m,y,g,x;try{if(!navigator.onLine){const I=await Wx(l);if(I){r(I),s(!1);return}}const{data:_,error:N}=await ot.from("layout").select("ud_layout").eq("mosque_id",l).single();if(N)throw N;const A=_.ud_layout,j=(h=A==null?void 0:A.components)==null?void 0:h.find(I=>I.type==="BackgroundDiv"),L=(d=A==null?void 0:A.components)==null?void 0:d.find(I=>I.type==="Main"),R={isDefault:(A==null?void 0:A.isDefault)??!0,bgImage:((m=j==null?void 0:j.style)==null?void 0:m.backgroundImage)??"",bgOpacity:((y=j==null?void 0:j.style)==null?void 0:y.backgroundOpacity)??1,bgRepeat:((g=j==null?void 0:j.style)==null?void 0:g.backgroundRepeat)??"",bgColor:((x=L==null?void 0:L.style)==null?void 0:x.backgroundColor)??"",textColor:(A==null?void 0:A.textColor)??"",prayerTimesColor:(A==null?void 0:A.prayerTimesColor)??{}};r(R),await OM(l,R)}catch(_){console.error("Error fetching color scheme:",_);const N=await Wx(l);r(N||{isDefault:!0,bgImage:"",bgOpacity:1,bgRepeat:"",bgColor:"",textColor:"",prayerTimesColor:{bg:"",text:""}})}finally{s(!1)}};u();const c=ot.channel(`color_scheme_changes_${l}`).on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${l}`},()=>{console.log("Realtime update detected for color scheme"),u()}).subscribe();return()=>{ot.removeChannel(c)}},[t,e]),{colorScheme:n,loading:a}}const J3=D.createContext(null),vi=()=>{const t=D.useContext(J3);if(!t)throw console.error("useUDContext: no provider found",new Error().stack),new Error("useUDContext must be used within a <UDProvider>");return t},kM=({children:t,org_nr:e,loc_id:n})=>{const[r,a]=D.useState(""),[s,l]=D.useState({value:"",label:""}),u=new Date,[c,h]=D.useState(u),[d,m]=D.useState(null),[y,g]=D.useState(null),[x,_]=D.useState(null),[N,A]=D.useState(0),[j,L]=D.useState(1),[R,I]=D.useState(!1),[ee,G]=D.useState("Monthly"),[P,B]=D.useState(new Date(u.getFullYear(),u.getMonth(),1)),[X,F]=D.useState(new Date(u.getFullYear(),u.getMonth()+1,0)),[$,K]=D.useState(null),[Y,he]=D.useState(null),[te,oe]=D.useState([]),{language:le}=v3(e||(s==null?void 0:s.value)),pe="ud_language";D.useEffect(()=>{const De=localStorage.getItem(pe);De&&_(De)},[]),D.useEffect(()=>{le&&_(le)},[le]),D.useEffect(()=>{x&&(Ir.changeLanguage(x),localStorage.setItem(pe,x))},[x]);const{masjidLogo:Ne}=Pd(e||(s==null?void 0:s.value)||"982842840"),U=Ir.language||"en",{events:O,loading:V}=TM(U),{colorScheme:Z}=RM(e,s==null?void 0:s.value);D.useEffect(()=>{(async()=>{const qe=await L3();oe(qe)})()},[]),D.useEffect(()=>{if(n)a(n),(async()=>{const qe=await CM(n);qe&&(K(qe.lat),he(qe.lon))})();else if(e){const De=async()=>{const Pe=await NM(e);Pe&&(a(Pe.location_iso),K(Pe.lat),he(Pe.lon))},qe=async()=>{const Pe=await V7(e);Pe&&l(Pe)};De(),qe()}},[n,e]),D.useEffect(()=>{(async()=>{I(!1);const qe=await Hy(e||(s==null?void 0:s.value),n||r);qe&&(A(qe.asr_method),L(qe.prayer_method)),I(!0)})()},[e,s==null?void 0:s.value,n,r]);const{prayerTimes:ie,prayerTimesWithSunrise:z,extraInfo:se,asrInfo:ge,ready:xe}=EM(n?{org_nr:e||(s==null?void 0:s.value)||null,locationId:n,date:c,asrMethod:N,prayerMethod:j,methodsLoaded:R}:{org_nr:e||(s==null?void 0:s.value)||"982842840",locationId:r||"NO0301",date:c,asrMethod:N,prayerMethod:j,methodsLoaded:R}),Re=vn.useMemo(()=>({locationId:r,setLocationId:a,selectedMosque:s,setSelectedMosque:l,date:c,setDate:h,hijriDay:d,setHijriDay:m,nextHijriDay:y,setNextHijriDay:g,asrMethod:N,setAsrMethod:A,prayerMethod:j,setPrayerMethod:L,language:x,setLanguage:_,org_nr:(s==null?void 0:s.value)||e||null,prayerTimes:ie,prayerTimesWithSunrise:z,extraInfo:se,asrInfo:ge,prayerTimesReady:xe,periodType:ee,setPeriodType:G,periodFrom:P,periodTo:X,setPeriodFrom:B,setPeriodTo:F,events:O,eventsLoading:V,colorScheme:Z,mosqueLogo:Ne,lat:$,lon:Y,hijriMonthNames:te}),[r,s,c,d,y,N,j,x,e,ie,z,se,ge,xe,ee,P,X,O,V,Z,Ne,$,Y,te]);return E.jsx(J3.Provider,{value:Re,children:t})};function In(t){"@babel/helpers - typeof";return In=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},In(t)}function DM(t,e){if(In(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e);if(In(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function X3(t){var e=DM(t,"string");return In(e)=="symbol"?e:e+""}function Xh(t,e,n){return(e=X3(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Yx(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,r)}return n}function zt(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Yx(Object(n),!0).forEach(function(r){Xh(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Yx(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function PM(t){if(Array.isArray(t))return t}function MM(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,a,s,l,u=[],c=!0,h=!1;try{if(s=(n=n.call(t)).next,e===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=s.call(n)).done)&&(u.push(r.value),u.length!==e);c=!0);}catch(d){h=!0,a=d}finally{try{if(!c&&n.return!=null&&(l=n.return(),Object(l)!==l))return}finally{if(h)throw a}}return u}}function ay(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function Z3(t,e){if(t){if(typeof t=="string")return ay(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ay(t,e):void 0}}function IM(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
955
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qs(t,e){return PM(t)||MM(t,e)||Z3(t,e)||IM()}function FM(t,e){if(t==null)return{};var n={};for(var r in t)if({}.hasOwnProperty.call(t,r)){if(e.indexOf(r)!==-1)continue;n[r]=t[r]}return n}function Fl(t,e){if(t==null)return{};var n,r,a=FM(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(r=0;r<s.length;r++)n=s[r],e.indexOf(n)===-1&&{}.propertyIsEnumerable.call(t,n)&&(a[n]=t[n])}return a}var UM=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function BM(t){var e=t.defaultInputValue,n=e===void 0?"":e,r=t.defaultMenuIsOpen,a=r===void 0?!1:r,s=t.defaultValue,l=s===void 0?null:s,u=t.inputValue,c=t.menuIsOpen,h=t.onChange,d=t.onInputChange,m=t.onMenuClose,y=t.onMenuOpen,g=t.value,x=Fl(t,UM),_=D.useState(u!==void 0?u:n),N=Qs(_,2),A=N[0],j=N[1],L=D.useState(c!==void 0?c:a),R=Qs(L,2),I=R[0],ee=R[1],G=D.useState(g!==void 0?g:l),P=Qs(G,2),B=P[0],X=P[1],F=D.useCallback(function(le,pe){typeof h=="function"&&h(le,pe),X(le)},[h]),$=D.useCallback(function(le,pe){var Ne;typeof d=="function"&&(Ne=d(le,pe)),j(Ne!==void 0?Ne:le)},[d]),K=D.useCallback(function(){typeof y=="function"&&y(),ee(!0)},[y]),Y=D.useCallback(function(){typeof m=="function"&&m(),ee(!1)},[m]),he=u!==void 0?u:A,te=c!==void 0?c:I,oe=g!==void 0?g:B;return zt(zt({},x),{},{inputValue:he,menuIsOpen:te,onChange:F,onInputChange:$,onMenuClose:Y,onMenuOpen:K,value:oe})}function Gt(){return Gt=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Gt.apply(null,arguments)}function $M(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Kx(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,X3(r.key),r)}}function zM(t,e,n){return e&&Kx(t.prototype,e),n&&Kx(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function iy(t,e){return iy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},iy(t,e)}function qM(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&iy(t,e)}function rg(t){return rg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},rg(t)}function Q3(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Q3=function(){return!!t})()}function HM(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function VM(t,e){if(e&&(In(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return HM(t)}function GM(t){var e=Q3();return function(){var n,r=rg(t);if(e){var a=rg(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return VM(this,n)}}function WM(t){if(Array.isArray(t))return ay(t)}function YM(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function KM(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
956
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jy(t){return WM(t)||YM(t)||Z3(t)||KM()}function JM(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function XM(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var ZM=(function(){function t(n){var r=this;this._insertTag=function(a){var s;r.tags.length===0?r.insertionPoint?s=r.insertionPoint.nextSibling:r.prepend?s=r.container.firstChild:s=r.before:s=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(a,s),r.tags.push(a)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(XM(this));var a=this.tags[this.tags.length-1];if(this.isSpeedy){var s=JM(a);try{s.insertRule(r,s.cssRules.length)}catch{}}else a.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var a;return(a=r.parentNode)==null?void 0:a.removeChild(r)}),this.tags=[],this.ctr=0},t})(),oi="-ms-",ag="-moz-",Yn="-webkit-",eE="comm",Xy="rule",Zy="decl",QM="@import",tE="@keyframes",e9="@layer",t9=Math.abs,Fg=String.fromCharCode,n9=Object.assign;function r9(t,e){return Ja(t,0)^45?(((e<<2^Ja(t,0))<<2^Ja(t,1))<<2^Ja(t,2))<<2^Ja(t,3):0}function nE(t){return t.trim()}function a9(t,e){return(t=e.exec(t))?t[0]:t}function Kn(t,e,n){return t.replace(e,n)}function sy(t,e){return t.indexOf(e)}function Ja(t,e){return t.charCodeAt(e)|0}function bd(t,e,n){return t.slice(e,n)}function Po(t){return t.length}function Qy(t){return t.length}function nm(t,e){return e.push(t),t}function i9(t,e){return t.map(e).join("")}var Ug=1,Vf=1,rE=0,Ui=0,pa=0,Yf="";function Bg(t,e,n,r,a,s,l){return{value:t,root:e,parent:n,type:r,props:a,children:s,line:Ug,column:Vf,length:l,return:""}}function zh(t,e){return n9(Bg("",null,null,"",null,null,0),t,{length:-t.length},e)}function s9(){return pa}function o9(){return pa=Ui>0?Ja(Yf,--Ui):0,Vf--,pa===10&&(Vf=1,Ug--),pa}function ss(){return pa=Ui<rE?Ja(Yf,Ui++):0,Vf++,pa===10&&(Vf=1,Ug++),pa}function Uo(){return Ja(Yf,Ui)}function _m(){return Ui}function Fd(t,e){return bd(Yf,t,e)}function wd(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function aE(t){return Ug=Vf=1,rE=Po(Yf=t),Ui=0,[]}function iE(t){return Yf="",t}function Em(t){return nE(Fd(Ui-1,oy(t===91?t+2:t===40?t+1:t)))}function l9(t){for(;(pa=Uo())&&pa<33;)ss();return wd(t)>2||wd(pa)>3?"":" "}function u9(t,e){for(;--e&&ss()&&!(pa<48||pa>102||pa>57&&pa<65||pa>70&&pa<97););return Fd(t,_m()+(e<6&&Uo()==32&&ss()==32))}function oy(t){for(;ss();)switch(pa){case t:return Ui;case 34:case 39:t!==34&&t!==39&&oy(pa);break;case 40:t===41&&oy(t);break;case 92:ss();break}return Ui}function c9(t,e){for(;ss()&&t+pa!==57;)if(t+pa===84&&Uo()===47)break;return"/*"+Fd(e,Ui-1)+"*"+Fg(t===47?t:ss())}function f9(t){for(;!wd(Uo());)ss();return Fd(t,Ui)}function h9(t){return iE(Am("",null,null,null,[""],t=aE(t),0,[0],t))}function Am(t,e,n,r,a,s,l,u,c){for(var h=0,d=0,m=l,y=0,g=0,x=0,_=1,N=1,A=1,j=0,L="",R=a,I=s,ee=r,G=L;N;)switch(x=j,j=ss()){case 40:if(x!=108&&Ja(G,m-1)==58){sy(G+=Kn(Em(j),"&","&\f"),"&\f")!=-1&&(A=-1);break}case 34:case 39:case 91:G+=Em(j);break;case 9:case 10:case 13:case 32:G+=l9(x);break;case 92:G+=u9(_m()-1,7);continue;case 47:switch(Uo()){case 42:case 47:nm(d9(c9(ss(),_m()),e,n),c);break;default:G+="/"}break;case 123*_:u[h++]=Po(G)*A;case 125*_:case 59:case 0:switch(j){case 0:case 125:N=0;case 59+d:A==-1&&(G=Kn(G,/\f/g,"")),g>0&&Po(G)-m&&nm(g>32?Xx(G+";",r,n,m-1):Xx(Kn(G," ","")+";",r,n,m-2),c);break;case 59:G+=";";default:if(nm(ee=Jx(G,e,n,h,d,a,u,L,R=[],I=[],m),s),j===123)if(d===0)Am(G,e,ee,ee,R,s,m,u,I);else switch(y===99&&Ja(G,3)===110?100:y){case 100:case 108:case 109:case 115:Am(t,ee,ee,r&&nm(Jx(t,ee,ee,0,0,a,u,L,a,R=[],m),I),a,I,m,u,r?R:I);break;default:Am(G,ee,ee,ee,[""],I,0,u,I)}}h=d=g=0,_=A=1,L=G="",m=l;break;case 58:m=1+Po(G),g=x;default:if(_<1){if(j==123)--_;else if(j==125&&_++==0&&o9()==125)continue}switch(G+=Fg(j),j*_){case 38:A=d>0?1:(G+="\f",-1);break;case 44:u[h++]=(Po(G)-1)*A,A=1;break;case 64:Uo()===45&&(G+=Em(ss())),y=Uo(),d=m=Po(L=G+=f9(_m())),j++;break;case 45:x===45&&Po(G)==2&&(_=0)}}return s}function Jx(t,e,n,r,a,s,l,u,c,h,d){for(var m=a-1,y=a===0?s:[""],g=Qy(y),x=0,_=0,N=0;x<r;++x)for(var A=0,j=bd(t,m+1,m=t9(_=l[x])),L=t;A<g;++A)(L=nE(_>0?y[A]+" "+j:Kn(j,/&\f/g,y[A])))&&(c[N++]=L);return Bg(t,e,n,a===0?Xy:u,c,h,d)}function d9(t,e,n){return Bg(t,e,n,eE,Fg(s9()),bd(t,2,-2),0)}function Xx(t,e,n,r){return Bg(t,e,n,Zy,bd(t,0,r),bd(t,r+1,-1),r)}function Df(t,e){for(var n="",r=Qy(t),a=0;a<r;a++)n+=e(t[a],a,t,e)||"";return n}function p9(t,e,n,r){switch(t.type){case e9:if(t.children.length)break;case QM:case Zy:return t.return=t.return||t.value;case eE:return"";case tE:return t.return=t.value+"{"+Df(t.children,r)+"}";case Xy:t.value=t.props.join(",")}return Po(n=Df(t.children,r))?t.return=t.value+"{"+n+"}":""}function m9(t){var e=Qy(t);return function(n,r,a,s){for(var l="",u=0;u<e;u++)l+=t[u](n,r,a,s)||"";return l}}function g9(t){return function(e){e.root||(e=e.return)&&t(e)}}function v9(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var y9=function(e,n,r){for(var a=0,s=0;a=s,s=Uo(),a===38&&s===12&&(n[r]=1),!wd(s);)ss();return Fd(e,Ui)},b9=function(e,n){var r=-1,a=44;do switch(wd(a)){case 0:a===38&&Uo()===12&&(n[r]=1),e[r]+=y9(Ui-1,n,r);break;case 2:e[r]+=Em(a);break;case 4:if(a===44){e[++r]=Uo()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=Fg(a)}while(a=ss());return e},w9=function(e,n){return iE(b9(aE(e),n))},Zx=new WeakMap,x9=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,a=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!Zx.get(r))&&!a){Zx.set(e,!0);for(var s=[],l=w9(n,s),u=r.props,c=0,h=0;c<l.length;c++)for(var d=0;d<u.length;d++,h++)e.props[h]=s[c]?l[c].replace(/&\f/g,u[d]):u[d]+" "+l[c]}}},S9=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function sE(t,e){switch(r9(t,e)){case 5103:return Yn+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Yn+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Yn+t+ag+t+oi+t+t;case 6828:case 4268:return Yn+t+oi+t+t;case 6165:return Yn+t+oi+"flex-"+t+t;case 5187:return Yn+t+Kn(t,/(\w+).+(:[^]+)/,Yn+"box-$1$2"+oi+"flex-$1$2")+t;case 5443:return Yn+t+oi+"flex-item-"+Kn(t,/flex-|-self/,"")+t;case 4675:return Yn+t+oi+"flex-line-pack"+Kn(t,/align-content|flex-|-self/,"")+t;case 5548:return Yn+t+oi+Kn(t,"shrink","negative")+t;case 5292:return Yn+t+oi+Kn(t,"basis","preferred-size")+t;case 6060:return Yn+"box-"+Kn(t,"-grow","")+Yn+t+oi+Kn(t,"grow","positive")+t;case 4554:return Yn+Kn(t,/([^-])(transform)/g,"$1"+Yn+"$2")+t;case 6187:return Kn(Kn(Kn(t,/(zoom-|grab)/,Yn+"$1"),/(image-set)/,Yn+"$1"),t,"")+t;case 5495:case 3959:return Kn(t,/(image-set\([^]*)/,Yn+"$1$`$1");case 4968:return Kn(Kn(t,/(.+:)(flex-)?(.*)/,Yn+"box-pack:$3"+oi+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Yn+t+t;case 4095:case 3583:case 4068:case 2532:return Kn(t,/(.+)-inline(.+)/,Yn+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Po(t)-1-e>6)switch(Ja(t,e+1)){case 109:if(Ja(t,e+4)!==45)break;case 102:return Kn(t,/(.+:)(.+)-([^]+)/,"$1"+Yn+"$2-$3$1"+ag+(Ja(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~sy(t,"stretch")?sE(Kn(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Ja(t,e+1)!==115)break;case 6444:switch(Ja(t,Po(t)-3-(~sy(t,"!important")&&10))){case 107:return Kn(t,":",":"+Yn)+t;case 101:return Kn(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Yn+(Ja(t,14)===45?"inline-":"")+"box$3$1"+Yn+"$2$3$1"+oi+"$2box$3")+t}break;case 5936:switch(Ja(t,e+11)){case 114:return Yn+t+oi+Kn(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Yn+t+oi+Kn(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Yn+t+oi+Kn(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Yn+t+oi+t+t}return t}var _9=function(e,n,r,a){if(e.length>-1&&!e.return)switch(e.type){case Zy:e.return=sE(e.value,e.length);break;case tE:return Df([zh(e,{value:Kn(e.value,"@","@"+Yn)})],a);case Xy:if(e.length)return i9(e.props,function(s){switch(a9(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Df([zh(e,{props:[Kn(s,/:(read-\w+)/,":"+ag+"$1")]})],a);case"::placeholder":return Df([zh(e,{props:[Kn(s,/:(plac\w+)/,":"+Yn+"input-$1")]}),zh(e,{props:[Kn(s,/:(plac\w+)/,":"+ag+"$1")]}),zh(e,{props:[Kn(s,/:(plac\w+)/,oi+"input-$1")]})],a)}return""})}},E9=[_9],A9=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(_){var N=_.getAttribute("data-emotion");N.indexOf(" ")!==-1&&(document.head.appendChild(_),_.setAttribute("data-s",""))})}var a=e.stylisPlugins||E9,s={},l,u=[];l=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(_){for(var N=_.getAttribute("data-emotion").split(" "),A=1;A<N.length;A++)s[N[A]]=!0;u.push(_)});var c,h=[x9,S9];{var d,m=[p9,g9(function(_){d.insert(_)})],y=m9(h.concat(a,m)),g=function(N){return Df(h9(N),y)};c=function(N,A,j,L){d=j,g(N?N+"{"+A.styles+"}":A.styles),L&&(x.inserted[A.name]=!0)}}var x={key:n,sheet:new ZM({key:n,container:l,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:c};return x.sheet.hydrate(u),x},B1={exports:{}},Zn={};/** @license React v16.13.1
|
|
957
|
+
* react-is.production.min.js
|
|
958
|
+
*
|
|
959
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
960
|
+
*
|
|
961
|
+
* This source code is licensed under the MIT license found in the
|
|
962
|
+
* LICENSE file in the root directory of this source tree.
|
|
963
|
+
*/var Qx;function N9(){if(Qx)return Zn;Qx=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,a=t?Symbol.for("react.strict_mode"):60108,s=t?Symbol.for("react.profiler"):60114,l=t?Symbol.for("react.provider"):60109,u=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,h=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,m=t?Symbol.for("react.suspense"):60113,y=t?Symbol.for("react.suspense_list"):60120,g=t?Symbol.for("react.memo"):60115,x=t?Symbol.for("react.lazy"):60116,_=t?Symbol.for("react.block"):60121,N=t?Symbol.for("react.fundamental"):60117,A=t?Symbol.for("react.responder"):60118,j=t?Symbol.for("react.scope"):60119;function L(I){if(typeof I=="object"&&I!==null){var ee=I.$$typeof;switch(ee){case e:switch(I=I.type,I){case c:case h:case r:case s:case a:case m:return I;default:switch(I=I&&I.$$typeof,I){case u:case d:case x:case g:case l:return I;default:return ee}}case n:return ee}}}function R(I){return L(I)===h}return Zn.AsyncMode=c,Zn.ConcurrentMode=h,Zn.ContextConsumer=u,Zn.ContextProvider=l,Zn.Element=e,Zn.ForwardRef=d,Zn.Fragment=r,Zn.Lazy=x,Zn.Memo=g,Zn.Portal=n,Zn.Profiler=s,Zn.StrictMode=a,Zn.Suspense=m,Zn.isAsyncMode=function(I){return R(I)||L(I)===c},Zn.isConcurrentMode=R,Zn.isContextConsumer=function(I){return L(I)===u},Zn.isContextProvider=function(I){return L(I)===l},Zn.isElement=function(I){return typeof I=="object"&&I!==null&&I.$$typeof===e},Zn.isForwardRef=function(I){return L(I)===d},Zn.isFragment=function(I){return L(I)===r},Zn.isLazy=function(I){return L(I)===x},Zn.isMemo=function(I){return L(I)===g},Zn.isPortal=function(I){return L(I)===n},Zn.isProfiler=function(I){return L(I)===s},Zn.isStrictMode=function(I){return L(I)===a},Zn.isSuspense=function(I){return L(I)===m},Zn.isValidElementType=function(I){return typeof I=="string"||typeof I=="function"||I===r||I===h||I===s||I===a||I===m||I===y||typeof I=="object"&&I!==null&&(I.$$typeof===x||I.$$typeof===g||I.$$typeof===l||I.$$typeof===u||I.$$typeof===d||I.$$typeof===N||I.$$typeof===A||I.$$typeof===j||I.$$typeof===_)},Zn.typeOf=L,Zn}var eS;function C9(){return eS||(eS=1,B1.exports=N9()),B1.exports}var $1,tS;function T9(){if(tS)return $1;tS=1;var t=C9(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};s[t.ForwardRef]=r,s[t.Memo]=a;function l(x){return t.isMemo(x)?a:s[x.$$typeof]||e}var u=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,m=Object.getPrototypeOf,y=Object.prototype;function g(x,_,N){if(typeof _!="string"){if(y){var A=m(_);A&&A!==y&&g(x,A,N)}var j=c(_);h&&(j=j.concat(h(_)));for(var L=l(x),R=l(_),I=0;I<j.length;++I){var ee=j[I];if(!n[ee]&&!(N&&N[ee])&&!(R&&R[ee])&&!(L&&L[ee])){var G=d(_,ee);try{u(x,ee,G)}catch{}}}}return x}return $1=g,$1}T9();var L9=!0;function j9(t,e,n){var r="";return n.split(" ").forEach(function(a){t[a]!==void 0?e.push(t[a]+";"):a&&(r+=a+" ")}),r}var oE=function(e,n,r){var a=e.key+"-"+n.name;(r===!1||L9===!1)&&e.registered[a]===void 0&&(e.registered[a]=n.styles)},O9=function(e,n,r){oE(e,n,r);var a=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var s=n;do e.insert(n===s?"."+a:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function R9(t){for(var e=0,n,r=0,a=t.length;a>=4;++r,a-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(a){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var k9={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},D9=/[A-Z]|^ms/g,P9=/_EMO_([^_]+?)_([^]*?)_EMO_/g,lE=function(e){return e.charCodeAt(1)===45},nS=function(e){return e!=null&&typeof e!="boolean"},z1=v9(function(t){return lE(t)?t:t.replace(D9,"-$&").toLowerCase()}),rS=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(P9,function(r,a,s){return Mo={name:a,styles:s,next:Mo},a})}return k9[e]!==1&&!lE(e)&&typeof n=="number"&&n!==0?n+"px":n};function xd(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var a=n;if(a.anim===1)return Mo={name:a.name,styles:a.styles,next:Mo},a.name;var s=n;if(s.styles!==void 0){var l=s.next;if(l!==void 0)for(;l!==void 0;)Mo={name:l.name,styles:l.styles,next:Mo},l=l.next;var u=s.styles+";";return u}return M9(t,e,n)}case"function":{if(t!==void 0){var c=Mo,h=n(t);return Mo=c,xd(t,e,h)}break}}var d=n;return d}function M9(t,e,n){var r="";if(Array.isArray(n))for(var a=0;a<n.length;a++)r+=xd(t,e,n[a])+";";else for(var s in n){var l=n[s];if(typeof l!="object"){var u=l;nS(u)&&(r+=z1(s)+":"+rS(s,u)+";")}else if(Array.isArray(l)&&typeof l[0]=="string"&&e==null)for(var c=0;c<l.length;c++)nS(l[c])&&(r+=z1(s)+":"+rS(s,l[c])+";");else{var h=xd(t,e,l);switch(s){case"animation":case"animationName":{r+=z1(s)+":"+h+";";break}default:r+=s+"{"+h+"}"}}}return r}var aS=/label:\s*([^\s;{]+)\s*(;|$)/g,Mo;function uE(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,a="";Mo=void 0;var s=t[0];if(s==null||s.raw===void 0)r=!1,a+=xd(n,e,s);else{var l=s;a+=l[0]}for(var u=1;u<t.length;u++)if(a+=xd(n,e,t[u]),r){var c=s;a+=c[u]}aS.lastIndex=0;for(var h="",d;(d=aS.exec(a))!==null;)h+="-"+d[1];var m=R9(a)+h;return{name:m,styles:a,next:Mo}}var I9=function(e){return e()},F9=Sv.useInsertionEffect?Sv.useInsertionEffect:!1,U9=F9||I9,cE=D.createContext(typeof HTMLElement<"u"?A9({key:"css"}):null);cE.Provider;var B9=function(e){return D.forwardRef(function(n,r){var a=D.useContext(cE);return e(n,a,r)})},$9=D.createContext({}),e2={}.hasOwnProperty,ly="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",z9=function(e,n){var r={};for(var a in n)e2.call(n,a)&&(r[a]=n[a]);return r[ly]=e,r},q9=function(e){var n=e.cache,r=e.serialized,a=e.isStringTag;return oE(n,r,a),U9(function(){return O9(n,r,a)}),null},H9=B9(function(t,e,n){var r=t.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var a=t[ly],s=[r],l="";typeof t.className=="string"?l=j9(e.registered,s,t.className):t.className!=null&&(l=t.className+" ");var u=uE(s,void 0,D.useContext($9));l+=e.key+"-"+u.name;var c={};for(var h in t)e2.call(t,h)&&h!=="css"&&h!==ly&&(c[h]=t[h]);return c.className=l,n&&(c.ref=n),D.createElement(D.Fragment,null,D.createElement(q9,{cache:e,serialized:u,isStringTag:typeof a=="string"}),D.createElement(a,c))}),V9=H9,It=function(e,n){var r=arguments;if(n==null||!e2.call(n,"css"))return D.createElement.apply(void 0,r);var a=r.length,s=new Array(a);s[0]=V9,s[1]=z9(e,n);for(var l=2;l<a;l++)s[l]=r[l];return D.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(It||(It={}));function t2(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return uE(e)}function G9(){var t=t2.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function W9(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}const Y9=Math.min,K9=Math.max,ig=Math.round,rm=Math.floor,sg=t=>({x:t,y:t});function J9(t){const{x:e,y:n,width:r,height:a}=t;return{width:r,height:a,top:n,left:e,right:e+r,bottom:n+a,x:e,y:n}}function $g(){return typeof window<"u"}function fE(t){return dE(t)?(t.nodeName||"").toLowerCase():"#document"}function Ml(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function hE(t){var e;return(e=(dE(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function dE(t){return $g()?t instanceof Node||t instanceof Ml(t).Node:!1}function X9(t){return $g()?t instanceof Element||t instanceof Ml(t).Element:!1}function n2(t){return $g()?t instanceof HTMLElement||t instanceof Ml(t).HTMLElement:!1}function iS(t){return!$g()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Ml(t).ShadowRoot}function pE(t){const{overflow:e,overflowX:n,overflowY:r,display:a}=r2(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&a!=="inline"&&a!=="contents"}let q1;function Z9(){return q1==null&&(q1=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),q1}function Q9(t){return/^(html|body|#document)$/.test(fE(t))}function r2(t){return Ml(t).getComputedStyle(t)}function eI(t){if(fE(t)==="html")return t;const e=t.assignedSlot||t.parentNode||iS(t)&&t.host||hE(t);return iS(e)?e.host:e}function mE(t){const e=eI(t);return Q9(e)?t.ownerDocument?t.ownerDocument.body:t.body:n2(e)&&pE(e)?e:mE(e)}function og(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const a=mE(t),s=a===((r=t.ownerDocument)==null?void 0:r.body),l=Ml(a);if(s){const u=uy(l);return e.concat(l,l.visualViewport||[],pE(a)?a:[],u&&n?og(u):[])}else return e.concat(a,og(a,[],n))}function uy(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function tI(t){const e=r2(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const a=n2(t),s=a?t.offsetWidth:n,l=a?t.offsetHeight:r,u=ig(n)!==s||ig(r)!==l;return u&&(n=s,r=l),{width:n,height:r,$:u}}function a2(t){return X9(t)?t:t.contextElement}function sS(t){const e=a2(t);if(!n2(e))return sg(1);const n=e.getBoundingClientRect(),{width:r,height:a,$:s}=tI(e);let l=(s?ig(n.width):n.width)/r,u=(s?ig(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const nI=sg(0);function rI(t){const e=Ml(t);return!Z9()||!e.visualViewport?nI:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function aI(t,e,n){return!1}function oS(t,e,n,r){e===void 0&&(e=!1);const a=t.getBoundingClientRect(),s=a2(t);let l=sg(1);e&&(l=sS(t));const u=aI()?rI(s):sg(0);let c=(a.left+u.x)/l.x,h=(a.top+u.y)/l.y,d=a.width/l.x,m=a.height/l.y;if(s){const y=Ml(s),g=r;let x=y,_=uy(x);for(;_&&r&&g!==x;){const N=sS(_),A=_.getBoundingClientRect(),j=r2(_),L=A.left+(_.clientLeft+parseFloat(j.paddingLeft))*N.x,R=A.top+(_.clientTop+parseFloat(j.paddingTop))*N.y;c*=N.x,h*=N.y,d*=N.x,m*=N.y,c+=L,h+=R,x=Ml(_),_=uy(x)}}return J9({width:d,height:m,x:c,y:h})}function gE(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function iI(t,e){let n=null,r;const a=hE(t);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),s();const h=t.getBoundingClientRect(),{left:d,top:m,width:y,height:g}=h;if(u||e(),!y||!g)return;const x=rm(m),_=rm(a.clientWidth-(d+y)),N=rm(a.clientHeight-(m+g)),A=rm(d),L={rootMargin:-x+"px "+-_+"px "+-N+"px "+-A+"px",threshold:K9(0,Y9(1,c))||1};let R=!0;function I(ee){const G=ee[0].intersectionRatio;if(G!==c){if(!R)return l();G?l(!1,G):r=setTimeout(()=>{l(!1,1e-7)},1e3)}G===1&&!gE(h,t.getBoundingClientRect())&&l(),R=!1}try{n=new IntersectionObserver(I,{...L,root:a.ownerDocument})}catch{n=new IntersectionObserver(I,L)}n.observe(t)}return l(!0),s}function sI(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,h=a2(t),d=a||s?[...h?og(h):[],...e?og(e):[]]:[];d.forEach(A=>{a&&A.addEventListener("scroll",n,{passive:!0}),s&&A.addEventListener("resize",n)});const m=h&&u?iI(h,n):null;let y=-1,g=null;l&&(g=new ResizeObserver(A=>{let[j]=A;j&&j.target===h&&g&&e&&(g.unobserve(e),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var L;(L=g)==null||L.observe(e)})),n()}),h&&!c&&g.observe(h),e&&g.observe(e));let x,_=c?oS(t):null;c&&N();function N(){const A=oS(t);_&&!gE(_,A)&&n(),_=A,x=requestAnimationFrame(N)}return n(),()=>{var A;d.forEach(j=>{a&&j.removeEventListener("scroll",n),s&&j.removeEventListener("resize",n)}),m==null||m(),(A=g)==null||A.disconnect(),g=null,c&&cancelAnimationFrame(x)}}var cy=D.useLayoutEffect,oI=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],lg=function(){};function lI(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function uI(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),a=2;a<n;a++)r[a-2]=arguments[a];var s=[].concat(r);if(e&&t)for(var l in e)e.hasOwnProperty(l)&&e[l]&&s.push("".concat(lI(t,l)));return s.filter(function(u){return u}).map(function(u){return String(u).trim()}).join(" ")}var lS=function(e){return yI(e)?e.filter(Boolean):In(e)==="object"&&e!==null?[e]:[]},vE=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var n=Fl(e,oI);return zt({},n)},Jr=function(e,n,r){var a=e.cx,s=e.getStyles,l=e.getClassNames,u=e.className;return{css:s(n,e),className:a(r??{},l(n,e),u)}};function zg(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function cI(t){return zg(t)?window.innerHeight:t.clientHeight}function yE(t){return zg(t)?window.pageYOffset:t.scrollTop}function ug(t,e){if(zg(t)){window.scrollTo(0,e);return}t.scrollTop=e}function fI(t){var e=getComputedStyle(t),n=e.position==="absolute",r=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var a=t;a=a.parentElement;)if(e=getComputedStyle(a),!(n&&e.position==="static")&&r.test(e.overflow+e.overflowY+e.overflowX))return a;return document.documentElement}function hI(t,e,n,r){return n*((t=t/r-1)*t*t+1)+e}function am(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:lg,a=yE(t),s=e-a,l=10,u=0;function c(){u+=l;var h=hI(u,a,s,n);ug(t,h),u<n?window.requestAnimationFrame(c):r(t)}c()}function uS(t,e){var n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),a=e.offsetHeight/3;r.bottom+a>n.bottom?ug(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+a,t.scrollHeight)):r.top-a<n.top&&ug(t,Math.max(e.offsetTop-a,0))}function dI(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function cS(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function pI(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var bE=!1,mI={get passive(){return bE=!0}},im=typeof window<"u"?window:{};im.addEventListener&&im.removeEventListener&&(im.addEventListener("p",lg,mI),im.removeEventListener("p",lg,!1));var gI=bE;function vI(t){return t!=null}function yI(t){return Array.isArray(t)}function sm(t,e,n){return t?e:n}var bI=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];var s=Object.entries(e).filter(function(l){var u=Qs(l,1),c=u[0];return!r.includes(c)});return s.reduce(function(l,u){var c=Qs(u,2),h=c[0],d=c[1];return l[h]=d,l},{})},wI=["children","innerProps"],xI=["children","innerProps"];function SI(t){var e=t.maxHeight,n=t.menuEl,r=t.minHeight,a=t.placement,s=t.shouldScroll,l=t.isFixedPosition,u=t.controlHeight,c=fI(n),h={placement:"bottom",maxHeight:e};if(!n||!n.offsetParent)return h;var d=c.getBoundingClientRect(),m=d.height,y=n.getBoundingClientRect(),g=y.bottom,x=y.height,_=y.top,N=n.offsetParent.getBoundingClientRect(),A=N.top,j=l?window.innerHeight:cI(c),L=yE(c),R=parseInt(getComputedStyle(n).marginBottom,10),I=parseInt(getComputedStyle(n).marginTop,10),ee=A-I,G=j-_,P=ee+L,B=m-L-_,X=g-j+L+R,F=L+_-I,$=160;switch(a){case"auto":case"bottom":if(G>=x)return{placement:"bottom",maxHeight:e};if(B>=x&&!l)return s&&am(c,X,$),{placement:"bottom",maxHeight:e};if(!l&&B>=r||l&&G>=r){s&&am(c,X,$);var K=l?G-R:B-R;return{placement:"bottom",maxHeight:K}}if(a==="auto"||l){var Y=e,he=l?ee:P;return he>=r&&(Y=Math.min(he-R-u,e)),{placement:"top",maxHeight:Y}}if(a==="bottom")return s&&ug(c,X),{placement:"bottom",maxHeight:e};break;case"top":if(ee>=x)return{placement:"top",maxHeight:e};if(P>=x&&!l)return s&&am(c,F,$),{placement:"top",maxHeight:e};if(!l&&P>=r||l&&ee>=r){var te=e;return(!l&&P>=r||l&&ee>=r)&&(te=l?ee-I:P-I),s&&am(c,F,$),{placement:"top",maxHeight:te}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(a,'".'))}return h}function _I(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var wE=function(e){return e==="auto"?"bottom":e},EI=function(e,n){var r,a=e.placement,s=e.theme,l=s.borderRadius,u=s.spacing,c=s.colors;return zt((r={label:"menu"},Xh(r,_I(a),"100%"),Xh(r,"position","absolute"),Xh(r,"width","100%"),Xh(r,"zIndex",1),r),n?{}:{backgroundColor:c.neutral0,borderRadius:l,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:u.menuGutter,marginTop:u.menuGutter})},xE=D.createContext(null),AI=function(e){var n=e.children,r=e.minMenuHeight,a=e.maxMenuHeight,s=e.menuPlacement,l=e.menuPosition,u=e.menuShouldScrollIntoView,c=e.theme,h=D.useContext(xE)||{},d=h.setPortalPlacement,m=D.useRef(null),y=D.useState(a),g=Qs(y,2),x=g[0],_=g[1],N=D.useState(null),A=Qs(N,2),j=A[0],L=A[1],R=c.spacing.controlHeight;return cy(function(){var I=m.current;if(I){var ee=l==="fixed",G=u&&!ee,P=SI({maxHeight:a,menuEl:I,minHeight:r,placement:s,shouldScroll:G,isFixedPosition:ee,controlHeight:R});_(P.maxHeight),L(P.placement),d==null||d(P.placement)}},[a,s,l,u,r,d,R]),n({ref:m,placerProps:zt(zt({},e),{},{placement:j||wE(s),maxHeight:x})})},NI=function(e){var n=e.children,r=e.innerRef,a=e.innerProps;return It("div",Gt({},Jr(e,"menu",{menu:!0}),{ref:r},a),n)},CI=NI,TI=function(e,n){var r=e.maxHeight,a=e.theme.spacing.baseUnit;return zt({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:a,paddingTop:a})},LI=function(e){var n=e.children,r=e.innerProps,a=e.innerRef,s=e.isMulti;return It("div",Gt({},Jr(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:a},r),n)},SE=function(e,n){var r=e.theme,a=r.spacing.baseUnit,s=r.colors;return zt({textAlign:"center"},n?{}:{color:s.neutral40,padding:"".concat(a*2,"px ").concat(a*3,"px")})},jI=SE,OI=SE,RI=function(e){var n=e.children,r=n===void 0?"No options":n,a=e.innerProps,s=Fl(e,wI);return It("div",Gt({},Jr(zt(zt({},s),{},{children:r,innerProps:a}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),a),r)},kI=function(e){var n=e.children,r=n===void 0?"Loading...":n,a=e.innerProps,s=Fl(e,xI);return It("div",Gt({},Jr(zt(zt({},s),{},{children:r,innerProps:a}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),a),r)},DI=function(e){var n=e.rect,r=e.offset,a=e.position;return{left:n.left,position:a,top:r,width:n.width,zIndex:1}},PI=function(e){var n=e.appendTo,r=e.children,a=e.controlElement,s=e.innerProps,l=e.menuPlacement,u=e.menuPosition,c=D.useRef(null),h=D.useRef(null),d=D.useState(wE(l)),m=Qs(d,2),y=m[0],g=m[1],x=D.useMemo(function(){return{setPortalPlacement:g}},[]),_=D.useState(null),N=Qs(_,2),A=N[0],j=N[1],L=D.useCallback(function(){if(a){var G=dI(a),P=u==="fixed"?0:window.pageYOffset,B=G[y]+P;(B!==(A==null?void 0:A.offset)||G.left!==(A==null?void 0:A.rect.left)||G.width!==(A==null?void 0:A.rect.width))&&j({offset:B,rect:G})}},[a,u,y,A==null?void 0:A.offset,A==null?void 0:A.rect.left,A==null?void 0:A.rect.width]);cy(function(){L()},[L]);var R=D.useCallback(function(){typeof h.current=="function"&&(h.current(),h.current=null),a&&c.current&&(h.current=sI(a,c.current,L,{elementResize:"ResizeObserver"in window}))},[a,L]);cy(function(){R()},[R]);var I=D.useCallback(function(G){c.current=G,R()},[R]);if(!n&&u!=="fixed"||!A)return null;var ee=It("div",Gt({ref:I},Jr(zt(zt({},e),{},{offset:A.offset,position:u,rect:A.rect}),"menuPortal",{"menu-portal":!0}),s),r);return It(xE.Provider,{value:x},n?D4.createPortal(ee,n):ee)},MI=function(e){var n=e.isDisabled,r=e.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},II=function(e){var n=e.children,r=e.innerProps,a=e.isDisabled,s=e.isRtl;return It("div",Gt({},Jr(e,"container",{"--is-disabled":a,"--is-rtl":s}),r),n)},FI=function(e,n){var r=e.theme.spacing,a=e.isMulti,s=e.hasValue,l=e.selectProps.controlShouldRenderValue;return zt({alignItems:"center",display:a&&s&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},UI=function(e){var n=e.children,r=e.innerProps,a=e.isMulti,s=e.hasValue;return It("div",Gt({},Jr(e,"valueContainer",{"value-container":!0,"value-container--is-multi":a,"value-container--has-value":s}),r),n)},BI=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},$I=function(e){var n=e.children,r=e.innerProps;return It("div",Gt({},Jr(e,"indicatorsContainer",{indicators:!0}),r),n)},fS,zI=["size"],qI=["innerProps","isRtl","size"],HI={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},_E=function(e){var n=e.size,r=Fl(e,zI);return It("svg",Gt({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:HI},r))},i2=function(e){return It(_E,Gt({size:20},e),It("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},EE=function(e){return It(_E,Gt({size:20},e),It("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},AE=function(e,n){var r=e.isFocused,a=e.theme,s=a.spacing.baseUnit,l=a.colors;return zt({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?l.neutral60:l.neutral20,padding:s*2,":hover":{color:r?l.neutral80:l.neutral40}})},VI=AE,GI=function(e){var n=e.children,r=e.innerProps;return It("div",Gt({},Jr(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||It(EE,null))},WI=AE,YI=function(e){var n=e.children,r=e.innerProps;return It("div",Gt({},Jr(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||It(i2,null))},KI=function(e,n){var r=e.isDisabled,a=e.theme,s=a.spacing.baseUnit,l=a.colors;return zt({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?l.neutral10:l.neutral20,marginBottom:s*2,marginTop:s*2})},JI=function(e){var n=e.innerProps;return It("span",Gt({},n,Jr(e,"indicatorSeparator",{"indicator-separator":!0})))},XI=G9(fS||(fS=W9([`
|
|
964
|
+
0%, 80%, 100% { opacity: 0; }
|
|
965
|
+
40% { opacity: 1; }
|
|
966
|
+
`]))),ZI=function(e,n){var r=e.isFocused,a=e.size,s=e.theme,l=s.colors,u=s.spacing.baseUnit;return zt({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:a,lineHeight:1,marginRight:a,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?l.neutral60:l.neutral20,padding:u*2})},H1=function(e){var n=e.delay,r=e.offset;return It("span",{css:t2({animation:"".concat(XI," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},QI=function(e){var n=e.innerProps,r=e.isRtl,a=e.size,s=a===void 0?4:a,l=Fl(e,qI);return It("div",Gt({},Jr(zt(zt({},l),{},{innerProps:n,isRtl:r,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),It(H1,{delay:0,offset:r}),It(H1,{delay:160,offset:!0}),It(H1,{delay:320,offset:!r}))},eF=function(e,n){var r=e.isDisabled,a=e.isFocused,s=e.theme,l=s.colors,u=s.borderRadius,c=s.spacing;return zt({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?l.neutral5:l.neutral0,borderColor:r?l.neutral10:a?l.primary:l.neutral20,borderRadius:u,borderStyle:"solid",borderWidth:1,boxShadow:a?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:a?l.primary:l.neutral30}})},tF=function(e){var n=e.children,r=e.isDisabled,a=e.isFocused,s=e.innerRef,l=e.innerProps,u=e.menuIsOpen;return It("div",Gt({ref:s},Jr(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":a,"control--menu-is-open":u}),l,{"aria-disabled":r||void 0}),n)},nF=tF,rF=["data"],aF=function(e,n){var r=e.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},iF=function(e){var n=e.children,r=e.cx,a=e.getStyles,s=e.getClassNames,l=e.Heading,u=e.headingProps,c=e.innerProps,h=e.label,d=e.theme,m=e.selectProps;return It("div",Gt({},Jr(e,"group",{group:!0}),c),It(l,Gt({},u,{selectProps:m,theme:d,getStyles:a,getClassNames:s,cx:r}),h),It("div",null,n))},sF=function(e,n){var r=e.theme,a=r.colors,s=r.spacing;return zt({label:"group",cursor:"default",display:"block"},n?{}:{color:a.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},oF=function(e){var n=vE(e);n.data;var r=Fl(n,rF);return It("div",Gt({},Jr(e,"groupHeading",{"group-heading":!0}),r))},lF=iF,uF=["innerRef","isDisabled","isHidden","inputClassName"],cF=function(e,n){var r=e.isDisabled,a=e.value,s=e.theme,l=s.spacing,u=s.colors;return zt(zt({visibility:r?"hidden":"visible",transform:a?"translateZ(0)":""},fF),n?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:u.neutral80})},NE={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},fF={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":zt({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},NE)},hF=function(e){return zt({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},NE)},dF=function(e){var n=e.cx,r=e.value,a=vE(e),s=a.innerRef,l=a.isDisabled,u=a.isHidden,c=a.inputClassName,h=Fl(a,uF);return It("div",Gt({},Jr(e,"input",{"input-container":!0}),{"data-value":r||""}),It("input",Gt({className:n({input:!0},c),ref:s,style:hF(u),disabled:l},h)))},pF=dF,mF=function(e,n){var r=e.theme,a=r.spacing,s=r.borderRadius,l=r.colors;return zt({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:l.neutral10,borderRadius:s/2,margin:a.baseUnit/2})},gF=function(e,n){var r=e.theme,a=r.borderRadius,s=r.colors,l=e.cropWithEllipsis;return zt({overflow:"hidden",textOverflow:l||l===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:a/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},vF=function(e,n){var r=e.theme,a=r.spacing,s=r.borderRadius,l=r.colors,u=e.isFocused;return zt({alignItems:"center",display:"flex"},n?{}:{borderRadius:s/2,backgroundColor:u?l.dangerLight:void 0,paddingLeft:a.baseUnit,paddingRight:a.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},CE=function(e){var n=e.children,r=e.innerProps;return It("div",r,n)},yF=CE,bF=CE;function wF(t){var e=t.children,n=t.innerProps;return It("div",Gt({role:"button"},n),e||It(i2,{size:14}))}var xF=function(e){var n=e.children,r=e.components,a=e.data,s=e.innerProps,l=e.isDisabled,u=e.removeProps,c=e.selectProps,h=r.Container,d=r.Label,m=r.Remove;return It(h,{data:a,innerProps:zt(zt({},Jr(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),s),selectProps:c},It(d,{data:a,innerProps:zt({},Jr(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),It(m,{data:a,innerProps:zt(zt({},Jr(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},u),selectProps:c}))},SF=xF,_F=function(e,n){var r=e.isDisabled,a=e.isFocused,s=e.isSelected,l=e.theme,u=l.spacing,c=l.colors;return zt({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:s?c.primary:a?c.primary25:"transparent",color:r?c.neutral20:s?c.neutral0:"inherit",padding:"".concat(u.baseUnit*2,"px ").concat(u.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:s?c.primary:c.primary50}})},EF=function(e){var n=e.children,r=e.isDisabled,a=e.isFocused,s=e.isSelected,l=e.innerRef,u=e.innerProps;return It("div",Gt({},Jr(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":a,"option--is-selected":s}),{ref:l,"aria-disabled":r},u),n)},AF=EF,NF=function(e,n){var r=e.theme,a=r.spacing,s=r.colors;return zt({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:s.neutral50,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},CF=function(e){var n=e.children,r=e.innerProps;return It("div",Gt({},Jr(e,"placeholder",{placeholder:!0}),r),n)},TF=CF,LF=function(e,n){var r=e.isDisabled,a=e.theme,s=a.spacing,l=a.colors;return zt({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?l.neutral40:l.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},jF=function(e){var n=e.children,r=e.isDisabled,a=e.innerProps;return It("div",Gt({},Jr(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),a),n)},OF=jF,TE={ClearIndicator:YI,Control:nF,DropdownIndicator:GI,DownChevron:EE,CrossIcon:i2,Group:lF,GroupHeading:oF,IndicatorsContainer:$I,IndicatorSeparator:JI,Input:pF,LoadingIndicator:QI,Menu:CI,MenuList:LI,MenuPortal:PI,LoadingMessage:kI,NoOptionsMessage:RI,MultiValue:SF,MultiValueContainer:yF,MultiValueLabel:bF,MultiValueRemove:wF,Option:AF,Placeholder:TF,SelectContainer:II,SingleValue:OF,ValueContainer:UI},RF=function(e){return zt(zt({},TE),e.components)},hS=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function kF(t,e){return!!(t===e||hS(t)&&hS(e))}function DF(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!kF(t[n],e[n]))return!1;return!0}function PF(t,e){e===void 0&&(e=DF);var n=null;function r(){for(var a=[],s=0;s<arguments.length;s++)a[s]=arguments[s];if(n&&n.lastThis===this&&e(a,n.lastArgs))return n.lastResult;var l=t.apply(this,a);return n={lastResult:l,lastArgs:a,lastThis:this},l}return r.clear=function(){n=null},r}var MF={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},IF=function(e){return It("span",Gt({css:MF},e))},dS=IF,FF={guidance:function(e){var n=e.isSearchable,r=e.isMulti,a=e.tabSelectsValue,s=e.context,l=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(a?", press Tab to select the option and exit the menu":"",".");case"input":return l?"".concat(e["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var n=e.action,r=e.label,a=r===void 0?"":r,s=e.labels,l=e.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(a,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return l?"option ".concat(a," is disabled. Select another option."):"option ".concat(a,", selected.");default:return""}},onFocus:function(e){var n=e.context,r=e.focused,a=e.options,s=e.label,l=s===void 0?"":s,u=e.selectValue,c=e.isDisabled,h=e.isSelected,d=e.isAppleDevice,m=function(_,N){return _&&_.length?"".concat(_.indexOf(N)+1," of ").concat(_.length):""};if(n==="value"&&u)return"value ".concat(l," focused, ").concat(m(u,r),".");if(n==="menu"&&d){var y=c?" disabled":"",g="".concat(h?" selected":"").concat(y);return"".concat(l).concat(g,", ").concat(m(a,r),".")}return""},onFilter:function(e){var n=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},UF=function(e){var n=e.ariaSelection,r=e.focusedOption,a=e.focusedValue,s=e.focusableOptions,l=e.isFocused,u=e.selectValue,c=e.selectProps,h=e.id,d=e.isAppleDevice,m=c.ariaLiveMessages,y=c.getOptionLabel,g=c.inputValue,x=c.isMulti,_=c.isOptionDisabled,N=c.isSearchable,A=c.menuIsOpen,j=c.options,L=c.screenReaderStatus,R=c.tabSelectsValue,I=c.isLoading,ee=c["aria-label"],G=c["aria-live"],P=D.useMemo(function(){return zt(zt({},FF),m||{})},[m]),B=D.useMemo(function(){var he="";if(n&&P.onChange){var te=n.option,oe=n.options,le=n.removedValue,pe=n.removedValues,Ne=n.value,U=function(ge){return Array.isArray(ge)?null:ge},O=le||te||U(Ne),V=O?y(O):"",Z=oe||pe||void 0,ie=Z?Z.map(y):[],z=zt({isDisabled:O&&_(O,u),label:V,labels:ie},n);he=P.onChange(z)}return he},[n,P,_,u,y]),X=D.useMemo(function(){var he="",te=r||a,oe=!!(r&&u&&u.includes(r));if(te&&P.onFocus){var le={focused:te,label:y(te),isDisabled:_(te,u),isSelected:oe,options:s,context:te===r?"menu":"value",selectValue:u,isAppleDevice:d};he=P.onFocus(le)}return he},[r,a,y,_,P,s,u,d]),F=D.useMemo(function(){var he="";if(A&&j.length&&!I&&P.onFilter){var te=L({count:s.length});he=P.onFilter({inputValue:g,resultsMessage:te})}return he},[s,g,A,P,j,L,I]),$=(n==null?void 0:n.action)==="initial-input-focus",K=D.useMemo(function(){var he="";if(P.guidance){var te=a?"value":A?"menu":"input";he=P.guidance({"aria-label":ee,context:te,isDisabled:r&&_(r,u),isMulti:x,isSearchable:N,tabSelectsValue:R,isInitialFocus:$})}return he},[ee,r,a,x,_,N,A,P,u,R,$]),Y=It(D.Fragment,null,It("span",{id:"aria-selection"},B),It("span",{id:"aria-focused"},X),It("span",{id:"aria-results"},F),It("span",{id:"aria-guidance"},K));return It(D.Fragment,null,It(dS,{id:h},$&&Y),It(dS,{"aria-live":G,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},l&&!$&&Y))},BF=UF,fy=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],$F=new RegExp("["+fy.map(function(t){return t.letters}).join("")+"]","g"),LE={};for(var V1=0;V1<fy.length;V1++)for(var G1=fy[V1],W1=0;W1<G1.letters.length;W1++)LE[G1.letters[W1]]=G1.base;var jE=function(e){return e.replace($F,function(n){return LE[n]})},zF=PF(jE),pS=function(e){return e.replace(/^\s+|\s+$/g,"")},qF=function(e){return"".concat(e.label," ").concat(e.value)},HF=function(e){return function(n,r){if(n.data.__isNew__)return!0;var a=zt({ignoreCase:!0,ignoreAccents:!0,stringify:qF,trim:!0,matchFrom:"any"},e),s=a.ignoreCase,l=a.ignoreAccents,u=a.stringify,c=a.trim,h=a.matchFrom,d=c?pS(r):r,m=c?pS(u(n)):u(n);return s&&(d=d.toLowerCase(),m=m.toLowerCase()),l&&(d=zF(d),m=jE(m)),h==="start"?m.substr(0,d.length)===d:m.indexOf(d)>-1}},VF=["innerRef"];function GF(t){var e=t.innerRef,n=Fl(t,VF),r=bI(n,"onExited","in","enter","exit","appear");return It("input",Gt({ref:e},r,{css:t2({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var WF=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function YF(t){var e=t.isEnabled,n=t.onBottomArrive,r=t.onBottomLeave,a=t.onTopArrive,s=t.onTopLeave,l=D.useRef(!1),u=D.useRef(!1),c=D.useRef(0),h=D.useRef(null),d=D.useCallback(function(N,A){if(h.current!==null){var j=h.current,L=j.scrollTop,R=j.scrollHeight,I=j.clientHeight,ee=h.current,G=A>0,P=R-I-L,B=!1;P>A&&l.current&&(r&&r(N),l.current=!1),G&&u.current&&(s&&s(N),u.current=!1),G&&A>P?(n&&!l.current&&n(N),ee.scrollTop=R,B=!0,l.current=!0):!G&&-A>L&&(a&&!u.current&&a(N),ee.scrollTop=0,B=!0,u.current=!0),B&&WF(N)}},[n,r,a,s]),m=D.useCallback(function(N){d(N,N.deltaY)},[d]),y=D.useCallback(function(N){c.current=N.changedTouches[0].clientY},[]),g=D.useCallback(function(N){var A=c.current-N.changedTouches[0].clientY;d(N,A)},[d]),x=D.useCallback(function(N){if(N){var A=gI?{passive:!1}:!1;N.addEventListener("wheel",m,A),N.addEventListener("touchstart",y,A),N.addEventListener("touchmove",g,A)}},[g,y,m]),_=D.useCallback(function(N){N&&(N.removeEventListener("wheel",m,!1),N.removeEventListener("touchstart",y,!1),N.removeEventListener("touchmove",g,!1))},[g,y,m]);return D.useEffect(function(){if(e){var N=h.current;return x(N),function(){_(N)}}},[e,x,_]),function(N){h.current=N}}var mS=["boxSizing","height","overflow","paddingRight","position"],gS={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function vS(t){t.cancelable&&t.preventDefault()}function yS(t){t.stopPropagation()}function bS(){var t=this.scrollTop,e=this.scrollHeight,n=t+this.offsetHeight;t===0?this.scrollTop=1:n===e&&(this.scrollTop=t-1)}function wS(){return"ontouchstart"in window||navigator.maxTouchPoints}var xS=!!(typeof window<"u"&&window.document&&window.document.createElement),qh=0,df={capture:!1,passive:!1};function KF(t){var e=t.isEnabled,n=t.accountForScrollbars,r=n===void 0?!0:n,a=D.useRef({}),s=D.useRef(null),l=D.useCallback(function(c){if(xS){var h=document.body,d=h&&h.style;if(r&&mS.forEach(function(x){var _=d&&d[x];a.current[x]=_}),r&&qh<1){var m=parseInt(a.current.paddingRight,10)||0,y=document.body?document.body.clientWidth:0,g=window.innerWidth-y+m||0;Object.keys(gS).forEach(function(x){var _=gS[x];d&&(d[x]=_)}),d&&(d.paddingRight="".concat(g,"px"))}h&&wS()&&(h.addEventListener("touchmove",vS,df),c&&(c.addEventListener("touchstart",bS,df),c.addEventListener("touchmove",yS,df))),qh+=1}},[r]),u=D.useCallback(function(c){if(xS){var h=document.body,d=h&&h.style;qh=Math.max(qh-1,0),r&&qh<1&&mS.forEach(function(m){var y=a.current[m];d&&(d[m]=y)}),h&&wS()&&(h.removeEventListener("touchmove",vS,df),c&&(c.removeEventListener("touchstart",bS,df),c.removeEventListener("touchmove",yS,df)))}},[r]);return D.useEffect(function(){if(e){var c=s.current;return l(c),function(){u(c)}}},[e,l,u]),function(c){s.current=c}}var JF=function(e){var n=e.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},XF={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function ZF(t){var e=t.children,n=t.lockEnabled,r=t.captureEnabled,a=r===void 0?!0:r,s=t.onBottomArrive,l=t.onBottomLeave,u=t.onTopArrive,c=t.onTopLeave,h=YF({isEnabled:a,onBottomArrive:s,onBottomLeave:l,onTopArrive:u,onTopLeave:c}),d=KF({isEnabled:n}),m=function(g){h(g),d(g)};return It(D.Fragment,null,n&&It("div",{onClick:JF,css:XF}),e(m))}var QF={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},eU=function(e){var n=e.name,r=e.onFocus;return It("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:QF,value:"",onChange:function(){}})},tU=eU;function s2(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function nU(){return s2(/^iPhone/i)}function OE(){return s2(/^Mac/i)}function rU(){return s2(/^iPad/i)||OE()&&navigator.maxTouchPoints>1}function aU(){return nU()||rU()}function iU(){return OE()||aU()}var sU=function(e){return e.label},oU=function(e){return e.label},lU=function(e){return e.value},uU=function(e){return!!e.isDisabled},cU={clearIndicator:WI,container:MI,control:eF,dropdownIndicator:VI,group:aF,groupHeading:sF,indicatorsContainer:BI,indicatorSeparator:KI,input:cF,loadingIndicator:ZI,loadingMessage:OI,menu:EI,menuList:TI,menuPortal:DI,multiValue:mF,multiValueLabel:gF,multiValueRemove:vF,noOptionsMessage:jI,option:_F,placeholder:NF,singleValue:LF,valueContainer:FI},fU={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},hU=4,RE=4,dU=38,pU=RE*2,mU={baseUnit:RE,controlHeight:dU,menuGutter:pU},Y1={borderRadius:hU,colors:fU,spacing:mU},gU={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:cS(),captureMenuScroll:!cS(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:HF(),formatGroupLabel:sU,getOptionLabel:oU,getOptionValue:lU,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:uU,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!pI(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var n=e.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function SS(t,e,n,r){var a=PE(t,e,n),s=ME(t,e,n),l=DE(t,e),u=cg(t,e);return{type:"option",data:e,isDisabled:a,isSelected:s,label:l,value:u,index:r}}function Nm(t,e){return t.options.map(function(n,r){if("options"in n){var a=n.options.map(function(l,u){return SS(t,l,e,u)}).filter(function(l){return ES(t,l)});return a.length>0?{type:"group",data:n,options:a,index:r}:void 0}var s=SS(t,n,e,r);return ES(t,s)?s:void 0}).filter(vI)}function kE(t){return t.reduce(function(e,n){return n.type==="group"?e.push.apply(e,Jy(n.options.map(function(r){return r.data}))):e.push(n.data),e},[])}function _S(t,e){return t.reduce(function(n,r){return r.type==="group"?n.push.apply(n,Jy(r.options.map(function(a){return{data:a.data,id:"".concat(e,"-").concat(r.index,"-").concat(a.index)}}))):n.push({data:r.data,id:"".concat(e,"-").concat(r.index)}),n},[])}function vU(t,e){return kE(Nm(t,e))}function ES(t,e){var n=t.inputValue,r=n===void 0?"":n,a=e.data,s=e.isSelected,l=e.label,u=e.value;return(!FE(t)||!s)&&IE(t,{label:l,value:u,data:a},r)}function yU(t,e){var n=t.focusedValue,r=t.selectValue,a=r.indexOf(n);if(a>-1){var s=e.indexOf(n);if(s>-1)return n;if(a<e.length)return e[a]}return null}function bU(t,e){var n=t.focusedOption;return n&&e.indexOf(n)>-1?n:e[0]}var K1=function(e,n){var r,a=(r=e.find(function(s){return s.data===n}))===null||r===void 0?void 0:r.id;return a||null},DE=function(e,n){return e.getOptionLabel(n)},cg=function(e,n){return e.getOptionValue(n)};function PE(t,e,n){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,n):!1}function ME(t,e,n){if(n.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,n);var r=cg(t,e);return n.some(function(a){return cg(t,a)===r})}function IE(t,e,n){return t.filterOption?t.filterOption(e,n):!0}var FE=function(e){var n=e.hideSelectedOptions,r=e.isMulti;return n===void 0?r:n},wU=1,UE=(function(t){qM(n,t);var e=GM(n);function n(r){var a;if($M(this,n),a=e.call(this,r),a.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},a.blockOptionHover=!1,a.isComposing=!1,a.commonProps=void 0,a.initialTouchX=0,a.initialTouchY=0,a.openAfterFocus=!1,a.scrollToFocusedOptionOnUpdate=!1,a.userIsDragging=void 0,a.controlRef=null,a.getControlRef=function(c){a.controlRef=c},a.focusedOptionRef=null,a.getFocusedOptionRef=function(c){a.focusedOptionRef=c},a.menuListRef=null,a.getMenuListRef=function(c){a.menuListRef=c},a.inputRef=null,a.getInputRef=function(c){a.inputRef=c},a.focus=a.focusInput,a.blur=a.blurInput,a.onChange=function(c,h){var d=a.props,m=d.onChange,y=d.name;h.name=y,a.ariaOnChange(c,h),m(c,h)},a.setValue=function(c,h,d){var m=a.props,y=m.closeMenuOnSelect,g=m.isMulti,x=m.inputValue;a.onInputChange("",{action:"set-value",prevInputValue:x}),y&&(a.setState({inputIsHiddenAfterUpdate:!g}),a.onMenuClose()),a.setState({clearFocusValueOnUpdate:!0}),a.onChange(c,{action:h,option:d})},a.selectOption=function(c){var h=a.props,d=h.blurInputOnSelect,m=h.isMulti,y=h.name,g=a.state.selectValue,x=m&&a.isOptionSelected(c,g),_=a.isOptionDisabled(c,g);if(x){var N=a.getOptionValue(c);a.setValue(g.filter(function(A){return a.getOptionValue(A)!==N}),"deselect-option",c)}else if(!_)m?a.setValue([].concat(Jy(g),[c]),"select-option",c):a.setValue(c,"select-option");else{a.ariaOnChange(c,{action:"select-option",option:c,name:y});return}d&&a.blurInput()},a.removeValue=function(c){var h=a.props.isMulti,d=a.state.selectValue,m=a.getOptionValue(c),y=d.filter(function(x){return a.getOptionValue(x)!==m}),g=sm(h,y,y[0]||null);a.onChange(g,{action:"remove-value",removedValue:c}),a.focusInput()},a.clearValue=function(){var c=a.state.selectValue;a.onChange(sm(a.props.isMulti,[],null),{action:"clear",removedValues:c})},a.popValue=function(){var c=a.props.isMulti,h=a.state.selectValue,d=h[h.length-1],m=h.slice(0,h.length-1),y=sm(c,m,m[0]||null);d&&a.onChange(y,{action:"pop-value",removedValue:d})},a.getFocusedOptionId=function(c){return K1(a.state.focusableOptionsWithIds,c)},a.getFocusableOptionsWithIds=function(){return _S(Nm(a.props,a.state.selectValue),a.getElementId("option"))},a.getValue=function(){return a.state.selectValue},a.cx=function(){for(var c=arguments.length,h=new Array(c),d=0;d<c;d++)h[d]=arguments[d];return uI.apply(void 0,[a.props.classNamePrefix].concat(h))},a.getOptionLabel=function(c){return DE(a.props,c)},a.getOptionValue=function(c){return cg(a.props,c)},a.getStyles=function(c,h){var d=a.props.unstyled,m=cU[c](h,d);m.boxSizing="border-box";var y=a.props.styles[c];return y?y(m,h):m},a.getClassNames=function(c,h){var d,m;return(d=(m=a.props.classNames)[c])===null||d===void 0?void 0:d.call(m,h)},a.getElementId=function(c){return"".concat(a.state.instancePrefix,"-").concat(c)},a.getComponents=function(){return RF(a.props)},a.buildCategorizedOptions=function(){return Nm(a.props,a.state.selectValue)},a.getCategorizedOptions=function(){return a.props.menuIsOpen?a.buildCategorizedOptions():[]},a.buildFocusableOptions=function(){return kE(a.buildCategorizedOptions())},a.getFocusableOptions=function(){return a.props.menuIsOpen?a.buildFocusableOptions():[]},a.ariaOnChange=function(c,h){a.setState({ariaSelection:zt({value:c},h)})},a.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),a.focusInput())},a.onMenuMouseMove=function(c){a.blockOptionHover=!1},a.onControlMouseDown=function(c){if(!c.defaultPrevented){var h=a.props.openMenuOnClick;a.state.isFocused?a.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&a.onMenuClose():h&&a.openMenu("first"):(h&&(a.openAfterFocus=!0),a.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},a.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!a.props.isDisabled){var h=a.props,d=h.isMulti,m=h.menuIsOpen;a.focusInput(),m?(a.setState({inputIsHiddenAfterUpdate:!d}),a.onMenuClose()):a.openMenu("first"),c.preventDefault()}},a.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(a.clearValue(),c.preventDefault(),a.openAfterFocus=!1,c.type==="touchend"?a.focusInput():setTimeout(function(){return a.focusInput()}))},a.onScroll=function(c){typeof a.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&zg(c.target)&&a.props.onMenuClose():typeof a.props.closeMenuOnScroll=="function"&&a.props.closeMenuOnScroll(c)&&a.props.onMenuClose()},a.onCompositionStart=function(){a.isComposing=!0},a.onCompositionEnd=function(){a.isComposing=!1},a.onTouchStart=function(c){var h=c.touches,d=h&&h.item(0);d&&(a.initialTouchX=d.clientX,a.initialTouchY=d.clientY,a.userIsDragging=!1)},a.onTouchMove=function(c){var h=c.touches,d=h&&h.item(0);if(d){var m=Math.abs(d.clientX-a.initialTouchX),y=Math.abs(d.clientY-a.initialTouchY),g=5;a.userIsDragging=m>g||y>g}},a.onTouchEnd=function(c){a.userIsDragging||(a.controlRef&&!a.controlRef.contains(c.target)&&a.menuListRef&&!a.menuListRef.contains(c.target)&&a.blurInput(),a.initialTouchX=0,a.initialTouchY=0)},a.onControlTouchEnd=function(c){a.userIsDragging||a.onControlMouseDown(c)},a.onClearIndicatorTouchEnd=function(c){a.userIsDragging||a.onClearIndicatorMouseDown(c)},a.onDropdownIndicatorTouchEnd=function(c){a.userIsDragging||a.onDropdownIndicatorMouseDown(c)},a.handleInputChange=function(c){var h=a.props.inputValue,d=c.currentTarget.value;a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange(d,{action:"input-change",prevInputValue:h}),a.props.menuIsOpen||a.onMenuOpen()},a.onInputFocus=function(c){a.props.onFocus&&a.props.onFocus(c),a.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(a.openAfterFocus||a.props.openMenuOnFocus)&&a.openMenu("first"),a.openAfterFocus=!1},a.onInputBlur=function(c){var h=a.props.inputValue;if(a.menuListRef&&a.menuListRef.contains(document.activeElement)){a.inputRef.focus();return}a.props.onBlur&&a.props.onBlur(c),a.onInputChange("",{action:"input-blur",prevInputValue:h}),a.onMenuClose(),a.setState({focusedValue:null,isFocused:!1})},a.onOptionHover=function(c){if(!(a.blockOptionHover||a.state.focusedOption===c)){var h=a.getFocusableOptions(),d=h.indexOf(c);a.setState({focusedOption:c,focusedOptionId:d>-1?a.getFocusedOptionId(c):null})}},a.shouldHideSelectedOptions=function(){return FE(a.props)},a.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),a.focus()},a.onKeyDown=function(c){var h=a.props,d=h.isMulti,m=h.backspaceRemovesValue,y=h.escapeClearsValue,g=h.inputValue,x=h.isClearable,_=h.isDisabled,N=h.menuIsOpen,A=h.onKeyDown,j=h.tabSelectsValue,L=h.openMenuOnFocus,R=a.state,I=R.focusedOption,ee=R.focusedValue,G=R.selectValue;if(!_&&!(typeof A=="function"&&(A(c),c.defaultPrevented))){switch(a.blockOptionHover=!0,c.key){case"ArrowLeft":if(!d||g)return;a.focusValue("previous");break;case"ArrowRight":if(!d||g)return;a.focusValue("next");break;case"Delete":case"Backspace":if(g)return;if(ee)a.removeValue(ee);else{if(!m)return;d?a.popValue():x&&a.clearValue()}break;case"Tab":if(a.isComposing||c.shiftKey||!N||!j||!I||L&&a.isOptionSelected(I,G))return;a.selectOption(I);break;case"Enter":if(c.keyCode===229)break;if(N){if(!I||a.isComposing)return;a.selectOption(I);break}return;case"Escape":N?(a.setState({inputIsHiddenAfterUpdate:!1}),a.onInputChange("",{action:"menu-close",prevInputValue:g}),a.onMenuClose()):x&&y&&a.clearValue();break;case" ":if(g)return;if(!N){a.openMenu("first");break}if(!I)return;a.selectOption(I);break;case"ArrowUp":N?a.focusOption("up"):a.openMenu("last");break;case"ArrowDown":N?a.focusOption("down"):a.openMenu("first");break;case"PageUp":if(!N)return;a.focusOption("pageup");break;case"PageDown":if(!N)return;a.focusOption("pagedown");break;case"Home":if(!N)return;a.focusOption("first");break;case"End":if(!N)return;a.focusOption("last");break;default:return}c.preventDefault()}},a.state.instancePrefix="react-select-"+(a.props.instanceId||++wU),a.state.selectValue=lS(r.value),r.menuIsOpen&&a.state.selectValue.length){var s=a.getFocusableOptionsWithIds(),l=a.buildFocusableOptions(),u=l.indexOf(a.state.selectValue[0]);a.state.focusableOptionsWithIds=s,a.state.focusedOption=l[u],a.state.focusedOptionId=K1(s,l[u])}return a}return zM(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&uS(this.menuListRef,this.focusedOptionRef),iU()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(a){var s=this.props,l=s.isDisabled,u=s.menuIsOpen,c=this.state.isFocused;(c&&!l&&a.isDisabled||c&&u&&!a.menuIsOpen)&&this.focusInput(),c&&l&&!a.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!l&&a.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(uS(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(a,s){this.props.onInputChange(a,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(a){var s=this,l=this.state,u=l.selectValue,c=l.isFocused,h=this.buildFocusableOptions(),d=a==="first"?0:h.length-1;if(!this.props.isMulti){var m=h.indexOf(u[0]);m>-1&&(d=m)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:h[d],focusedOptionId:this.getFocusedOptionId(h[d])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(a){var s=this.state,l=s.selectValue,u=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=l.indexOf(u);u||(c=-1);var h=l.length-1,d=-1;if(l.length){switch(a){case"previous":c===0?d=0:c===-1?d=h:d=c-1;break;case"next":c>-1&&c<h&&(d=c+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:l[d]})}}}},{key:"focusOption",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,l=this.state.focusedOption,u=this.getFocusableOptions();if(u.length){var c=0,h=u.indexOf(l);l||(h=-1),a==="up"?c=h>0?h-1:u.length-1:a==="down"?c=(h+1)%u.length:a==="pageup"?(c=h-s,c<0&&(c=0)):a==="pagedown"?(c=h+s,c>u.length-1&&(c=u.length-1)):a==="last"&&(c=u.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:u[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(u[c])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Y1):zt(zt({},Y1),this.props.theme):Y1})},{key:"getCommonProps",value:function(){var a=this.clearValue,s=this.cx,l=this.getStyles,u=this.getClassNames,c=this.getValue,h=this.selectOption,d=this.setValue,m=this.props,y=m.isMulti,g=m.isRtl,x=m.options,_=this.hasValue();return{clearValue:a,cx:s,getStyles:l,getClassNames:u,getValue:c,hasValue:_,isMulti:y,isRtl:g,options:x,selectOption:h,selectProps:m,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var a=this.state.selectValue;return a.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var a=this.props,s=a.isClearable,l=a.isMulti;return s===void 0?l:s}},{key:"isOptionDisabled",value:function(a,s){return PE(this.props,a,s)}},{key:"isOptionSelected",value:function(a,s){return ME(this.props,a,s)}},{key:"filterOption",value:function(a,s){return IE(this.props,a,s)}},{key:"formatOptionLabel",value:function(a,s){if(typeof this.props.formatOptionLabel=="function"){var l=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(a,{context:s,inputValue:l,selectValue:u})}else return this.getOptionLabel(a)}},{key:"formatGroupLabel",value:function(a){return this.props.formatGroupLabel(a)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var a=this.props,s=a.isDisabled,l=a.isSearchable,u=a.inputId,c=a.inputValue,h=a.tabIndex,d=a.form,m=a.menuIsOpen,y=a.required,g=this.getComponents(),x=g.Input,_=this.state,N=_.inputIsHidden,A=_.ariaSelection,j=this.commonProps,L=u||this.getElementId("input"),R=zt(zt(zt({"aria-autocomplete":"list","aria-expanded":m,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":y,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},m&&{"aria-controls":this.getElementId("listbox")}),!l&&{"aria-readonly":!0}),this.hasValue()?(A==null?void 0:A.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return l?D.createElement(x,Gt({},j,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:L,innerRef:this.getInputRef,isDisabled:s,isHidden:N,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:h,form:d,type:"text",value:c},R)):D.createElement(GF,Gt({id:L,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:lg,onFocus:this.onInputFocus,disabled:s,tabIndex:h,inputMode:"none",form:d,value:""},R))})},{key:"renderPlaceholderOrValue",value:function(){var a=this,s=this.getComponents(),l=s.MultiValue,u=s.MultiValueContainer,c=s.MultiValueLabel,h=s.MultiValueRemove,d=s.SingleValue,m=s.Placeholder,y=this.commonProps,g=this.props,x=g.controlShouldRenderValue,_=g.isDisabled,N=g.isMulti,A=g.inputValue,j=g.placeholder,L=this.state,R=L.selectValue,I=L.focusedValue,ee=L.isFocused;if(!this.hasValue()||!x)return A?null:D.createElement(m,Gt({},y,{key:"placeholder",isDisabled:_,isFocused:ee,innerProps:{id:this.getElementId("placeholder")}}),j);if(N)return R.map(function(P,B){var X=P===I,F="".concat(a.getOptionLabel(P),"-").concat(a.getOptionValue(P));return D.createElement(l,Gt({},y,{components:{Container:u,Label:c,Remove:h},isFocused:X,isDisabled:_,key:F,index:B,removeProps:{onClick:function(){return a.removeValue(P)},onTouchEnd:function(){return a.removeValue(P)},onMouseDown:function(K){K.preventDefault()}},data:P}),a.formatOptionLabel(P,"value"))});if(A)return null;var G=R[0];return D.createElement(d,Gt({},y,{data:G,isDisabled:_}),this.formatOptionLabel(G,"value"))}},{key:"renderClearIndicator",value:function(){var a=this.getComponents(),s=a.ClearIndicator,l=this.commonProps,u=this.props,c=u.isDisabled,h=u.isLoading,d=this.state.isFocused;if(!this.isClearable()||!s||c||!this.hasValue()||h)return null;var m={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return D.createElement(s,Gt({},l,{innerProps:m,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var a=this.getComponents(),s=a.LoadingIndicator,l=this.commonProps,u=this.props,c=u.isDisabled,h=u.isLoading,d=this.state.isFocused;if(!s||!h)return null;var m={"aria-hidden":"true"};return D.createElement(s,Gt({},l,{innerProps:m,isDisabled:c,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var a=this.getComponents(),s=a.DropdownIndicator,l=a.IndicatorSeparator;if(!s||!l)return null;var u=this.commonProps,c=this.props.isDisabled,h=this.state.isFocused;return D.createElement(l,Gt({},u,{isDisabled:c,isFocused:h}))}},{key:"renderDropdownIndicator",value:function(){var a=this.getComponents(),s=a.DropdownIndicator;if(!s)return null;var l=this.commonProps,u=this.props.isDisabled,c=this.state.isFocused,h={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return D.createElement(s,Gt({},l,{innerProps:h,isDisabled:u,isFocused:c}))}},{key:"renderMenu",value:function(){var a=this,s=this.getComponents(),l=s.Group,u=s.GroupHeading,c=s.Menu,h=s.MenuList,d=s.MenuPortal,m=s.LoadingMessage,y=s.NoOptionsMessage,g=s.Option,x=this.commonProps,_=this.state.focusedOption,N=this.props,A=N.captureMenuScroll,j=N.inputValue,L=N.isLoading,R=N.loadingMessage,I=N.minMenuHeight,ee=N.maxMenuHeight,G=N.menuIsOpen,P=N.menuPlacement,B=N.menuPosition,X=N.menuPortalTarget,F=N.menuShouldBlockScroll,$=N.menuShouldScrollIntoView,K=N.noOptionsMessage,Y=N.onMenuScrollToTop,he=N.onMenuScrollToBottom;if(!G)return null;var te=function(V,Z){var ie=V.type,z=V.data,se=V.isDisabled,ge=V.isSelected,xe=V.label,Re=V.value,De=_===z,qe=se?void 0:function(){return a.onOptionHover(z)},Pe=se?void 0:function(){return a.selectOption(z)},Ke="".concat(a.getElementId("option"),"-").concat(Z),ne={id:Ke,onClick:Pe,onMouseMove:qe,onMouseOver:qe,tabIndex:-1,role:"option","aria-selected":a.state.isAppleDevice?void 0:ge};return D.createElement(g,Gt({},x,{innerProps:ne,data:z,isDisabled:se,isSelected:ge,key:Ke,label:xe,type:ie,value:Re,isFocused:De,innerRef:De?a.getFocusedOptionRef:void 0}),a.formatOptionLabel(V.data,"menu"))},oe;if(this.hasOptions())oe=this.getCategorizedOptions().map(function(O){if(O.type==="group"){var V=O.data,Z=O.options,ie=O.index,z="".concat(a.getElementId("group"),"-").concat(ie),se="".concat(z,"-heading");return D.createElement(l,Gt({},x,{key:z,data:V,options:Z,Heading:u,headingProps:{id:se,data:O.data},label:a.formatGroupLabel(O.data)}),O.options.map(function(ge){return te(ge,"".concat(ie,"-").concat(ge.index))}))}else if(O.type==="option")return te(O,"".concat(O.index))});else if(L){var le=R({inputValue:j});if(le===null)return null;oe=D.createElement(m,x,le)}else{var pe=K({inputValue:j});if(pe===null)return null;oe=D.createElement(y,x,pe)}var Ne={minMenuHeight:I,maxMenuHeight:ee,menuPlacement:P,menuPosition:B,menuShouldScrollIntoView:$},U=D.createElement(AI,Gt({},x,Ne),function(O){var V=O.ref,Z=O.placerProps,ie=Z.placement,z=Z.maxHeight;return D.createElement(c,Gt({},x,Ne,{innerRef:V,innerProps:{onMouseDown:a.onMenuMouseDown,onMouseMove:a.onMenuMouseMove},isLoading:L,placement:ie}),D.createElement(ZF,{captureEnabled:A,onTopArrive:Y,onBottomArrive:he,lockEnabled:F},function(se){return D.createElement(h,Gt({},x,{innerRef:function(xe){a.getMenuListRef(xe),se(xe)},innerProps:{role:"listbox","aria-multiselectable":x.isMulti,id:a.getElementId("listbox")},isLoading:L,maxHeight:z,focusedOption:_}),oe)}))});return X||B==="fixed"?D.createElement(d,Gt({},x,{appendTo:X,controlElement:this.controlRef,menuPlacement:P,menuPosition:B}),U):U}},{key:"renderFormField",value:function(){var a=this,s=this.props,l=s.delimiter,u=s.isDisabled,c=s.isMulti,h=s.name,d=s.required,m=this.state.selectValue;if(d&&!this.hasValue()&&!u)return D.createElement(tU,{name:h,onFocus:this.onValueInputFocus});if(!(!h||u))if(c)if(l){var y=m.map(function(_){return a.getOptionValue(_)}).join(l);return D.createElement("input",{name:h,type:"hidden",value:y})}else{var g=m.length>0?m.map(function(_,N){return D.createElement("input",{key:"i-".concat(N),name:h,type:"hidden",value:a.getOptionValue(_)})}):D.createElement("input",{name:h,type:"hidden",value:""});return D.createElement("div",null,g)}else{var x=m[0]?this.getOptionValue(m[0]):"";return D.createElement("input",{name:h,type:"hidden",value:x})}}},{key:"renderLiveRegion",value:function(){var a=this.commonProps,s=this.state,l=s.ariaSelection,u=s.focusedOption,c=s.focusedValue,h=s.isFocused,d=s.selectValue,m=this.getFocusableOptions();return D.createElement(BF,Gt({},a,{id:this.getElementId("live-region"),ariaSelection:l,focusedOption:u,focusedValue:c,isFocused:h,selectValue:d,focusableOptions:m,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var a=this.getComponents(),s=a.Control,l=a.IndicatorsContainer,u=a.SelectContainer,c=a.ValueContainer,h=this.props,d=h.className,m=h.id,y=h.isDisabled,g=h.menuIsOpen,x=this.state.isFocused,_=this.commonProps=this.getCommonProps();return D.createElement(u,Gt({},_,{className:d,innerProps:{id:m,onKeyDown:this.onKeyDown},isDisabled:y,isFocused:x}),this.renderLiveRegion(),D.createElement(s,Gt({},_,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:y,isFocused:x,menuIsOpen:g}),D.createElement(c,Gt({},_,{isDisabled:y}),this.renderPlaceholderOrValue(),this.renderInput()),D.createElement(l,Gt({},_,{isDisabled:y}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(a,s){var l=s.prevProps,u=s.clearFocusValueOnUpdate,c=s.inputIsHiddenAfterUpdate,h=s.ariaSelection,d=s.isFocused,m=s.prevWasFocused,y=s.instancePrefix,g=a.options,x=a.value,_=a.menuIsOpen,N=a.inputValue,A=a.isMulti,j=lS(x),L={};if(l&&(x!==l.value||g!==l.options||_!==l.menuIsOpen||N!==l.inputValue)){var R=_?vU(a,j):[],I=_?_S(Nm(a,j),"".concat(y,"-option")):[],ee=u?yU(s,j):null,G=bU(s,R),P=K1(I,G);L={selectValue:j,focusedOption:G,focusedOptionId:P,focusableOptionsWithIds:I,focusedValue:ee,clearFocusValueOnUpdate:!1}}var B=c!=null&&a!==l?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},X=h,F=d&&m;return d&&!F&&(X={value:sm(A,j,j[0]||null),options:j,action:"initial-input-focus"},F=!m),(h==null?void 0:h.action)==="initial-input-focus"&&(X=null),zt(zt(zt({},L),B),{},{prevProps:a,ariaSelection:X,prevWasFocused:F})}}]),n})(D.Component);UE.defaultProps=gU;var xU=D.forwardRef(function(t,e){var n=BM(t);return D.createElement(UE,Gt({ref:e},n))}),SU=xU;const BE="mosques-by-location-db",Pf="mosquesByLocation";async function _U(t,e){await(await Xr(BE,1,{upgrade(r){r.objectStoreNames.contains(Pf)||r.createObjectStore(Pf)}})).put(Pf,e,t)}async function EU(t){return(await Xr(BE,1,{upgrade(n){n.objectStoreNames.contains(Pf)||n.createObjectStore(Pf)}})).get(Pf,t)}function AU(t,{onFetchMosques:e}={}){const[n,r]=D.useState([]),[a,s]=D.useState(!1);return D.useEffect(()=>{if(!t){r([]);return}let l=!1;return s(!0),(async()=>{try{const c=await EU(t);if(!l&&c&&c.length>0&&(r(c),e==null||e(c)),navigator.onLine){const h=await H7(t);if(!l)if(!h||h.length===0)r([]),e==null||e([]);else{const d=h.map(m=>({value:m.id,label:m.name,isDisabled:m.name==="Other Masjids"?!0:m.isDisabled??!1}));r(d),e==null||e(d),await _U(t,d)}}else(!c||c.length===0)&&(r([]),e==null||e([]),Rn("info","You are offline!"))}catch(c){l||(r([]),console.error(`Error fetching mosques in location ${t}: `,c),await aa(c,{message:`Error fetching mosques in location ${t}`,function:"useMosqueForLocation"}),Rn("error","Error fetching mosques!"))}finally{l||s(!1)}})(),()=>{l=!0}},[t]),{mosques:n,loading:a}}const NU=t=>{const e=D.useRef(null);return D.useEffect(()=>{const n=e.current;n&&(n.tabIndex=0,n.focus())},[]),E.jsx(TE.Input,{...t,innerRef:n=>{e.current=n}})},CU={control:t=>({...t,color:"#1a202c",backgroundColor:"white"}),singleValue:t=>({...t,color:"#1a202c"}),input:t=>({...t,color:"#1a202c"}),option:(t,e)=>({...t,color:e.isDisabled?"green":e.isSelected?"#fff":"#1a202c",backgroundColor:e.isDisabled?"#f0f0f0":e.isSelected?"#2563eb":"#fff",cursor:e.isDisabled?"default":"pointer",fontWeight:e.isDisabled?"bold":"normal",pointerEvents:e.isDisabled?"none":"auto"}),placeholder:t=>({...t,color:"#a0aec0"})},$E=({isHome:t=!0})=>{const{org_nr:e}=ia(),{locationId:n,selectedMosque:r,setSelectedMosque:a}=vi(),{mosques:s}=AU(n),l=Bi(),u=ls(),{t:c}=Ar(),h=d=>{if(a(d),!d)return;const m=u.pathname;m.includes("events")?l(`/${d.value}/events`):m.includes("view-timetable")?l(`/${d.value}/view-timetable`):l(t?`/${d.value}`:`/${d.value}/view-timetable`)};return E.jsxs("div",{className:"flex justify-center gap-1",children:[E.jsx("div",{children:E.jsx("button",{type:"button",disabled:t,className:`p-0 border-0 bg-transparent ${t?"cursor-default":"cursor-pointer"}`,onClick:()=>{t||l(`/${e}`)},"aria-label":"Go to masjid home",children:E.jsx("img",{src:"/img/masjid-select.png",alt:""})})}),E.jsx("div",{className:"w-50",children:E.jsx(SU,{options:s,value:r,onChange:h,isSearchable:!0,placeholder:c("Select Masjid"),noOptionsMessage:()=>"No masjid found",styles:CU,components:{Input:NU}})})]})};function TU(t){return Na({attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M11.9997 10.5865L16.9495 5.63672L18.3637 7.05093L13.4139 12.0007L18.3637 16.9504L16.9495 18.3646L11.9997 13.4149L7.04996 18.3646L5.63574 16.9504L10.5855 12.0007L5.63574 7.05093L7.04996 5.63672L11.9997 10.5865Z"},child:[]}]})(t)}const zE="location-db",Mf="locations";async function LU(t){await(await Xr(zE,1,{upgrade(n){n.objectStoreNames.contains(Mf)||n.createObjectStore(Mf)}})).put(Mf,t,"all")}async function AS(){return(await Xr(zE,1,{upgrade(e){e.objectStoreNames.contains(Mf)||e.createObjectStore(Mf)}})).get(Mf,"all")}function jU(){const[t,e]=D.useState([{name:"Oslo",id:"NO0301"}]),[n,r]=D.useState(!0);return D.useEffect(()=>{(async()=>{try{const s=await AS();if(!navigator.onLine){s&&s.length>0&&e(s),r(!1);return}const u=await AM();if(!u){s&&s.length>0&&(e(s),Rn("warning","Could not fetch fresh data, showing cached locations.")),r(!1);return}e(u),await LU(u),r(!1)}catch(s){console.error("Error fetching locations: ",s),await aa(s,{message:"Error fetching locations",function:"useLocations"}),Rn("error","Error fetching locations");const l=await AS();l&&l.length>0&&(e(l),Rn("info","Showing cached locations due to fetch error.")),r(!1)}})()},[]),{locations:t,loading:n}}function OU(t){return Na({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416.3 256c0-21 13.1-38.9 31.7-46.1-4.9-20.5-13-39.7-23.7-57.1-6.4 2.8-13.2 4.3-20.1 4.3-12.6 0-25.2-4.8-34.9-14.4-14.9-14.9-18.2-36.8-10.2-55-17.3-10.7-36.6-18.8-57-23.7C295 82.5 277 95.7 256 95.7S217 82.5 209.9 64c-20.5 4.9-39.7 13-57.1 23.7 8.1 18.1 4.7 40.1-10.2 55-9.6 9.6-22.3 14.4-34.9 14.4-6.9 0-13.7-1.4-20.1-4.3C77 170.3 68.9 189.5 64 210c18.5 7.1 31.7 25 31.7 46.1 0 21-13.1 38.9-31.6 46.1 4.9 20.5 13 39.7 23.7 57.1 6.4-2.8 13.2-4.2 20-4.2 12.6 0 25.2 4.8 34.9 14.4 14.8 14.8 18.2 36.8 10.2 54.9 17.4 10.7 36.7 18.8 57.1 23.7 7.1-18.5 25-31.6 46-31.6s38.9 13.1 46 31.6c20.5-4.9 39.7-13 57.1-23.7-8-18.1-4.6-40 10.2-54.9 9.6-9.6 22.2-14.4 34.9-14.4 6.8 0 13.7 1.4 20 4.2 10.7-17.4 18.8-36.7 23.7-57.1-18.4-7.2-31.6-25.1-31.6-46.2zm-159.4 79.9c-44.3 0-80-35.9-80-80s35.7-80 80-80 80 35.9 80 80-35.7 80-80 80z"},child:[]}]})(t)}function o2(t){return Na({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M217.9 256L345 129c9.4-9.4 9.4-24.6 0-33.9-9.4-9.4-24.6-9.3-34 0L167 239c-9.1 9.1-9.3 23.7-.7 33.1L310.9 417c4.7 4.7 10.9 7 17 7s12.3-2.3 17-7c9.4-9.4 9.4-24.6 0-33.9L217.9 256z"},child:[]}]})(t)}const Ud=({isHome:t=!0})=>{const{org_nr:e,loc_id:n}=ia(),r=Bi(),{t:a,i18n:s}=Ar(),{language:l,setLanguage:u,asrMethod:c,setAsrMethod:h,prayerMethod:d,setPrayerMethod:m,locationId:y,setLocationId:g,mosqueLogo:x,selectedMosque:_,setSelectedMosque:N,lat:A,lon:j}=vi(),{masjidName:L,masjidAddress:R,masjidWebsite:I,contactName:ee,masjidContact:G,masjidEmail:P,masjidInfo:B}=Pd(e||(_==null?void 0:_.value)||"982842840"),{locations:X}=jU(),[F,$]=D.useState(!1),[K,Y]=D.useState(!1),[he,te]=D.useState(!1),[oe,le]=D.useState(!1),[pe,Ne]=D.useState(null),[U,O]=D.useState(null),V=l==="ar",Z=!0,ie=A&&j?`https://www.openstreetmap.org/export/embed.html?bbox=${j},${A},${j+.002},${A+.002}&marker=${A},${j}&layer=mapnik`:"";D.useEffect(()=>{e&&_||le(!0)},[e,_,n]),D.useEffect(()=>{(async()=>{const xe=await Hy(e||(_==null?void 0:_.value),n||y);xe&&(Ne(xe.asr_method||0),O(xe.prayer_method||1))})()},[e,_==null?void 0:_.value]);const z=ge=>{u(Gm(ge)),s.changeLanguage(Gm(ge))},se=ge=>{const xe=ge.target.value;X.find(De=>De.id===xe)&&(g(xe),t&&r(`/loc/${xe}`)),N(null)};return E.jsxs("div",{children:[E.jsxs("div",{className:"w-full mb-4 flex justify-between items-center",children:[E.jsxs("div",{className:"flex items-center",children:[!t&&E.jsx("button",{onClick:()=>r(`/${e}`),className:"text-sm font-semibold px-3 py-1 rounded hover:bg-gray-100 hover:text-black",children:E.jsx(xM,{})}),E.jsx("select",{value:y,onChange:se,className:"w-20 sm:w-40 h-full font-semibold hover:cursor-pointer",children:X.map(ge=>E.jsx("option",{value:ge.id,className:"text-black",children:ge.name},ge.id))})]}),E.jsx("div",{className:"flex items-center space-x-2 h-full",children:E.jsx("img",{src:x!=null&&x.startsWith("http")?x:x?`data:image/png;base64,${x}`:"/default-logo.png",alt:"logo",className:"h-10 2xl:h-14 object-contain",loading:"lazy"})})]}),E.jsxs("div",{className:"flex flex-col sm:items-end justify-center w-full gap-5 sm:flex-row sm:justify-between",children:[E.jsxs("div",{className:"flex flex-col sm:flex-row items-center sm:w-1/2 gap-5",children:[oe&&Z&&E.jsx($E,{isHome:t}),E.jsxs("div",{children:[E.jsxs("h4",{className:"flex justify-center sm:justify-start items-center gap-4 text-lg sm:text-xl font-medium text-center mb-1",children:[L,!oe&&E.jsx("span",{className:"cursor-pointer",onClick:()=>le(!0),children:E.jsx(TU,{size:20,color:"red"})})]}),E.jsx("p",{className:"text-sm md:text-base",children:B})]})]}),E.jsx("div",{dir:V?"rtl":"ltr",children:E.jsxs("h4",{className:"flex sm:text-xl font-medium items-center justify-center gap-4",children:[E.jsxs(E.Fragment,{children:[E.jsx(q3,{className:"cursor-pointer hover:text-yellow-500 hidden md:block",onClick:()=>r(`/${e||"982842840"}/masjid`)}),E.jsx(Yy,{size:22,className:"cursor-pointer hover:text-green-500 hidden md:block",onClick:()=>r(`/${e||"982842840"}/lobby`)})]}),E.jsx(wP,{className:"cursor-pointer hover:text-blue-500",onClick:()=>Y(!0),title:"View Phone"}),E.jsx(SM,{className:"cursor-pointer hover:text-red-500",onClick:()=>$(!0),title:"View Location"}),E.jsx(OU,{size:24,className:"cursor-pointer hover:text-blue-500",onClick:()=>te(!0),title:"Settings"})]})})]}),E.jsx("div",{className:"border-b w-full mt-2 sm:mt-4"}),F&&E.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black/50 z-50",onClick:()=>$(!1),children:E.jsx("div",{className:"bg-white rounded-lg p-4 relative shadow-lg w-[90vw] h-[50vh] sm:w-[600px] sm:h-[400px]",onClick:ge=>ge.stopPropagation(),children:ie?E.jsx("iframe",{width:"100%",height:"100%",className:"rounded-md",src:ie,style:{border:0},allowFullScreen:!0}):E.jsx("h2",{className:"flex justify-center items-center h-full text-xl text-black",children:"No map found!"})})}),K&&E.jsx("div",{className:`\r
|
|
967
|
+
fixed inset-0 flex items-center justify-center \r
|
|
968
|
+
lg:block \r
|
|
969
|
+
bg-black/50 z-50\r
|
|
970
|
+
`,onClick:()=>Y(!1),children:E.jsxs("div",{className:`\r
|
|
971
|
+
bg-white rounded-lg p-4 sm:p-6 shadow-lg flex flex-col gap-1 sm:gap-2\r
|
|
972
|
+
w-[80vw] sm:w-[340px]\r
|
|
973
|
+
mt-15 text-sm sm:text-base text-black\r
|
|
974
|
+
\r
|
|
975
|
+
/* Ensure text wraps instead of overflowing */\r
|
|
976
|
+
wrap-break-word\r
|
|
977
|
+
\r
|
|
978
|
+
/* Center for small screens */\r
|
|
979
|
+
sm:mx-auto sm:mt-[20vh]\r
|
|
980
|
+
\r
|
|
981
|
+
/* Right-bottom for large screens */\r
|
|
982
|
+
lg:absolute lg:top-15 lg:right-10\r
|
|
983
|
+
`,onClick:ge=>ge.stopPropagation(),children:[E.jsxs("p",{className:"font-medium",children:["Address: ",R]}),E.jsxs("p",{className:"font-medium",children:["Website: ",I]}),E.jsxs("p",{className:"font-medium",children:["Name: ",ee]}),E.jsxs("p",{className:"font-medium",children:["Mobile: ",G]}),E.jsxs("p",{className:"font-medium",children:["Email: ",P]})]})}),he&&E.jsx("div",{className:`\r
|
|
984
|
+
fixed inset-0 flex items-center justify-center \r
|
|
985
|
+
lg:block \r
|
|
986
|
+
bg-black/50 z-50\r
|
|
987
|
+
`,onClick:()=>te(!1),children:E.jsxs("div",{className:`\r
|
|
988
|
+
bg-white text-black rounded-lg p-4 sm:p-5 shadow-lg flex flex-col gap-1\r
|
|
989
|
+
w-[80vw] sm:w-82.5\r
|
|
990
|
+
mt-15 text-sm sm:text-base\r
|
|
991
|
+
\r
|
|
992
|
+
/* Ensure text wraps instead of overflowing */\r
|
|
993
|
+
wrap-break-words\r
|
|
994
|
+
\r
|
|
995
|
+
/* Center for small screens */\r
|
|
996
|
+
sm:mx-auto sm:mt-[20vh]\r
|
|
997
|
+
\r
|
|
998
|
+
/* Right-bottom for large screens */\r
|
|
999
|
+
lg:absolute lg:top-15 lg:right-10\r
|
|
1000
|
+
`,onClick:ge=>ge.stopPropagation(),children:[E.jsxs("div",{className:"flex gap-2 items-center",children:[E.jsx("label",{className:"font-semibold w-30",children:a("LANGUAGE")}),E.jsxs("select",{value:l!==null?RO(l):"",onChange:ge=>z(Number(ge.target.value)),className:"rounded-md px-2 py-1",children:[E.jsx("option",{value:"",children:a("SELECT")}),E.jsx("option",{value:1,children:a("NORWEGIAN")}),E.jsx("option",{value:2,children:a("ENGLISH")}),E.jsx("option",{value:3,children:a("ARABIC")})]})]}),E.jsxs("div",{className:"flex gap-2 items-center",children:[E.jsx("h2",{className:"font-semibold w-30",children:a("ASR METHOD")}),E.jsxs("select",{value:c!==null?c:"",onChange:ge=>h(Number(ge.target.value)),className:"rounded-md px-2 py-1",disabled:pe!==0,children:[E.jsx("option",{value:"",children:a("SELECT")}),E.jsx("option",{value:0,children:a("IRN DEFAULT")}),E.jsx("option",{value:1,children:a("1X METHOD")}),E.jsx("option",{value:2,children:a("2X METHOD")}),E.jsx("option",{value:3,children:a("50% METHOD")})]})]}),E.jsxs("div",{className:"flex gap-2 items-center",children:[E.jsx("h2",{className:"font-semibold w-30",children:a("PRAYER METHOD")}),E.jsxs("select",{value:d!==null?d:"",onChange:ge=>m(Number(ge.target.value)),className:"rounded-md px-2 py-1",disabled:U!==1,children:[E.jsx("option",{value:"",children:a("SELECT")}),E.jsx("option",{value:1,children:a("IRN DEFAULT")}),E.jsxs("option",{value:2,children:[a("NORTH")," ",a("METHOD").toLowerCase()]}),E.jsxs("option",{value:3,children:[a("SOUTH")," ",a("METHOD").toLowerCase()]})]})]})]})})]})},RU=["SUN","MON","TUE","WED","THU","FRI","SAT"],kU=t=>{switch(t){case 7:return{calendarBg:"#F8F5E9",calendarText:"#27391C",buttonBg:"#FFFFFF",headingColor:"#FFFFFF",buttonTextColor:"#3A7D44"};case 8:return{calendarBg:"#543A14",calendarText:"#F0BB78",buttonBg:"#543A14",headingColor:"#543A14",buttonTextColor:"#FFF0DC"};case 9:return{calendarBg:"#FEF9E133",calendarText:"#E5D0AC",buttonBg:"#FEF9E1",headingColor:"#FEF9E1",buttonTextColor:"#6D2323"};default:return{calendarBg:"white",calendarText:"black",buttonBg:"black",headingColor:"black",buttonTextColor:"white"}}},om=t=>Math.floor(t*.9703+622),Cm=({tn:t,showDate:e=!0,initialDate:n,onDateSelect:r})=>{const{org_nr:a}=ia(),{t:s}=Ar(),u=Tu().language,[c,h]=D.useState(n||new Date),[d,m]=D.useState(n||new Date),[y,g]=D.useState(null),[x,_]=D.useState(new Map),{colorScheme:N,hijriMonthNames:A}=vi(),j=N.isDefault,L=kU(t??0),I=(()=>{const z=ls(),se=`/${a}`;return a?z.pathname===se:z.pathname==="/"})(),ee=u==="ar"?"hijri":"gregorian",[G,P]=D.useState(0),[B,X]=D.useState(0),F=c.getFullYear(),$=c.getMonth(),K=new Date,Y=u==="ar"?6:0,he=[];for(let z=0;z<7;z++){const se=(Y+z)%7;he.push(RU[se])}D.useEffect(()=>{n&&(m(n),h(new Date(n.getFullYear(),n.getMonth())))},[n]),D.useEffect(()=>{if(!x.size)return;const z=d.toLocaleDateString("en-CA"),se=x.get(z);g(se||null),ee==="hijri"&&G===0&&se&&(P(se.hijri_date_year),X(se.hijri_date_month),h(new Date(om(se.hijri_date_year),$)))},[x,d,ee,G,$]),D.useEffect(()=>{const z=F,se=new Date(z-1,0,1),ge=new Date(z+1,11,31),xe=se.toISOString().split("T")[0],Re=ge.toISOString().split("T")[0];Dg(xe,Re).then(De=>{_(qe=>new Map([...qe,...De]))}).catch(De=>{console.error("Failed to fetch Hijri dates for year:",De)})},[F]);const te=()=>{if(ee==="gregorian"){const se=(new Date(F,$,1).getDay()-Y+7)%7,ge=new Date(F,$+1,0).getDate(),xe=[],Re=$===0?11:$-1,De=$===0?F-1:F,qe=new Date(De,Re+1,0).getDate();for(let ne=se;ne>0;ne--){const We=new Date(De,Re,qe-ne+1),it=We.toLocaleDateString("en-CA"),tt=x.get(it);xe.push({gregorian:We.getDate(),hijri:tt==null?void 0:tt.hijri_date_day,hijriObj:tt,currentMonth:!1,fullDate:We})}for(let ne=1;ne<=ge;ne++){const We=new Date(F,$,ne),it=We.toLocaleDateString("en-CA"),tt=x.get(it);xe.push({gregorian:ne,hijri:tt==null?void 0:tt.hijri_date_day,hijriObj:tt,currentMonth:!0,fullDate:We})}const Ke=(7-xe.length%7)%7;for(let ne=1;ne<=Ke;ne++){const We=new Date(F,$+1,ne),it=We.toLocaleDateString("en-CA"),tt=x.get(it);xe.push({gregorian:ne,hijri:tt==null?void 0:tt.hijri_date_day,hijriObj:tt,currentMonth:!1,fullDate:We})}return xe}else{const z=[];for(const[Pe,Ke]of x.entries())if(Ke.hijri_date_year===G&&Ke.hijri_date_month===B){const ne=new Date(Pe);z.push({gregorian:ne.getDate(),hijri:Ke.hijri_date_day,hijriObj:Ke,currentMonth:!0,fullDate:ne})}if(z.sort((Pe,Ke)=>Pe.fullDate.getTime()-Ke.fullDate.getTime()),z.length===0)return[];const se=z[0].fullDate,ge=z[z.length-1].fullDate,xe=(se.getDay()-Y+7)%7,Re=[];for(let Pe=xe;Pe>0;Pe--){const Ke=new Date(se);Ke.setDate(Ke.getDate()-Pe);const ne=Ke.toLocaleDateString("en-CA"),We=x.get(ne);Re.push({gregorian:Ke.getDate(),hijri:We==null?void 0:We.hijri_date_day,hijriObj:We,currentMonth:!1,fullDate:Ke})}Re.push(...z);const qe=(7-Re.length%7)%7;for(let Pe=1;Pe<=qe;Pe++){const Ke=new Date(ge);Ke.setDate(Ke.getDate()+Pe);const ne=Ke.toLocaleDateString("en-CA"),We=x.get(ne);Re.push({gregorian:Ke.getDate(),hijri:We==null?void 0:We.hijri_date_day,hijriObj:We,currentMonth:!1,fullDate:Ke})}return Re}},oe=(z,se)=>{const ge=z.getFullYear(),xe=z.getMonth();h(new Date(ge,xe)),m(z),g(se||null),ee==="hijri"&&se&&(P(se.hijri_date_year),X(se.hijri_date_month)),r&&r(z,se)},le=()=>{const z=K.toLocaleDateString("en-CA"),se=x.get(z),ge=K.getFullYear(),xe=K.getMonth();h(new Date(ge,xe)),m(K),g(se||null),ee==="hijri"&&se&&(P(se.hijri_date_year),X(se.hijri_date_month)),r&&r(K,se)},pe=()=>{if(ee==="gregorian")h(new Date(F,$-1));else{let z=B-1,se=G;z<1&&(z=12,se--),X(z),P(se),h(new Date(om(se),0))}},Ne=()=>{if(ee==="gregorian")h(new Date(F,$+1));else{let z=B+1,se=G;z>12&&(z=1,se++),X(z),P(se),h(new Date(om(se),0))}},U=z=>{ee==="gregorian"?h(new Date(z,$)):(P(z),h(new Date(om(z),0)))},O=te();let V;ee==="gregorian"?V=c.toLocaleString("default",{month:"long"}):V=A[B-1]||`Month ${B}`;const Z=Array.from({length:20},(z,se)=>ee==="gregorian"?2015+se:1436+se),ie=ee==="gregorian"?F:G;return E.jsx("div",{style:{color:j?L.calendarText:N.textColor},className:"",children:E.jsxs("div",{className:`${I?"p-4":"p-4 md:p-6"} rounded-lg border`,style:{color:j?L.calendarText:N.prayerTimesColor.text,backgroundColor:j?L.calendarBg:N.prayerTimesColor.bg,direction:u==="ar"?"rtl":"ltr"},children:[E.jsx("h2",{className:`text-center font-bold ${I?"text-sm sm:text-base mb-4":"text-md md:text-lg mb-4"}`,children:s("HIJRI CALENDAR").toUpperCase()}),E.jsxs("div",{className:`flex justify-between items-center ${I?"mb-3 px-2":"mb-4 md:mb-6 md:px-4"}`,children:[E.jsx("select",{value:ie,onChange:z=>U(Number(z.target.value)),className:`border p-${I?"1":"2"} rounded ${I?"text-sm":"text-sm md:text-md font-semibold"}`,style:{backgroundColor:j?L.buttonBg:N.prayerTimesColor.text,color:j?L.buttonTextColor:N.prayerTimesColor.bg},children:Z.map(z=>E.jsx("option",{value:z,children:z},z))}),E.jsxs("div",{className:`flex items-center ${I?"gap-2":"gap-2 md:gap-4"}`,children:[E.jsx("button",{onClick:pe,className:`${I?"px-2":"md:px-2"}`,children:"<"}),E.jsx("span",{className:`font-semibold text-center ${I?"min-w-[80px] text-sm":"min-w-[60px] text-sm md:text-md"}`,children:s(V.toUpperCase())}),E.jsx("button",{onClick:Ne,className:`${I?"px-2":"md:px-2"}`,children:">"})]})]}),E.jsx("div",{className:`grid grid-cols-7 gap-1 text-center ${I?"mb-2 text-sm":"mb-2 md:mb-3 md:text-md"} font-semibold`,children:he.map(z=>E.jsx("div",{children:s(z)},z))}),E.jsx("div",{className:"grid grid-cols-7 gap-1 text-center",children:O.map((z,se)=>{const ge=z.fullDate.getDate()===d.getDate()&&z.fullDate.getMonth()===d.getMonth()&&z.fullDate.getFullYear()===d.getFullYear();return E.jsx("div",{onClick:()=>oe(z.fullDate,z.hijriObj),className:`${I?"p-1":"p-2"} rounded leading-none cursor-pointer ${ge?"font-bold":""} ${!z.currentMonth&&!ge?"opacity-90":""}`,style:{backgroundColor:ge?j?L.buttonBg:N.prayerTimesColor.text:"transparent",color:ge?j?L.buttonTextColor:N.prayerTimesColor.bg:z.currentMonth?j?L.calendarText:N.prayerTimesColor.text:j?`${L.calendarText}80`:`${N.prayerTimesColor.text}80`,lineHeight:"1"},children:u==="ar"?E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"text-[14px] leading-none",children:z.hijri??""}),E.jsx("div",{className:"text-[10px] leading-none",children:z.gregorian})]}):E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"text-[14px] leading-none",children:z.gregorian}),E.jsx("div",{className:"text-[10px] leading-none",children:z.hijri??""})]})},se)})}),E.jsxs("div",{className:`mt-4 gap-4 ${e?"flex justify-between items-center":"flex justify-end items-center"}`,children:[e&&E.jsxs("div",{className:`flex-1 text-center md:ml-${I?"20":"10"} lg:ml-${I?"20":"10"}`,children:[E.jsx("h2",{className:`${I?"text-sm":"text-sm md:text-md"} font-semibold`,children:d.toLocaleDateString("en-GB",{day:"numeric",month:"long",year:"numeric"})}),E.jsx("h2",{className:`${I?"text-sm":"text-sm md:text-md"} font-semibold`,children:y?zo({hijriDayObj:y,language:u,t:s,hijriMonthNames:A}):"-"})]}),E.jsx("button",{onClick:le,className:`${I?"px-3 py-1 text-sm":"px-2 py-1 text-sm md:text-md"} rounded-md font-semibold`,style:{backgroundColor:j?L.buttonBg:N.prayerTimesColor.text,color:j?L.buttonTextColor:N.prayerTimesColor.bg},children:s("TODAY")})]})]})})},pf=["Muharram","Safar","Rabi'ul Awwal","Rabi'ul Akhir","Jumadal Ula","Jumadal Akhira","Rajab","Sha'ban","Ramadan","Shawwal","Dhul Qa'ada","Dhul Hijja"];function qg({nr:t,isHome:e=!0}){const{i18n:n,t:r}=Ar(),a=n.language||"en",{colorScheme:s,date:l,setDate:u,setNextHijriDay:c,periodType:h,setPeriodType:d,periodFrom:m,periodTo:y,setPeriodFrom:g,setPeriodTo:x,hijriMonthNames:_}=vi(),[N,A]=D.useState(null),[j,L]=D.useState(null),[R,I]=D.useState(new Map),[ee,G]=D.useState(!1),[P,B]=D.useState(!1),[X,F]=D.useState(!1),$=s.textColor,K=s.isDefault,Y=D.useRef(null),he=D.useRef(null),te=D.useRef(null),oe=D.useRef(null),le=D.useRef(null),pe=D.useRef(null);D.useEffect(()=>{const z=se=>{ee&&Y.current&&!Y.current.contains(se.target)&&he.current&&!he.current.contains(se.target)&&(console.log("Clicked outside main calendar, closing..."),G(!1)),P&&te.current&&!te.current.contains(se.target)&&le.current&&!le.current.contains(se.target)&&(console.log("Clicked outside From calendar, closing..."),B(!1)),X&&oe.current&&!oe.current.contains(se.target)&&pe.current&&!pe.current.contains(se.target)&&(console.log("Clicked outside To calendar, closing..."),F(!1))};return document.addEventListener("mousedown",z),()=>{document.removeEventListener("mousedown",z)}},[ee,P,X]),D.useEffect(()=>{if(!l)return;const z=l.getFullYear(),se=new Date(z,0,1),ge=new Date(z,11,31),xe=se.toLocaleDateString("en-CA"),Re=ge.toLocaleDateString("en-CA");Dg(xe,Re).then(De=>{I(De);const qe=l.toLocaleDateString("en-CA"),Pe=De.get(qe);A(Pe||null),h==="Custom"&&L(Pe||null)}).catch(De=>{console.error("Failed to fetch Hijri dates for year:",De)})},[l,h]),D.useEffect(()=>{e&&d("Daily")},[e]),D.useEffect(()=>{if(l)if(h==="Daily")g(l),x(l);else if(h==="Weekly")g(l),x(new Date(l.getTime()+6*864e5));else if(h==="Monthly"){const z=new Date(l.getFullYear(),l.getMonth(),1),se=new Date(l.getFullYear(),l.getMonth()+1,0);g(z),x(se)}else h==="Custom"&&(g(l),x(l))},[l,h,g,x]),D.useEffect(()=>{if(!m||!y||!R.size)return;const z=m.toLocaleDateString("en-CA"),se=y.toLocaleDateString("en-CA"),ge=R.get(z);A(ge||null);const xe=R.get(se);if(L(xe||null),h==="Daily"){const Re=new Date(m);Re.setDate(Re.getDate()+1);const De=Re.toLocaleDateString("en-CA"),qe=R.get(De);c(qe||null)}else c(null)},[m,y,h,R,c]);const Ne=(z,se,ge=!0)=>{if(!z)return;const xe=z.toLocaleDateString("en-CA"),Re=R.get(xe)||se;h==="Custom"?ge?(g(z),A(Re||null),B(!1),y&&z>y&&(x(z),L(Re||null))):(m&&z<m?(x(m),L(N),g(z),A(Re||null)):(x(z),L(Re||null)),F(!1)):(u(z),A(Re||null),G(!1))};function U(){const z=e?"text-sm sm:text-base lg:text-lg":"text-xs sm:text-sm",se=e?"text-xs sm:text-sm lg:text-base":"text-xs sm:text-sm",ge=De=>{const qe=De.toLocaleString("en-US",{month:"long"}),Pe=r(qe.toUpperCase()),Ke=De.getDate(),ne=De.getFullYear();return a==="ar"?`${ne} ${Pe} ${Ke}`:`${Ke} ${Pe} ${ne}`},xe=(De,qe)=>{if(!De||!qe)return"Loading...";const Pe=De.toLocaleString("en-US",{month:"long"}),Ke=qe.toLocaleString("en-US",{month:"long"}),ne=r(Pe.toUpperCase()),We=r(Ke.toUpperCase()),it=De.getDate(),tt=qe.getDate(),Ve=De.getFullYear(),gt=qe.getFullYear();return a==="ar"?Ve===gt&&ne===We?`${Ve} ${ne} ${it} – ${tt}`:Ve===gt?`${Ve} ${ne} ${it} – ${We} ${tt}`:`${Ve} ${ne} ${it} – ${gt} ${We} ${tt}`:Ve===gt&&ne===We?`${it} – ${tt} ${ne} ${Ve}`:Ve===gt?`${it} ${ne} – ${tt} ${We} ${Ve}`:`${it} ${ne} ${Ve} – ${tt} ${We} ${gt}`},Re=(De,qe)=>{if(!De||!qe)return"-";const Pe=r(pf[De.hijri_date_month-1].toUpperCase()),Ke=r(pf[qe.hijri_date_month-1].toUpperCase()),ne=De.hijri_date_day,We=qe.hijri_date_day,it=De.hijri_date_year,tt=qe.hijri_date_year;return a==="ar"?it===tt&&Pe===Ke?`${it} ${Pe} ${ne} – ${We}`:it===tt?`${it} ${Pe} ${ne} – ${Ke} ${We}`:`${it} ${Pe} ${ne} – ${tt} ${Ke} ${We}`:it===tt&&Pe===Ke?`${ne} – ${We} ${Pe} ${it}`:it===tt?`${ne} ${Pe} – ${We} ${Ke} ${it}`:`${ne} ${Pe} ${it} – ${We} ${Ke} ${tt}`};if(h==="Daily")return E.jsxs(E.Fragment,{children:[E.jsx("div",{className:`font-medium ${z}`,style:{color:K?"":$},children:m?ge(m):"Loading..."}),E.jsx("div",{className:`font-medium ${se}`,style:{color:K?"":$},children:N&&_.length>0?zo({hijriDayObj:N,language:a,t:r,hijriMonthNames:_}):"-"})]});if(h==="Weekly")return E.jsxs(E.Fragment,{children:[E.jsx("div",{className:`font-medium ${z}`,style:{color:K?"":$},children:xe(m,y)}),E.jsx("div",{className:`font-medium ${se}`,style:{color:K?"":$},children:Re(N,j)})]});if(h==="Monthly")if(a==="ar"){const De=m?`${m.getFullYear()} ${r(m.toLocaleString("en-US",{month:"long"}).toUpperCase())}`:"Loading...";let qe="";if(N&&j){const Pe=r(pf[N.hijri_date_month-1].toUpperCase()),Ke=r(pf[j.hijri_date_month-1].toUpperCase()),ne=N.hijri_date_year;qe=Pe===Ke?`${Pe} ${ne}`:`${Pe} – ${Ke} ${ne}`}return E.jsxs(E.Fragment,{children:[E.jsx("div",{className:`font-medium ${z}`,style:{color:K?"":$},children:De}),E.jsx("div",{className:`font-medium ${se}`,style:{color:K?"":$},children:qe})]})}else{const De=m?`${r(m.toLocaleString("en-US",{month:"long"}).toUpperCase())} ${m.getFullYear()}`:"Loading...";let qe="";if(N&&j){const Pe=r(pf[N.hijri_date_month-1].toUpperCase()),Ke=r(pf[j.hijri_date_month-1].toUpperCase()),ne=N.hijri_date_year;qe=Pe===Ke?`${Pe} ${ne}`:`${Pe} – ${Ke} ${ne}`}return E.jsxs(E.Fragment,{children:[E.jsx("div",{className:`font-medium ${z}`,style:{color:K?"":$},children:De}),E.jsx("div",{className:`font-medium ${se}`,style:{color:K?"":$},children:qe||"-"})]})}else if(h==="Custom")return E.jsxs(E.Fragment,{children:[E.jsx("div",{className:`font-medium ${z}`,style:{color:K?"":$},children:xe(m,y)}),E.jsx("div",{className:`font-medium ${se}`,style:{color:K?"":$},children:Re(N,j)})]});return null}const O=()=>{if(l)if(h==="Monthly"){const z=new Date(l);z.setMonth(z.getMonth()-1),u(z)}else if(h==="Custom"){if(m){const z=new Date(m.getTime()-864e5);g(z),u(z),y.getTime()===m.getTime()&&x(z)}}else u(new Date(l.getTime()-1440*60*1e3))},V=()=>{if(l)if(h==="Monthly"){const z=new Date(l);z.setMonth(z.getMonth()+1),u(z)}else if(h==="Custom"){if(m){const z=new Date(m.getTime()+864e5);g(z),u(z),y.getTime()===m.getTime()&&x(z)}}else u(new Date(l.getTime()+1440*60*1e3))},Z=()=>{if(l){if(a==="ar"&&h==="Monthly"&&N){let z=N.hijri_date_month-1,se=N.hijri_date_year;z<1&&(z=12,se--);const ge=Math.floor(se*.9703+622);u(new Date(ge,0,1))}else{const z=new Date(l);z.setMonth(z.getMonth()-1),u(z)}if(h==="Custom"&&m){const z=new Date(m);z.setMonth(z.getMonth()-1),g(z),y.getTime()===m.getTime()&&x(z)}}},ie=()=>{if(l){if(a==="ar"&&h==="Monthly"&&N){let z=N.hijri_date_month+1,se=N.hijri_date_year;z>12&&(z=1,se++);const ge=Math.floor(se*.9703+622);u(new Date(ge,0,1))}else{const z=new Date(l);z.setMonth(z.getMonth()+1),u(z)}if(h==="Custom"&&m){const z=new Date(m);z.setMonth(z.getMonth()+1),g(z),y.getTime()===m.getTime()&&x(z)}}};return E.jsxs("div",{className:`flex items-center ${h==="Custom"?"justify-between gap-4 sm:gap-6 lg:gap-10":"justify-center gap-1 sm:gap-2 lg:gap-4"}`,children:[h==="Custom"?E.jsxs("div",{className:"flex flex-col gap-2 items-center w-full sm:w-auto",children:[E.jsxs("div",{className:"flex justify-between items-center w-full gap-2",children:[E.jsx("label",{className:`font-medium ${e?"text-xs sm:text-sm lg:text-base":"text-xs sm:text-sm"}`,style:{color:K?"":$},children:r("FROM")}),E.jsxs("div",{className:"relative flex items-center",children:[E.jsx("input",{type:"date",value:m?m.toLocaleDateString("en-CA"):"",onChange:z=>{const se=new Date(z.target.value);Ne(se,void 0,!0)},className:`text-black font-medium text-center rounded p-1 ${e?"h-6 sm:h-7 lg:h-8 w-24 sm:w-28 lg:w-32 text-xs sm:text-sm lg:text-base":"h-5 sm:h-6 w-24 lg:w-26 sm:w-24 text-xs sm:text-sm"} ${t===7?"bg-white":t===8?"bg-[#F0BB78]":"bg-[#E5D0AC]"}`,style:{backgroundColor:K?"":$}}),E.jsx("button",{ref:le,className:"ml-1 sm:ml-2 text-sm sm:text-base lg:text-lg p-1 sm:p-1.5 lg:p-2 transition","aria-label":"Open From calendar",type:"button",onClick:()=>B(!P),children:E.jsx(R1,{color:K?"":$,size:24})}),P&&E.jsx("div",{ref:te,className:"absolute bg-white border border-gray-300 shadow-md rounded-md z-10 w-60 h-64 sm:w-64 sm:h-auto",style:{top:"100%",left:0},children:E.jsx(Cm,{showDate:!1,initialDate:m||l,onDateSelect:(z,se)=>Ne(z,se,!0)})})]})]}),E.jsxs("div",{className:"flex justify-between items-center w-full gap-2",children:[E.jsx("label",{className:`font-medium ${e?"text-xs sm:text-sm lg:text-base":"text-xs sm:text-sm"} ${t===7?"text-white":t===8?"text-[#543A14]":"text-[#E5D0AC]"}`,style:{color:K?"":$},children:r("TO")}),E.jsxs("div",{className:"relative flex items-center",children:[E.jsx("input",{type:"date",value:y?y.toLocaleDateString("en-CA"):"",min:m?m.toLocaleDateString("en-CA"):"",onChange:z=>{const se=new Date(z.target.value);Ne(se,void 0,!1)},className:`text-black font-medium text-center rounded p-1 ${e?"h-6 sm:h-7 lg:h-8 w-24 sm:w-28 lg:w-32 text-xs sm:text-sm lg:text-base":"h-5 sm:h-6 w-24 lg:w-26 sm:w-24 text-xs sm:text-sm"} ${t===7?"bg-white":t===8?"bg-[#F0BB78]":"bg-[#E5D0AC]"}`,style:{backgroundColor:K?"":$}}),E.jsx("button",{ref:pe,className:"ml-1 sm:ml-2 text-sm sm:text-base lg:text-lg p-1 sm:p-1.5 lg:p-2 transition","aria-label":"Open To calendar",type:"button",onClick:()=>F(!X),children:E.jsx(R1,{color:K?"":$,size:24})}),X&&E.jsx("div",{ref:oe,className:"absolute bg-white border border-gray-300 shadow-md rounded-md z-10 w-60 h-64 sm:w-64 sm:h-auto",style:{top:"100%",left:0},children:E.jsx(Cm,{showDate:!1,initialDate:y||l,onDateSelect:(z,se)=>Ne(z,se,!1)})})]})]})]}):E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:`flex items-center ${e?"gap-1 sm:gap-2 lg:gap-4":"gap-0.5 sm:gap-1"}`,children:[e&&E.jsx("button",{onClick:Z,className:`rounded-md transition flex items-center justify-center ${e?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${t===7?"text-[#3A7D44] bg-white hover:bg-white/80":t===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:K?"":$},"aria-label":"Previous month",type:"button",children:E.jsx(EP,{})}),E.jsx("button",{onClick:O,className:`rounded-md transition flex items-center justify-center ${e?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${t===7?"text-[#3A7D44] bg-white hover:bg-white/80":t===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:K?"":$},"aria-label":"Previous period",type:"button",children:E.jsx(SP,{})}),E.jsx("div",{className:"flex flex-col items-center justify-center flex-1",children:U()}),E.jsx("button",{onClick:V,className:`rounded-md transition flex items-center justify-center ${e?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${t===7?"text-[#3A7D44] bg-white hover:bg-white/80":t===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:K?"":$},"aria-label":"Next period",type:"button",children:E.jsx(xP,{})}),e&&E.jsx("button",{onClick:ie,className:`rounded-md transition flex items-center justify-center ${e?"text-xs sm:text-sm lg:text-base w-6 sm:w-8 lg:w-10 h-6 sm:h-8 lg:h-10":"text-xs sm:text-sm w-5 sm:w-6 h-5 sm:h-6"} ${t===7?"text-[#3A7D44] bg-white hover:bg-white/80":t===8?"text-[#FFF0DC] bg-[#543A14] hover:bg-black/60":"text-[#6D2323] bg-[#E5D0AC] hover:bg-white/80"}`,style:{backgroundColor:K?"":$},"aria-label":"Next month",type:"button",children:E.jsx(_P,{})})]}),E.jsxs("div",{className:"relative",children:[E.jsx("button",{ref:he,className:"text-sm sm:text-base lg:text-lg p-1 sm:p-1.5 lg:p-2 transition flex items-center justify-center","aria-label":"Open calendar",type:"button",tabIndex:0,onClick:()=>G(!ee),children:E.jsx(R1,{color:K?"":$,size:24})}),ee&&E.jsx("div",{ref:Y,className:"absolute bg-white border border-gray-300 shadow-md rounded-md z-10 w-60 h-64 sm:w-64 sm:h-auto",style:{top:"100%",right:0},children:E.jsx(Cm,{showDate:!1,initialDate:l,onDateSelect:(z,se)=>Ne(z,se,!0)})})]})]}),!e&&E.jsx("div",{className:"",children:E.jsxs("select",{value:h,className:`rounded-sm focus:outline-none ${e?"text-xs sm:text-sm lg:text-base p-1":"text-xs sm:text-sm p-0.5 sm:p-1"} text-black ${t===7?"bg-white":t===8?"bg-[#F0BB78]":"bg-[#E5D0AC]"}`,style:{color:K?"":s.bgColor,backgroundColor:K?"":$},onChange:z=>d(z.target.value),children:[E.jsx("option",{value:"Daily",children:r("DAILY")}),E.jsx("option",{value:"Weekly",children:r("WEEKLY")}),E.jsx("option",{value:"Monthly",children:r("MONTHLY")}),E.jsx("option",{value:"Custom",children:r("CUSTOM")})]})})]})}function qE(t){return Na({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM14.657 2.929a1 1 0 011.414 0A9.972 9.972 0 0119 10a9.972 9.972 0 01-2.929 7.071 1 1 0 01-1.414-1.414A7.971 7.971 0 0017 10c0-2.21-.894-4.208-2.343-5.657a1 1 0 010-1.414zm-2.829 2.828a1 1 0 011.415 0A5.983 5.983 0 0115 10a5.984 5.984 0 01-1.757 4.243 1 1 0 01-1.415-1.415A3.984 3.984 0 0013 10a3.983 3.983 0 00-1.172-2.828 1 1 0 010-1.415z",clipRule:"evenodd"},child:[]}]})(t)}function HE(t){return Na({attr:{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},child:[{tag:"path",attr:{fillRule:"evenodd",d:"M9.383 3.076A1 1 0 0110 4v12a1 1 0 01-1.707.707L4.586 13H2a1 1 0 01-1-1V8a1 1 0 011-1h2.586l3.707-3.707a1 1 0 011.09-.217zM12.293 7.293a1 1 0 011.414 0L15 8.586l1.293-1.293a1 1 0 111.414 1.414L16.414 10l1.293 1.293a1 1 0 01-1.414 1.414L15 11.414l-1.293 1.293a1 1 0 01-1.414-1.414L13.586 10l-1.293-1.293a1 1 0 010-1.414z",clipRule:"evenodd"},child:[]}]})(t)}const VE=t=>{const[e,n]=D.useState({}),[r,a]=D.useState(!0),[s,l]=D.useState(null),u=["fajr","dhuhr","asr","maghrib","isha","jumuah"],c=async()=>{a(!0),l(null);try{const{data:h,error:d}=await ot.from("adhan_audio").select("fajr, dhuhr, asr, maghrib, isha, jumuah").eq("mosque_id",t||"982842840").maybeSingle();if(d&&d.code!=="PGRST116")throw new Error(d.message||"Failed to fetch audio sources");const m={};h&&u.forEach(y=>{const g=h[y];if(g&&typeof g=="string"){const x=g.split("/").pop()||`${y}.mp3`;m[y]={src:g,fileName:x,type:"upload",media:"audio"}}}),n(m)}catch(h){const d=h instanceof Error?h.message:"Unknown error occurred";l(d),console.error("Fetch adhan audio error:",d)}finally{a(!1)}};return D.useEffect(()=>{if(!t){a(!1);return}a(!0),c();const h=ot.channel("adhan_audio_changes").on("postgres_changes",{event:"*",schema:"public",table:"adhan_audio",filter:`mosque_id=eq.${t}`},()=>{c()}).subscribe();return()=>{ot.removeChannel(h)}},[t]),{audioSources:e,loading:r,error:s}};/*! js-cookie v3.0.8 | MIT */function lm(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)r!=="__proto__"&&(t[r]=n[r])}return t}var DU={read:function(t){return t[0]==='"'&&(t=t.slice(1,-1)),t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(t){return encodeURIComponent(t).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function hy(t,e){function n(a,s,l){if(!(typeof document>"u")){l=lm({},e,l),typeof l.expires=="number"&&(l.expires=new Date(Date.now()+l.expires*864e5)),l.expires&&(l.expires=l.expires.toUTCString()),a=encodeURIComponent(a).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var u="";for(var c in l)l[c]&&(u+="; "+c,l[c]!==!0&&(u+="="+l[c].split(";")[0]));return document.cookie=a+"="+t.write(s,a)+u}}function r(a){if(!(typeof document>"u"||arguments.length&&!a)){for(var s=document.cookie?document.cookie.split("; "):[],l={},u=0;u<s.length;u++){var c=s[u].split("="),h=c.slice(1).join("=");try{var d=decodeURIComponent(c[0]);if(d in l||(l[d]=t.read(h,d)),a===d)break}catch{}}return a?l[a]:l}}return Object.create({set:n,get:r,remove:function(a,s){n(a,"",lm({},s,{expires:-1}))},withAttributes:function(a){return hy(this.converter,lm({},this.attributes,a))},withConverter:function(a){return hy(lm({},this.converter,a),this.attributes)}},{attributes:{value:Object.freeze(e)},converter:{value:Object.freeze(t)}})}var fg=hy(DU,{path:"/"});const NS=t=>{const e=new Date,[n,r]=t.split(":").map(Number),a=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n,r),s=(e.getTime()-a.getTime())/1e3;return s>=0&&s<=1},CS=t=>{const e=new Date,n=t.iqamah||t.adhan,[r,a]=n.split(":").map(Number),l=(new Date(e.getFullYear(),e.getMonth(),e.getDate(),r,a).getTime()-e.getTime())/1e3;if(l<=0)return"Now";const u=Math.floor(l/60),c=Math.floor(l%60);return`${u}m ${c}s`},PU=({prayerTimesColor:t})=>{const{language:e,prayerTimesWithSunrise:n,extraInfo:r,org_nr:a,nextHijriDay:s,hijriMonthNames:l}=vi(),{t:u}=Ar(),{audioSources:c,loading:h,error:d}=VE(a),[m,y]=D.useState(null),[g,x]=D.useState(!1),[_,N]=D.useState(null),[A,j]=D.useState(""),[L,R]=D.useState([]),I=D.useRef(null),[ee,G]=D.useState(null),[P,B]=D.useState(!1),[X,F]=D.useState(()=>{const U={},O=fg.get("volumeStates"),V=O?JSON.parse(O):{};return n.forEach((Z,ie)=>{U[ie]=V[ie]!==void 0?V[ie]:!1}),U});D.useEffect(()=>{fg.set("volumeStates",JSON.stringify(X),{expires:365})},[X]);const $=/iphone|ipad|ipod/i.test(window.navigator.userAgent),K=()=>window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone,Y=typeof window<"u"&&"Notification"in window;D.useEffect(()=>{$&&!K()&&B(!0)},[$]),D.useEffect(()=>{if($&&!K()){console.log("Skip notification request — iPhone must add to Home Screen first");return}if(!Y){console.log("Notifications are not supported in this browser");return}Notification.permission==="default"&&Notification.requestPermission()},[$,Y]),D.useEffect(()=>{const U=new Date,O=new Date(U.getFullYear(),U.getMonth(),U.getDate()+1,0,0,0).getTime()-U.getTime(),V=setTimeout(()=>{R([]),console.log("Reset triggered prayers at midnight")},O);return()=>clearTimeout(V)},[]),D.useEffect(()=>{if(!g||!_)return;const U=setInterval(()=>{const O=CS(_);j(O),O==="Now"&&(x(!1),N(null),clearInterval(U))},1e3);return()=>clearInterval(U)},[g,_]),D.useEffect(()=>{if(h||d||!n)return;const U=setInterval(()=>{n.forEach((O,V)=>{const Z=O.name.toLowerCase();if(O.name!=="Fajr end"&&!X[V]&&NS(O.adhan)&&ee!==O.name&&!L.includes(O.name)){const ie=c[Z];console.log(`Attempting to play ${Z} audio:`,{audioSource:ie==null?void 0:ie.src}),ie!=null&&ie.src?(I.current&&(I.current.pause(),I.current.currentTime=0),I.current=new Audio(ie.src),I.current.play().catch(z=>console.error(`Error playing ${Z} audio:`,z)),y(Z),G(O.name),I.current.onended=()=>{y(null),G(null),I.current=null}):console.warn(`No audio source for ${Z}`),R(z=>[...z,O.name])}})},1e3);return()=>clearInterval(U)},[n,c,X,ee,h,d,L]),D.useEffect(()=>{if(h||d||!n)return;const U=setInterval(()=>{n.forEach(O=>{O.name!=="Fajr end"&&NS(O.adhan)&&!L.includes(O.name)&&(Y&&Notification.permission==="granted"&&(console.log(`Triggering notification for prayer: ${O.name}`),new Notification(`${u(O.name)} Iqamah Time ${O.iqamah||O.adhan} Arrive On Time`)),x(!0),N(O),j(CS(O)),R(V=>[...V,O.name]))})},1e3);return()=>clearInterval(U)},[n,h,d,L,u,Y]);const he=()=>{I.current&&(I.current.pause(),I.current.currentTime=0,I.current=null,y(null),G(null))},te=U=>{F(O=>({...O,[U]:!O[U]}))},oe=()=>{x(!1),N(null)};function le(U){return U?U.startsWith("linear-gradient")||U.startsWith("radial-gradient")?{backgroundImage:U,color:t.text}:{backgroundColor:U,color:t.text}:{}}const pe=le(t.bg),Ne=e==="ar";return E.jsxs("div",{className:"w-full mx-auto font-DM py-2 sm:py-4",dir:Ne?"rtl":"ltr",children:[h&&E.jsx("div",{className:"p-4 text-center",children:"Loading..."}),d&&E.jsx("div",{className:"p-4 text-center text-red-600",children:d}),!h&&!d&&E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"flex justify-between text-sm sm:text-base items-center py-1 px-4",children:[E.jsx("div",{className:`${a?"w-[40%]":"w-1/2"}`}),E.jsx("div",{className:`${a?"w-1/5":"w-full"} text-center font-medium`,children:u("ADHAN")}),a&&E.jsx("div",{className:"w-1/5 text-center font-medium",children:u("JAMAAT")}),a&&E.jsxs("div",{className:"w-1/5 text-center font-medium",children:[E.jsx("span",{className:"block sm:hidden",children:u("TMRW")}),E.jsx("span",{className:"hidden sm:block",children:u("TOMORROW")})]})]}),E.jsx("div",{className:"p-[1px] rounded-lg bg-gradient-to-br from-white to-[#807E7E57]",children:E.jsxs("div",{className:"py-2 sm:px-4 rounded-lg backdrop-blur-md",style:pe,children:[n==null?void 0:n.map((U,O)=>E.jsxs(vn.Fragment,{children:[E.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[E.jsxs("div",{className:`${a?"w-[40%]":"w-1/2"} flex items-center justify-between`,children:[E.jsx("span",{className:"sm:text-lg font-semibold",children:U.name==="Fajr end"?E.jsx(jd,{color:"orange",size:28}):u(U.name.toUpperCase())}),U.name!=="Fajr end"&&E.jsxs("div",{className:"flex items-center",children:[m===U.name.toLowerCase()&&E.jsx("button",{type:"button",className:"mr-2 w-6 h-6 bg-red-500 rounded-full focus:outline-none",onClick:he}),E.jsx("button",{type:"button",className:"ml-2 focus:outline-none","aria-label":X[O]?"Mute":"Unmute",onClick:()=>te(O),children:X[O]?E.jsx(HE,{}):E.jsx(qE,{})})]})]}),E.jsx("div",{className:`${a?"w-1/5":"w-full"} sm:text-lg text-center font-semibold`,children:U.adhan}),a&&E.jsx("div",{className:"w-1/5 text-center sm:text-lg font-semibold",children:U.iqamah}),a&&E.jsx("div",{className:"w-1/5 text-center sm:text-lg font-semibold",children:U.tomorrow})]}),O===4&&E.jsx("div",{className:`text-sm font-semibold p-3 ${Ne?"text-right":""}`,children:s?zo({hijriDayObj:s,language:e,t:u,hijriMonthNames:l}):" "})]},O)),a&&E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"border-b py-1 sm:py-2"}),E.jsxs("div",{className:"flex flex-col gap-4 items-center justify- shadow- rounded- px-3 py-4",children:[E.jsxs("div",{className:"flex w-full",children:[E.jsx("div",{className:"w-1/4 md:w-2/5"}),[1,2,3].map(U=>E.jsxs("div",{className:"w-1/4 md:w-1/5 text-center text-sm sm:text-base ",children:[u("JAMAAT")," ",U]},U))]}),r.filter(U=>U.label==="Eid"?Array.isArray(U.time)&&U.time.some(O=>O&&O.trim()!==""):!0).map(U=>E.jsxs("div",{className:"flex w-full",children:[E.jsx("div",{className:"w-1/4 md:w-2/5 md:text-lg font-semibold",children:u(U==null?void 0:U.label.toUpperCase())}),Array.isArray(U.time)?[0,1,2].map(O=>E.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-semibold ",children:U.time[O]||"_"},O)):E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-semibold ",children:U.time}),E.jsx("div",{className:"w-1/4 md:w-1/5"}),E.jsx("div",{className:"w-1/4 md:w-1/5"})]})]},U==null?void 0:U.label))]})]})]})})]}),g&&_&&E.jsxs("div",{className:"fixed bottom-4 right-4 text-black text-lg bg-white p-4 rounded shadow-lg z-50",children:[E.jsxs("p",{children:[u(_.name)," Iqamah Time Within: ",A]}),E.jsx("button",{className:"mt-2 bg-blue-500 text-white px-2 py-1 rounded",onClick:oe,children:"Close"})]}),P&&E.jsxs("div",{className:"fixed bottom-5 left-1/2 -translate-x-1/2 bg-white shadow-xl border p-3 rounded-lg text-center z-50 w-[90%] max-w-[400px]",children:[E.jsx("p",{className:"font-semibold mb-2",children:"To receive Adhan Notifications"}),E.jsxs("p",{className:"text-sm mb-2",children:["Please ",E.jsx("b",{children:"add this app to your Home Screen"}),"."]}),E.jsxs("p",{className:"text-xs",children:["Tap ",E.jsx("b",{children:"Share → Add to Home Screen"})]}),E.jsx("button",{className:"mt-3 px-3 py-1 text-sm rounded bg-blue-600 text-white",onClick:()=>B(!1),children:"OK"})]})]})},MU=()=>{const t=()=>new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1}),[e,n]=D.useState(t());return D.useEffect(()=>{const r=setInterval(()=>{n(t())},1e3);return()=>clearInterval(r)},[]),E.jsx("div",{className:"w-full flex justify-center font-bold text-4xl mt-6 sm:mt-4",children:e})},TS=t=>{const e=new Date,[n,r]=t.split(":").map(Number),a=new Date(e.getFullYear(),e.getMonth(),e.getDate(),n,r),s=(e.getTime()-a.getTime())/1e3;return s>=0&&s<=1},LS=t=>{const e=new Date,n=t.iqamah||t.adhan,[r,a]=n.split(":").map(Number),l=(new Date(e.getFullYear(),e.getMonth(),e.getDate(),r,a).getTime()-e.getTime())/1e3;if(l<=0)return"Now";const u=Math.floor(l/60),c=Math.floor(l%60);return`${u}m ${c}s`},GE=({prayerTimesColor:t})=>{const{t:e}=Ar(),{language:n,prayerTimesWithSunrise:r,extraInfo:a,org_nr:s,nextHijriDay:l,hijriMonthNames:u}=vi(),c=n==="ar",{audioSources:h,loading:d,error:m}=VE(s),[y,g]=D.useState(null),[x,_]=D.useState(!1),[N,A]=D.useState(null),[j,L]=D.useState(""),[R,I]=D.useState([]),ee=D.useRef(null),[G,P]=D.useState(null),[B,X]=D.useState(!1),[F,$]=D.useState(()=>{const U={},O=fg.get("volumeStates"),V=O?JSON.parse(O):{};return r.forEach((Z,ie)=>{U[ie]=V[ie]!==void 0?V[ie]:!1}),U});D.useEffect(()=>{fg.set("volumeStates",JSON.stringify(F),{expires:365})},[F]);const K=/iphone|ipad|ipod/i.test(window.navigator.userAgent),Y=()=>window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone,he=typeof window<"u"&&"Notification"in window;D.useEffect(()=>{K&&!Y()&&X(!0)},[K]),D.useEffect(()=>{if(K&&!Y()){console.log("Skip notification request — iPhone must add to Home Screen first");return}if(!he){console.log("Notifications are not supported in this browser");return}Notification.permission==="default"&&Notification.requestPermission()},[K,he]),D.useEffect(()=>{const U=new Date,O=new Date(U.getFullYear(),U.getMonth(),U.getDate()+1,0,0,0).getTime()-U.getTime(),V=setTimeout(()=>{I([]),console.log("Reset triggered prayers at midnight")},O);return()=>clearTimeout(V)},[]),D.useEffect(()=>{if(!x||!N)return;const U=setInterval(()=>{const O=LS(N);L(O),O==="Now"&&(_(!1),A(null),clearInterval(U))},1e3);return()=>clearInterval(U)},[x,N]),D.useEffect(()=>{if(d||m||!r)return;const U=setInterval(()=>{r.forEach((O,V)=>{const Z=O.name.toLowerCase();if(O.name!=="Fajr end"&&!F[V]&&TS(O.adhan)&&G!==O.name&&!R.includes(O.name)){const ie=h[Z];console.log(`Attempting to play ${Z} audio:`,{audioSource:ie==null?void 0:ie.src}),ie!=null&&ie.src?(ee.current&&(ee.current.pause(),ee.current.currentTime=0,console.log(`Stopped previous audio for ${G}`)),ee.current=new Audio(ie.src),ee.current.play().then(()=>{console.log(`Playing ${Z} audio`),g(Z),P(O.name),I(z=>[...z,O.name])}).catch(z=>console.error(`Error playing ${Z} audio:`,z)),ee.current.onended=()=>{console.log(`Audio ended for ${O.name}`),g(null),P(null),ee.current=null}):(console.warn(`No audio source for ${Z}`),I(z=>[...z,O.name]))}})},1e3);return()=>clearInterval(U)},[r,h,F,G,d,m,R]),D.useEffect(()=>{if(d||m||!r)return;const U=setInterval(()=>{r.forEach(O=>{O.name!=="Fajr end"&&TS(O.adhan)&&!R.includes(O.name)&&(he&&Notification.permission==="granted"&&new Notification(`${e(O.name)} Iqamah Time ${O.iqamah||O.adhan} Arrive On Time`),_(!0),A(O),L(LS(O)),I(V=>[...V,O.name]))})},1e3);return()=>clearInterval(U)},[r,d,m,R,e,he]);const te=()=>{ee.current&&(ee.current.pause(),ee.current.currentTime=0,ee.current=null,g(null),P(null),console.log("Audio stopped by user"))},oe=U=>{console.log(`Toggling volume for prayer index ${U}: ${!F[U]}`),$(O=>({...O,[U]:!O[U]}))},le=()=>{_(!1),A(null),console.log("Popup closed by user")};function pe(U){return U?U.startsWith("linear-gradient")||U.startsWith("radial-gradient")?{backgroundImage:U,color:t.text}:{backgroundColor:U,color:t.text}:{}}const Ne=pe(t.bg);return E.jsxs("div",{className:"min-w-[300px] mx-auto font-DM",style:{direction:c?"rtl":"ltr"},children:[d&&E.jsx("div",{className:"p-4 text-center",children:"Loading..."}),m&&E.jsx("div",{className:"p-4 text-center text-red-600",children:m}),!d&&!m&&r&&E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"flex justify-between items-center px-2 py-2",children:[E.jsx("div",{className:"w-[35%] items-center justify-between"}),E.jsx("div",{className:`${s?"w-1/5":"w-full"} text-center font-medium`,children:e("ADHAN")}),s&&E.jsx("div",{className:"w-1/5 text-center font-medium",children:e("JAMAAT")}),s&&E.jsx("div",{className:"w-1/5 text-center font-medium",children:e("TMRW")})]}),r.map((U,O)=>{var V;return E.jsxs(vn.Fragment,{children:[E.jsxs("div",{className:"flex items-center justify-between border shadow-md rounded-xl px-3 py-4 mb-2 backdrop-blur-md",style:Ne,children:[E.jsxs("div",{className:"w-[35%] flex items-center justify-between",children:[E.jsx("span",{className:"md:text-lg font-medium",children:U.name==="Fajr end"?E.jsx(jd,{color:"orange",size:28}):e(U.name.toUpperCase())}),U.name!=="Fajr end"&&E.jsxs("div",{className:"flex items-center",children:[y===U.name.toLowerCase()&&E.jsx("button",{type:"button",className:"mr-2 w-6 h-6 bg-red-500 rounded-full focus:outline-none",onClick:te}),E.jsx("button",{type:"button",className:"focus:outline-none","aria-label":F[O]?"Mute":"Unmute",onClick:()=>oe(O),children:F[O]?E.jsx(HE,{}):E.jsx(qE,{})})]})]}),E.jsx("div",{className:`${s?"w-1/5":"w-full"} text-center md:text-lg font-medium`,children:U.name==="Sunrise"?(V=a[1])==null?void 0:V.time:U.adhan}),s&&E.jsx("div",{className:"w-1/5 text-center md:text-lg font-medium",children:U.iqamah}),s&&E.jsx("div",{className:"w-1/5 text-center md:text-lg font-medium",children:U.tomorrow})]}),O===4&&E.jsx("div",{className:`m-2 text-sm font-medium ${c?"text-right":"text-left"}`,children:l&&u.length>0?zo({hijriDayObj:l,language:n,t:e,hijriMonthNames:u}):" "})]},O)}),s&&E.jsxs("div",{className:"flex flex-col gap-4 border shadow-md rounded-xl px-3 py-4 mt-10 backdrop-blur-md",style:Ne,children:[E.jsxs("div",{className:"flex w-full",children:[E.jsx("div",{className:`w-1/4 md:w-2/5 ${c?"text-right":"text-left"}`}),[1,2,3].map(U=>E.jsxs("div",{className:"w-1/4 md:w-1/5 text-center text-sm md:text-base",children:[e("JAMAAT")," ",U]},U))]}),a.filter(U=>U.label==="Eid"?Array.isArray(U.time)&&U.time.some(O=>O&&O.trim()!==""):!0).map(U=>E.jsxs("div",{className:"flex w-full",children:[E.jsx("div",{className:`w-1/4 md:w-2/5 md:text-lg font-medium ${c?"text-right":"text-left"}`,children:e(U.label.toUpperCase())}),Array.isArray(U.time)?[0,1,2].map(O=>E.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-medium",children:U.time[O]||"_"},O)):E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"w-1/4 md:w-1/5 text-center text-lg font-medium",children:U.time}),E.jsx("div",{className:"w-1/4 md:w-1/5 text-lg font-medium"}),E.jsx("div",{className:"w-1/4 md:w-1/5 text-lg font-medium"})]})]},U.label))]})]}),x&&N&&E.jsxs("div",{className:"fixed bottom-4 right-4 text-black text-lg bg-white p-4 rounded shadow-lg z-50",children:[E.jsxs("p",{children:[e(N.name)," Iqamah Time Within: ",j]}),E.jsx("button",{className:"mt-2 bg-blue-500 text-white px-2 py-1 rounded",onClick:le,children:"Close"})]}),B&&E.jsxs("div",{className:"fixed bottom-5 left-1/2 -translate-x-1/2 bg-white shadow-xl border p-3 rounded-lg text-center z-50 w-[90%] max-w-[400px]",children:[E.jsx("p",{className:"font-semibold mb-2",children:"To receive Adhan Notifications"}),E.jsxs("p",{className:"text-sm mb-2",children:["Please ",E.jsx("b",{children:"add this app to your Home Screen"}),"."]}),E.jsxs("p",{className:"text-xs",children:["Tap ",E.jsx("b",{children:"Share → Add to Home Screen"})]}),E.jsx("button",{className:"mt-3 px-3 py-1 text-sm rounded bg-blue-600 text-white",onClick:()=>X(!1),children:"OK"})]})]})},IU={7:{container:"font-DM py-10",item:"bg-[#255F38] p-3 rounded-md min-w-[200px] text-left flex-col justify-center"},8:{container:"font-montserrat py-4 sm:py-6 w-full",item:"bg-[#F0BB78] p-3 rounded-md text-left min-w-[200px] text-xs font-medium transition",heading:"text-xl font-bold mb-2",subheading:"text-xs sm:text-sm"},9:{container:"font-onest py-4 sm:py-6 w-full hover:cursor-pointer",item:"bg-[#FEF9E1]/10 border border-white p-3 min-w-[200px] rounded-md text-xs text-white hover:bg-[#581a1a] transition",heading:"text-xl font-bold mb-2",subheading:"text-xs sm:text-sm"}},WE=({tn:t=7,prayerTimesColor:e})=>{const{i18n:n,t:r}=Ar(),a=n.language,s=Bi(),{colorScheme:l,events:u,selectedMosque:c,hijriMonthNames:h}=vi(),d=IU[t],m=l.isDefault,[y,g]=D.useState(new Map);return D.useEffect(()=>{if(!u||u.length===0)return;const x=u.map(I=>new Date(I.date)),_=new Date(Math.min(...x.map(I=>I.getTime()))),N=new Date(Math.max(...x.map(I=>I.getTime()))),A=new Date(_.getFullYear(),0,1),j=new Date(N.getFullYear(),11,31),L=A.toLocaleDateString("en-CA"),R=j.toLocaleDateString("en-CA");Dg(L,R).then(I=>{g(I)}).catch(I=>{console.error("Failed to fetch Hijri dates for events:",I)})},[u]),E.jsx("div",{className:d.container,onClick:()=>s(`/${(c==null?void 0:c.value)||982842840}/events`),children:E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"flex justify-between items-center mb-3",children:[E.jsx("h2",{className:"text-sm sm:text-base font-semibold sm:font-bold",children:r("EVENTS & CALENDAR").toUpperCase()}),E.jsx(xg,{className:"text-xs font-medium hover:underline",to:`/${(c==null?void 0:c.value)||982842840}/events`,children:r("SEE ALL")})]}),E.jsx("div",{className:"w-full h-24 rounded-md overflow-x-auto flex gap-4 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",style:{color:e.text},children:u.length===0?E.jsx("div",{className:`${d.item} flex items-center justify-center h-full w-full`,style:{color:e.text,backgroundColor:m?"":e.bg},children:E.jsx("p",{className:"text-sm sm:text-base font-bold",children:"No events found"})}):u.slice(0,3).map((x,_)=>{const N=new Date(x.date);let A;if(a==="ar"){const j=N.toLocaleDateString("en-CA"),L=y.get(j);A=L?zo({hijriDayObj:L,language:a,t:r,hijriMonthNames:h}):"Loading..."}else A=N.toLocaleDateString("en-US",{month:"long",day:"numeric"}),A=A.split(" ")[0].toUpperCase()+" "+A.split(" ")[1];return E.jsxs("div",{className:d.item,style:{color:e.text,backgroundColor:m?"":e.bg},children:[E.jsx("p",{className:"text-sm sm:text-base font-extrabold",children:A}),E.jsx("p",{className:"text-[10px] sm:text-xs font-bold mt-1 leading-tight",children:x.description})]},_)})})]})})},FU={7:{container:"font-DM",card:"bg-[#255F38] p-3 rounded-md flex flex-col justify-start h-32 relative",heading:"py-1",subheading:"text-xs sm:text-sm font-light mt-1",button:"absolute bottom-4 right-5 bg-white text-[#27391C] text-[11px] sm:text-xs px-3 py-2 rounded hover:bg-gray-100"},8:{container:"font-montserrat w-full",card:"p-6 rounded-md flex flex-col bg-[#F0BB78] justify- h-38 relative",heading:"py-1",subheading:"text-xs sm:text-sm font-light mt-1",button:"absolute bottom-4 right-5 text-[#FFFFFF] text-[11px] sm:text-xs px-3 py-2 rounded-md hover:bg-gray-"},9:{container:"font-onest hover:cursor-pointer",card:"p-4 bg-[#FEF9E1]/10 flex flex-col rounded-lg border border-white relative",heading:"",subheading:"py-5 text-xs sm:text-sm"}},YE=({tn:t,prayerTimesColor:e})=>{const n=FU[t],{t:r}=Ar(),a=Bi(),{colorScheme:s,selectedMosque:l}=vi(),u=s.isDefault;return E.jsx("div",{className:n.container,onClick:t===9?()=>a(`/${(l==null?void 0:l.value)||982842840}/view-timetable`):void 0,children:E.jsxs("div",{className:n.card,style:{backgroundColor:u?n.card:e.bg,color:e.text},children:[E.jsx("h2",{className:`font-bold sm:text-lg ${n.heading}`,children:r("CREATE YOUR PRAYER TIMETABLE")}),E.jsxs("div",{className:"flex items-center justify-between pr-4",children:[E.jsx("p",{className:n.subheading,children:r("VIEW AND DOWNLOAD YOUR CUSTOM PRAYER TIMETABLE")}),t===9&&E.jsx(Yy,{className:"",size:50})]}),t!==9&&E.jsxs(xg,{className:n.button,to:`/${(l==null?void 0:l.value)||982842840}/view-timetable`,style:{color:u?n.button:e.bg,backgroundColor:e.text},children:[r("VIEW FULL CALENDAR")," >"]})]})})},UU={BackgroundDiv:t=>{const{className:e,style:n}=t;return E.jsx("div",{className:e,style:n})},Header:Ud,MasjidSelect:$E,DateSelector:qg,PrayerTable:PU,MasjidPrayerClock:Id,Time:MU,PrayerTableTab:GE,EventCard:WE,CreatePrayerTimetableCard:YE,AnnouncementBar:Ky};function dy({components:t,componentProps:e={}}){return E.jsx(E.Fragment,{children:t.map((n,r)=>{var s,l;const a=UU[n.type];if(a){const u={...n.props||{},...e};let c={};if((s=n.style)!=null&&s.backgroundImage){const h=n.style.backgroundImage,m="https://irn-api.bonnetider.eu/storage/v1/object/public"+h,y=n.style.backgroundRepeat,g=n.style.backgroundOpacity;c=h?{backgroundImage:`url(${m})`,backgroundSize:y?"":"cover",backgroundPosition:"center",backgroundRepeat:y?"repeat":"no-repeat",opacity:g||1,filter:y?"":"blur(8px)"}:{}}else(l=n.style)!=null&&l.backgroundColor&&(c={...n.style});return E.jsx("div",{className:n.className||"",style:c,children:E.jsx(a,{...u})},r)}else{if(n.components&&n.gridConfig)return E.jsx("div",{className:`${n.gridConfig.className||""} ${n.className||""}`,style:n.gridConfig.style,children:E.jsx(dy,{components:n.components,componentProps:e})},r);if(n.components){let u={};return n.type==="Main"&&(u={...n.style}),E.jsx("div",{className:n.className||"",style:u,children:E.jsx(dy,{components:n.components,componentProps:e})},r)}}return null})})}function BU({config:t,componentProps:e={}}){var l,u;const[n,r]=D.useState("loading"),[a,s]=D.useState(null);return D.useEffect(()=>{const c=setTimeout(()=>{n==="loading"&&(r("error"),s("No Layout configuration Found"))},5e3);return()=>clearTimeout(c)},[n]),D.useEffect(()=>{t!=null&&t.components&&t.gridConfig?(r("ready"),s(null)):t==null&&(r("error"),s("No layout configuration provided"))},[t]),n==="loading"?E.jsx("div",{className:"min-h-screen flex items-center justify-center p-8",children:E.jsxs("div",{className:"text-center max-w-md",children:[E.jsx("div",{className:"w-16 h-16 border-4 border-blue-200 border-t-blue-600 rounded-full animate-spin mx-auto mb-4"}),E.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Loading layout..."}),E.jsx("p",{className:"text-gray-600",children:"Preparing your dashboard"})]})}):n==="error"?E.jsx("div",{className:"min-h-screen bg-gradient-to-br from-red-50 to-orange-50 flex items-center justify-center p-8",children:E.jsxs("div",{className:"max-w-md w-full bg-white rounded-2xl shadow-2xl border border-red-100 p-8 text-center",children:[E.jsx("div",{className:"w-24 h-24 mx-auto mb-6 bg-red-100 rounded-2xl flex items-center justify-center",children:E.jsx("svg",{className:"w-12 h-12 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),E.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Layout Failed"}),E.jsx("p",{className:"text-gray-600 mb-6",children:a||"Configuration is invalid or missing"}),E.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[E.jsx("button",{onClick:()=>window.location.reload(),className:"px-6 py-3 bg-blue-600 text-white font-medium rounded-xl hover:bg-blue-700",children:"Reload Page"}),E.jsx("button",{onClick:()=>r("loading"),className:"px-6 py-3 bg-gray-100 text-gray-900 font-medium rounded-xl hover:bg-gray-200",children:"Retry"})]})]})}):E.jsx("div",{className:((l=t==null?void 0:t.gridConfig)==null?void 0:l.className)||"",style:(u=t==null?void 0:t.gridConfig)==null?void 0:u.style,children:E.jsx(dy,{components:(t==null?void 0:t.components)||[],componentProps:e})})}function Bd(t){const[e,n]=D.useState(null),[r,a]=D.useState(8),[s,l]=D.useState(!0);return D.useEffect(()=>{let u=null;const c=async()=>{if(l(!0),!t){try{const{data:h,error:d}=await ot.from("layout").select("ud_theme_id, ud_layout").eq("mosque_id",982842840).single();if(d)throw d;n(h.ud_layout),a(h.ud_theme_id),await fc(`${t}-ud`,{layout:h.ud_layout,udThemeId:h.ud_theme_id})}catch(h){console.error("Error loading default layout: ",h),await aa(h,{message:"Error loading default layout",mosqueId:null,context:"default layout fallback"}),Rn("error","Could not load default theme!"),n(null)}finally{l(!1)}return}if(!navigator.onLine){const h=await Hf(`${t}-ud`);if(h){n(h.layout),a(h.id),l(!1);return}}try{const{data:h,error:d}=await ot.from("mosque_t").select("organisasjonsnummer").eq("organisasjonsnummer",t).single();if(!h||d){Rn("warning","Please enter a valid org_nr!");return}const{data:m,error:y}=await ot.from("layout").select("ud_theme_id, ud_layout").eq("mosque_id",t).single();if(!y&&m.ud_layout){n(m.ud_layout),a(m.ud_theme_id),await fc(`${t}-ud`,{layout:m.ud_layout,id:m.ud_theme_id});return}const{data:g,error:x}=await ot.from("layout").select("ud_theme_id, ud_layout").eq("mosque_id",982842840).single();if(x)throw x;const{error:_}=await ot.from("layout").upsert([{mosque_id:t,ud_theme_id:g.ud_theme_id,ud_layout:g==null?void 0:g.ud_layout}],{onConflict:"mosque_id"}).single();if(_)throw _;n(g==null?void 0:g.ud_layout),a(g.ud_theme_id),await fc(`${t}-ud`,{layout:g.ud_layout,id:g.ud_theme_id})}catch(h){const d=await Hf(`${t}-ud`);d?(n(d.layout),d.id&&a(d.id)):n(null),console.log("Error fetching config: ",h),await aa(h,{mosqueId:t})}finally{l(!1)}};return c(),u=ot.channel(`ud_layout_changes:${t}`).on("postgres_changes",{event:"*",schema:"public",table:"layout",filter:`mosque_id=eq.${t}`},()=>{c()}).subscribe(),()=>{u==null||u.unsubscribe()}},[t]),{udConfig:e,udThemeId:r,loading:s}}function $U(){const{selectedMosque:t,prayerTimes:e,asrInfo:n}=vi(),{org_nr:r}=ia(),{udConfig:a,loading:s}=Bd(r||(t==null?void 0:t.value)||""),{isDefault:l,textColor:u,prayerTimesColor:c,...h}=a||{},{loading:d}=Pd(r||(t==null?void 0:t.value)||"982842840");return D.useEffect(()=>{const m=()=>{Rn("success","Back online!")},y=()=>{Rn("warning","You are offline!")};return window.addEventListener("online",m),window.addEventListener("offline",y),()=>{window.removeEventListener("online",m),window.removeEventListener("offline",y)}},[]),s||d?E.jsx("div",{className:"h-screen flex items-center justify-center",children:E.jsx(qf,{})}):E.jsx(BU,{config:h,componentProps:{isDefault:l,textColor:u,prayerTimesColor:c,prayerTimes:e,asrInfo:n}})}function jS(){return E.jsx($U,{})}const zU=()=>E.jsxs("div",{className:"h-screen flex flex-col items-center justify-center text-center px-4",children:[E.jsx("h1",{className:"text-4xl font-bold text-red-600",children:"404 - Page Not Found"}),E.jsx("p",{className:"mt-4 text-lg text-gray-600",children:"Sorry, the page you are looking for does not exist."})]}),qU=()=>{const{org_nr:t,loc_id:e}=ia();return E.jsx(kM,{org_nr:t,loc_id:e,children:E.jsx(j4,{})})},HU="modulepreload",VU=function(t){return"/"+t},OS={},J1=function(e,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const u=document.querySelector("meta[property=csp-nonce]"),c=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));a=l(n.map(h=>{if(h=VU(h),h in OS)return;OS[h]=!0;const d=h.endsWith(".css"),m=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${m}`))return;const y=document.createElement("link");if(y.rel=d?"stylesheet":HU,d||(y.as="script"),y.crossOrigin="",y.href=h,c&&y.setAttribute("nonce",c),document.head.appendChild(y),d)return new Promise((g,x)=>{y.addEventListener("load",g),y.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return a.then(l=>{for(const u of l||[])u.status==="rejected"&&s(u.reason);return e().catch(s)})};var eo=Uint8Array,is=Uint16Array,l2=Int32Array,u2=new eo([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),c2=new eo([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),RS=new eo([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),KE=function(t,e){for(var n=new is(31),r=0;r<31;++r)n[r]=e+=1<<t[r-1];for(var a=new l2(n[30]),r=1;r<30;++r)for(var s=n[r];s<n[r+1];++s)a[s]=s-n[r]<<5|r;return{b:n,r:a}},JE=KE(u2,2),GU=JE.b,py=JE.r;GU[28]=258,py[258]=28;var WU=KE(c2,0),kS=WU.r,my=new is(32768);for(var Er=0;Er<32768;++Er){var yu=(Er&43690)>>1|(Er&21845)<<1;yu=(yu&52428)>>2|(yu&13107)<<2,yu=(yu&61680)>>4|(yu&3855)<<4,my[Er]=((yu&65280)>>8|(yu&255)<<8)>>1}var ad=(function(t,e,n){for(var r=t.length,a=0,s=new is(e);a<r;++a)t[a]&&++s[t[a]-1];var l=new is(e);for(a=1;a<e;++a)l[a]=l[a-1]+s[a-1]<<1;var u;if(n){u=new is(1<<e);var c=15-e;for(a=0;a<r;++a)if(t[a])for(var h=a<<4|t[a],d=e-t[a],m=l[t[a]-1]++<<d,y=m|(1<<d)-1;m<=y;++m)u[my[m]>>c]=h}else for(u=new is(r),a=0;a<r;++a)t[a]&&(u[a]=my[l[t[a]-1]++]>>15-t[a]);return u}),pc=new eo(288);for(var Er=0;Er<144;++Er)pc[Er]=8;for(var Er=144;Er<256;++Er)pc[Er]=9;for(var Er=256;Er<280;++Er)pc[Er]=7;for(var Er=280;Er<288;++Er)pc[Er]=8;var hg=new eo(32);for(var Er=0;Er<32;++Er)hg[Er]=5;var YU=ad(pc,9,0),KU=ad(hg,5,0),XE=function(t){return(t+7)/8|0},JU=function(t,e,n){return(n==null||n>t.length)&&(n=t.length),new eo(t.subarray(e,n))},Cl=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8},Hh=function(t,e,n){n<<=e&7;var r=e/8|0;t[r]|=n,t[r+1]|=n>>8,t[r+2]|=n>>16},X1=function(t,e){for(var n=[],r=0;r<t.length;++r)t[r]&&n.push({s:r,f:t[r]});var a=n.length,s=n.slice();if(!a)return{t:QE,l:0};if(a==1){var l=new eo(n[0].s+1);return l[n[0].s]=1,{t:l,l:1}}n.sort(function(I,ee){return I.f-ee.f}),n.push({s:-1,f:25001});var u=n[0],c=n[1],h=0,d=1,m=2;for(n[0]={s:-1,f:u.f+c.f,l:u,r:c};d!=a-1;)u=n[n[h].f<n[m].f?h++:m++],c=n[h!=d&&n[h].f<n[m].f?h++:m++],n[d++]={s:-1,f:u.f+c.f,l:u,r:c};for(var y=s[0].s,r=1;r<a;++r)s[r].s>y&&(y=s[r].s);var g=new is(y+1),x=gy(n[d-1],g,0);if(x>e){var r=0,_=0,N=x-e,A=1<<N;for(s.sort(function(ee,G){return g[G.s]-g[ee.s]||ee.f-G.f});r<a;++r){var j=s[r].s;if(g[j]>e)_+=A-(1<<x-g[j]),g[j]=e;else break}for(_>>=N;_>0;){var L=s[r].s;g[L]<e?_-=1<<e-g[L]++-1:++r}for(;r>=0&&_;--r){var R=s[r].s;g[R]==e&&(--g[R],++_)}x=e}return{t:new eo(g),l:x}},gy=function(t,e,n){return t.s==-1?Math.max(gy(t.l,e,n+1),gy(t.r,e,n+1)):e[t.s]=n},DS=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new is(++e),r=0,a=t[0],s=1,l=function(c){n[r++]=c},u=1;u<=e;++u)if(t[u]==a&&u!=e)++s;else{if(!a&&s>2){for(;s>138;s-=138)l(32754);s>2&&(l(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(l(a),--s;s>6;s-=6)l(8304);s>2&&(l(s-3<<5|8208),s=0)}for(;s--;)l(a);s=1,a=t[u]}return{c:n.subarray(0,r),n:e}},Vh=function(t,e){for(var n=0,r=0;r<e.length;++r)n+=t[r]*e[r];return n},ZE=function(t,e,n){var r=n.length,a=XE(e+2);t[a]=r&255,t[a+1]=r>>8,t[a+2]=t[a]^255,t[a+3]=t[a+1]^255;for(var s=0;s<r;++s)t[a+s+4]=n[s];return(a+4+r)*8},PS=function(t,e,n,r,a,s,l,u,c,h,d){Cl(e,d++,n),++a[256];for(var m=X1(a,15),y=m.t,g=m.l,x=X1(s,15),_=x.t,N=x.l,A=DS(y),j=A.c,L=A.n,R=DS(_),I=R.c,ee=R.n,G=new is(19),P=0;P<j.length;++P)++G[j[P]&31];for(var P=0;P<I.length;++P)++G[I[P]&31];for(var B=X1(G,7),X=B.t,F=B.l,$=19;$>4&&!X[RS[$-1]];--$);var K=h+5<<3,Y=Vh(a,pc)+Vh(s,hg)+l,he=Vh(a,y)+Vh(s,_)+l+14+3*$+Vh(G,X)+2*G[16]+3*G[17]+7*G[18];if(c>=0&&K<=Y&&K<=he)return ZE(e,d,t.subarray(c,c+h));var te,oe,le,pe;if(Cl(e,d,1+(he<Y)),d+=2,he<Y){te=ad(y,g,0),oe=y,le=ad(_,N,0),pe=_;var Ne=ad(X,F,0);Cl(e,d,L-257),Cl(e,d+5,ee-1),Cl(e,d+10,$-4),d+=14;for(var P=0;P<$;++P)Cl(e,d+3*P,X[RS[P]]);d+=3*$;for(var U=[j,I],O=0;O<2;++O)for(var V=U[O],P=0;P<V.length;++P){var Z=V[P]&31;Cl(e,d,Ne[Z]),d+=X[Z],Z>15&&(Cl(e,d,V[P]>>5&127),d+=V[P]>>12)}}else te=YU,oe=pc,le=KU,pe=hg;for(var P=0;P<u;++P){var ie=r[P];if(ie>255){var Z=ie>>18&31;Hh(e,d,te[Z+257]),d+=oe[Z+257],Z>7&&(Cl(e,d,ie>>23&31),d+=u2[Z]);var z=ie&31;Hh(e,d,le[z]),d+=pe[z],z>3&&(Hh(e,d,ie>>5&8191),d+=c2[z])}else Hh(e,d,te[ie]),d+=oe[ie]}return Hh(e,d,te[256]),d+oe[256]},XU=new l2([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),QE=new eo(0),ZU=function(t,e,n,r,a,s){var l=s.z||t.length,u=new eo(r+l+5*(1+Math.ceil(l/7e3))+a),c=u.subarray(r,u.length-a),h=s.l,d=(s.r||0)&7;if(e){d&&(c[0]=s.r>>3);for(var m=XU[e-1],y=m>>13,g=m&8191,x=(1<<n)-1,_=s.p||new is(32768),N=s.h||new is(x+1),A=Math.ceil(n/3),j=2*A,L=function(Ke){return(t[Ke]^t[Ke+1]<<A^t[Ke+2]<<j)&x},R=new l2(25e3),I=new is(288),ee=new is(32),G=0,P=0,B=s.i||0,X=0,F=s.w||0,$=0;B+2<l;++B){var K=L(B),Y=B&32767,he=N[K];if(_[Y]=he,N[K]=Y,F<=B){var te=l-B;if((G>7e3||X>24576)&&(te>423||!h)){d=PS(t,c,0,R,I,ee,P,X,$,B-$,d),X=G=P=0,$=B;for(var oe=0;oe<286;++oe)I[oe]=0;for(var oe=0;oe<30;++oe)ee[oe]=0}var le=2,pe=0,Ne=g,U=Y-he&32767;if(te>2&&K==L(B-U))for(var O=Math.min(y,te)-1,V=Math.min(32767,B),Z=Math.min(258,te);U<=V&&--Ne&&Y!=he;){if(t[B+le]==t[B+le-U]){for(var ie=0;ie<Z&&t[B+ie]==t[B+ie-U];++ie);if(ie>le){if(le=ie,pe=U,ie>O)break;for(var z=Math.min(U,ie-2),se=0,oe=0;oe<z;++oe){var ge=B-U+oe&32767,xe=_[ge],Re=ge-xe&32767;Re>se&&(se=Re,he=ge)}}}Y=he,he=_[Y],U+=Y-he&32767}if(pe){R[X++]=268435456|py[le]<<18|kS[pe];var De=py[le]&31,qe=kS[pe]&31;P+=u2[De]+c2[qe],++I[257+De],++ee[qe],F=B+le,++G}else R[X++]=t[B],++I[t[B]]}}for(B=Math.max(B,F);B<l;++B)R[X++]=t[B],++I[t[B]];d=PS(t,c,h,R,I,ee,P,X,$,B-$,d),h||(s.r=d&7|c[d/8|0]<<3,d-=7,s.h=N,s.p=_,s.i=B,s.w=F)}else{for(var B=s.w||0;B<l+h;B+=65535){var Pe=B+65535;Pe>=l&&(c[d/8|0]=h,Pe=l),d=ZE(c,d+1,t.subarray(B,Pe))}s.i=l}return JU(u,0,r+XE(d)+a)},eA=function(){var t=1,e=0;return{p:function(n){for(var r=t,a=e,s=n.length|0,l=0;l!=s;){for(var u=Math.min(l+2655,s);l<u;++l)a+=r+=n[l];r=(r&65535)+15*(r>>16),a=(a&65535)+15*(a>>16)}t=r,e=a},d:function(){return t%=65521,e%=65521,(t&255)<<24|(t&65280)<<8|(e&255)<<8|e>>8}}},QU=function(t,e,n,r,a){if(!a&&(a={l:1},e.dictionary)){var s=e.dictionary.subarray(-32768),l=new eo(s.length+t.length);l.set(s),l.set(t,s.length),t=l,a.w=s.length}return ZU(t,e.level==null?6:e.level,e.mem==null?a.l?Math.ceil(Math.max(8,Math.min(13,Math.log(t.length)))*1.5):20:12+e.mem,n,r,a)},tA=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8},eB=function(t,e){var n=e.level,r=n==0?0:n<6?1:n==9?3:2;if(t[0]=120,t[1]=r<<6|(e.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,e.dictionary){var a=eA();a.p(e.dictionary),tA(t,2,a.d())}};function vy(t,e){e||(e={});var n=eA();n.p(t);var r=QU(t,e,e.dictionary?6:2,4);return eB(r,e),tA(r,r.length-4,n.d()),r}var tB=typeof TextDecoder<"u"&&new TextDecoder,nB=0;try{tB.decode(QE,{stream:!0}),nB=1}catch{}function MS(t,e="utf8"){return new TextDecoder(e).decode(t)}const rB=new TextEncoder;function aB(t){return rB.encode(t)}const iB=1024*8,sB=(()=>{const t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),Z1={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class f2{constructor(e=iB,n={}){rr(this,"buffer");rr(this,"byteLength");rr(this,"byteOffset");rr(this,"length");rr(this,"offset");rr(this,"lastWrittenByte");rr(this,"littleEndian");rr(this,"_data");rr(this,"_mark");rr(this,"_marks");let r=!1;typeof e=="number"?e=new ArrayBuffer(e):(r=!0,this.lastWrittenByte=e.byteLength);const a=n.offset?n.offset>>>0:0,s=e.byteLength-a;let l=a;(ArrayBuffer.isView(e)||e instanceof f2)&&(e.byteLength!==e.buffer.byteLength&&(l=e.byteOffset+a),e=e.buffer),r?this.lastWrittenByte=s:this.lastWrittenByte=0,this.buffer=e,this.length=s,this.byteLength=s,this.byteOffset=l,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,l,s),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const e=this._marks.pop();if(e===void 0)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){const r=(this.offset+e)*2,a=new Uint8Array(r);a.set(new Uint8Array(this.buffer)),this.buffer=a.buffer,this.length=r,this.byteLength=r,this._data=new DataView(this.buffer)}return this}readBoolean(){return this.readUint8()!==0}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,n){const r=Z1[n].BYTES_PER_ELEMENT*e,a=this.byteOffset+this.offset,s=this.buffer.slice(a,a+r);if(this.littleEndian===sB&&n!=="uint8"&&n!=="int8"){const u=new Uint8Array(this.buffer.slice(a,a+r));u.reverse();const c=new Z1[n](u.buffer);return this.offset+=r,c.reverse(),c}const l=new Z1[n](s);return this.offset+=r,l}readInt16(){const e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){const e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){const e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){const e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){const e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){const e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){const e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){const e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let n="";for(let r=0;r<e;r++)n+=this.readChar();return n}readUtf8(e=1){return MS(this.readBytes(e))}decodeText(e=1,n="utf8"){return MS(this.readBytes(e),n)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let n=0;n<e.length;n++)this._data.setUint8(this.offset++,e[n]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let n=0;n<e.length;n++)this.writeUint8(e.charCodeAt(n));return this}writeUtf8(e){return this.writeBytes(aB(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function Kf(t){let e=t.length;for(;--e>=0;)t[e]=0}const oB=3,lB=258,nA=29,uB=256,cB=uB+1+nA,rA=30,fB=512,hB=new Array((cB+2)*2);Kf(hB);const dB=new Array(rA*2);Kf(dB);const pB=new Array(fB);Kf(pB);const mB=new Array(lB-oB+1);Kf(mB);const gB=new Array(nA);Kf(gB);const vB=new Array(rA);Kf(vB);const yB=(t,e,n,r)=>{let a=t&65535|0,s=t>>>16&65535|0,l=0;for(;n!==0;){l=n>2e3?2e3:n,n-=l;do a=a+e[r++]|0,s=s+a|0;while(--l);a%=65521,s%=65521}return a|s<<16|0};var yy=yB;const bB=()=>{let t,e=[];for(var n=0;n<256;n++){t=n;for(var r=0;r<8;r++)t=t&1?3988292384^t>>>1:t>>>1;e[n]=t}return e},wB=new Uint32Array(bB()),xB=(t,e,n,r)=>{const a=wB,s=r+n;t^=-1;for(let l=r;l<s;l++)t=t>>>8^a[(t^e[l])&255];return t^-1};var jo=xB,by={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},aA={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const SB=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var _B=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const n=e.shift();if(n){if(typeof n!="object")throw new TypeError(n+"must be non-object");for(const r in n)SB(n,r)&&(t[r]=n[r])}}return t},EB=t=>{let e=0;for(let r=0,a=t.length;r<a;r++)e+=t[r].length;const n=new Uint8Array(e);for(let r=0,a=0,s=t.length;r<s;r++){let l=t[r];n.set(l,a),a+=l.length}return n},iA={assign:_B,flattenChunks:EB};let sA=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{sA=!1}const Sd=new Uint8Array(256);for(let t=0;t<256;t++)Sd[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Sd[254]=Sd[254]=1;var AB=t=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(t);let e,n,r,a,s,l=t.length,u=0;for(a=0;a<l;a++)n=t.charCodeAt(a),(n&64512)===55296&&a+1<l&&(r=t.charCodeAt(a+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),a++)),u+=n<128?1:n<2048?2:n<65536?3:4;for(e=new Uint8Array(u),s=0,a=0;s<u;a++)n=t.charCodeAt(a),(n&64512)===55296&&a+1<l&&(r=t.charCodeAt(a+1),(r&64512)===56320&&(n=65536+(n-55296<<10)+(r-56320),a++)),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|n&63):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|n&63):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|n&63);return e};const NB=(t,e)=>{if(e<65534&&t.subarray&&sA)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let n="";for(let r=0;r<e;r++)n+=String.fromCharCode(t[r]);return n};var CB=(t,e)=>{const n=e||t.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(t.subarray(0,e));let r,a;const s=new Array(n*2);for(a=0,r=0;r<n;){let l=t[r++];if(l<128){s[a++]=l;continue}let u=Sd[l];if(u>4){s[a++]=65533,r+=u-1;continue}for(l&=u===2?31:u===3?15:7;u>1&&r<n;)l=l<<6|t[r++]&63,u--;if(u>1){s[a++]=65533;continue}l<65536?s[a++]=l:(l-=65536,s[a++]=55296|l>>10&1023,s[a++]=56320|l&1023)}return NB(s,a)},TB=(t,e)=>{e=e||t.length,e>t.length&&(e=t.length);let n=e-1;for(;n>=0&&(t[n]&192)===128;)n--;return n<0||n===0?e:n+Sd[t[n]]>e?n:e},wy={string2buf:AB,buf2string:CB,utf8border:TB};function LB(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var jB=LB;const um=16209,OB=16191;var RB=function(e,n){let r,a,s,l,u,c,h,d,m,y,g,x,_,N,A,j,L,R,I,ee,G,P,B,X;const F=e.state;r=e.next_in,B=e.input,a=r+(e.avail_in-5),s=e.next_out,X=e.output,l=s-(n-e.avail_out),u=s+(e.avail_out-257),c=F.dmax,h=F.wsize,d=F.whave,m=F.wnext,y=F.window,g=F.hold,x=F.bits,_=F.lencode,N=F.distcode,A=(1<<F.lenbits)-1,j=(1<<F.distbits)-1;e:do{x<15&&(g+=B[r++]<<x,x+=8,g+=B[r++]<<x,x+=8),L=_[g&A];t:for(;;){if(R=L>>>24,g>>>=R,x-=R,R=L>>>16&255,R===0)X[s++]=L&65535;else if(R&16){I=L&65535,R&=15,R&&(x<R&&(g+=B[r++]<<x,x+=8),I+=g&(1<<R)-1,g>>>=R,x-=R),x<15&&(g+=B[r++]<<x,x+=8,g+=B[r++]<<x,x+=8),L=N[g&j];n:for(;;){if(R=L>>>24,g>>>=R,x-=R,R=L>>>16&255,R&16){if(ee=L&65535,R&=15,x<R&&(g+=B[r++]<<x,x+=8,x<R&&(g+=B[r++]<<x,x+=8)),ee+=g&(1<<R)-1,ee>c){e.msg="invalid distance too far back",F.mode=um;break e}if(g>>>=R,x-=R,R=s-l,ee>R){if(R=ee-R,R>d&&F.sane){e.msg="invalid distance too far back",F.mode=um;break e}if(G=0,P=y,m===0){if(G+=h-R,R<I){I-=R;do X[s++]=y[G++];while(--R);G=s-ee,P=X}}else if(m<R){if(G+=h+m-R,R-=m,R<I){I-=R;do X[s++]=y[G++];while(--R);if(G=0,m<I){R=m,I-=R;do X[s++]=y[G++];while(--R);G=s-ee,P=X}}}else if(G+=m-R,R<I){I-=R;do X[s++]=y[G++];while(--R);G=s-ee,P=X}for(;I>2;)X[s++]=P[G++],X[s++]=P[G++],X[s++]=P[G++],I-=3;I&&(X[s++]=P[G++],I>1&&(X[s++]=P[G++]))}else{G=s-ee;do X[s++]=X[G++],X[s++]=X[G++],X[s++]=X[G++],I-=3;while(I>2);I&&(X[s++]=X[G++],I>1&&(X[s++]=X[G++]))}}else if((R&64)===0){L=N[(L&65535)+(g&(1<<R)-1)];continue n}else{e.msg="invalid distance code",F.mode=um;break e}break}}else if((R&64)===0){L=_[(L&65535)+(g&(1<<R)-1)];continue t}else if(R&32){F.mode=OB;break e}else{e.msg="invalid literal/length code",F.mode=um;break e}break}}while(r<a&&s<u);I=x>>3,r-=I,x-=I<<3,g&=(1<<x)-1,e.next_in=r,e.next_out=s,e.avail_in=r<a?5+(a-r):5-(r-a),e.avail_out=s<u?257+(u-s):257-(s-u),F.hold=g,F.bits=x};const mf=15,IS=852,FS=592,US=0,Q1=1,BS=2,kB=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),DB=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),PB=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),MB=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),IB=(t,e,n,r,a,s,l,u)=>{const c=u.bits;let h=0,d=0,m=0,y=0,g=0,x=0,_=0,N=0,A=0,j=0,L,R,I,ee,G,P=null,B;const X=new Uint16Array(mf+1),F=new Uint16Array(mf+1);let $=null,K,Y,he;for(h=0;h<=mf;h++)X[h]=0;for(d=0;d<r;d++)X[e[n+d]]++;for(g=c,y=mf;y>=1&&X[y]===0;y--);if(g>y&&(g=y),y===0)return a[s++]=1<<24|64<<16|0,a[s++]=1<<24|64<<16|0,u.bits=1,0;for(m=1;m<y&&X[m]===0;m++);for(g<m&&(g=m),N=1,h=1;h<=mf;h++)if(N<<=1,N-=X[h],N<0)return-1;if(N>0&&(t===US||y!==1))return-1;for(F[1]=0,h=1;h<mf;h++)F[h+1]=F[h]+X[h];for(d=0;d<r;d++)e[n+d]!==0&&(l[F[e[n+d]]++]=d);if(t===US?(P=$=l,B=20):t===Q1?(P=kB,$=DB,B=257):(P=PB,$=MB,B=0),j=0,d=0,h=m,G=s,x=g,_=0,I=-1,A=1<<g,ee=A-1,t===Q1&&A>IS||t===BS&&A>FS)return 1;for(;;){K=h-_,l[d]+1<B?(Y=0,he=l[d]):l[d]>=B?(Y=$[l[d]-B],he=P[l[d]-B]):(Y=96,he=0),L=1<<h-_,R=1<<x,m=R;do R-=L,a[G+(j>>_)+R]=K<<24|Y<<16|he|0;while(R!==0);for(L=1<<h-1;j&L;)L>>=1;if(L!==0?(j&=L-1,j+=L):j=0,d++,--X[h]===0){if(h===y)break;h=e[n+l[d]]}if(h>g&&(j&ee)!==I){for(_===0&&(_=g),G+=m,x=h-_,N=1<<x;x+_<y&&(N-=X[x+_],!(N<=0));)x++,N<<=1;if(A+=1<<x,t===Q1&&A>IS||t===BS&&A>FS)return 1;I=j&ee,a[I]=g<<24|x<<16|G-s|0}}return j!==0&&(a[G+j]=h-_<<24|64<<16|0),u.bits=g,0};var id=IB;const FB=0,oA=1,lA=2,{Z_FINISH:$S,Z_BLOCK:UB,Z_TREES:cm,Z_OK:mc,Z_STREAM_END:BB,Z_NEED_DICT:$B,Z_STREAM_ERROR:Es,Z_DATA_ERROR:uA,Z_MEM_ERROR:cA,Z_BUF_ERROR:zB,Z_DEFLATED:zS}=aA,Hg=16180,qS=16181,HS=16182,VS=16183,GS=16184,WS=16185,YS=16186,KS=16187,JS=16188,XS=16189,dg=16190,Tl=16191,ev=16192,ZS=16193,tv=16194,QS=16195,e_=16196,t_=16197,n_=16198,fm=16199,hm=16200,r_=16201,a_=16202,i_=16203,s_=16204,o_=16205,nv=16206,l_=16207,u_=16208,kr=16209,fA=16210,hA=16211,qB=852,HB=592,VB=15,GB=VB,c_=t=>(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24);function WB(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const yc=t=>{if(!t)return 1;const e=t.state;return!e||e.strm!==t||e.mode<Hg||e.mode>hA?1:0},dA=t=>{if(yc(t))return Es;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Hg,e.last=0,e.havedict=0,e.flags=-1,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(qB),e.distcode=e.distdyn=new Int32Array(HB),e.sane=1,e.back=-1,mc},pA=t=>{if(yc(t))return Es;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,dA(t)},mA=(t,e)=>{let n;if(yc(t))return Es;const r=t.state;return e<0?(n=0,e=-e):(n=(e>>4)+5,e<48&&(e&=15)),e&&(e<8||e>15)?Es:(r.window!==null&&r.wbits!==e&&(r.window=null),r.wrap=n,r.wbits=e,pA(t))},gA=(t,e)=>{if(!t)return Es;const n=new WB;t.state=n,n.strm=t,n.window=null,n.mode=Hg;const r=mA(t,e);return r!==mc&&(t.state=null),r},YB=t=>gA(t,GB);let f_=!0,rv,av;const KB=t=>{if(f_){rv=new Int32Array(512),av=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(id(oA,t.lens,0,288,rv,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;id(lA,t.lens,0,32,av,0,t.work,{bits:5}),f_=!1}t.lencode=rv,t.lenbits=9,t.distcode=av,t.distbits=5},vA=(t,e,n,r)=>{let a;const s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),r>=s.wsize?(s.window.set(e.subarray(n-s.wsize,n),0),s.wnext=0,s.whave=s.wsize):(a=s.wsize-s.wnext,a>r&&(a=r),s.window.set(e.subarray(n-r,n-r+a),s.wnext),r-=a,r?(s.window.set(e.subarray(n-r,n),0),s.wnext=r,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=a))),0},JB=(t,e)=>{let n,r,a,s,l,u,c,h,d,m,y,g,x,_,N=0,A,j,L,R,I,ee,G,P;const B=new Uint8Array(4);let X,F;const $=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(yc(t)||!t.output||!t.input&&t.avail_in!==0)return Es;n=t.state,n.mode===Tl&&(n.mode=ev),l=t.next_out,a=t.output,c=t.avail_out,s=t.next_in,r=t.input,u=t.avail_in,h=n.hold,d=n.bits,m=u,y=c,P=mc;e:for(;;)switch(n.mode){case Hg:if(n.wrap===0){n.mode=ev;break}for(;d<16;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(n.wrap&2&&h===35615){n.wbits===0&&(n.wbits=15),n.check=0,B[0]=h&255,B[1]=h>>>8&255,n.check=jo(n.check,B,2,0),h=0,d=0,n.mode=qS;break}if(n.head&&(n.head.done=!1),!(n.wrap&1)||(((h&255)<<8)+(h>>8))%31){t.msg="incorrect header check",n.mode=kr;break}if((h&15)!==zS){t.msg="unknown compression method",n.mode=kr;break}if(h>>>=4,d-=4,G=(h&15)+8,n.wbits===0&&(n.wbits=G),G>15||G>n.wbits){t.msg="invalid window size",n.mode=kr;break}n.dmax=1<<n.wbits,n.flags=0,t.adler=n.check=1,n.mode=h&512?XS:Tl,h=0,d=0;break;case qS:for(;d<16;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(n.flags=h,(n.flags&255)!==zS){t.msg="unknown compression method",n.mode=kr;break}if(n.flags&57344){t.msg="unknown header flags set",n.mode=kr;break}n.head&&(n.head.text=h>>8&1),n.flags&512&&n.wrap&4&&(B[0]=h&255,B[1]=h>>>8&255,n.check=jo(n.check,B,2,0)),h=0,d=0,n.mode=HS;case HS:for(;d<32;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.head&&(n.head.time=h),n.flags&512&&n.wrap&4&&(B[0]=h&255,B[1]=h>>>8&255,B[2]=h>>>16&255,B[3]=h>>>24&255,n.check=jo(n.check,B,4,0)),h=0,d=0,n.mode=VS;case VS:for(;d<16;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.head&&(n.head.xflags=h&255,n.head.os=h>>8),n.flags&512&&n.wrap&4&&(B[0]=h&255,B[1]=h>>>8&255,n.check=jo(n.check,B,2,0)),h=0,d=0,n.mode=GS;case GS:if(n.flags&1024){for(;d<16;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.length=h,n.head&&(n.head.extra_len=h),n.flags&512&&n.wrap&4&&(B[0]=h&255,B[1]=h>>>8&255,n.check=jo(n.check,B,2,0)),h=0,d=0}else n.head&&(n.head.extra=null);n.mode=WS;case WS:if(n.flags&1024&&(g=n.length,g>u&&(g=u),g&&(n.head&&(G=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Uint8Array(n.head.extra_len)),n.head.extra.set(r.subarray(s,s+g),G)),n.flags&512&&n.wrap&4&&(n.check=jo(n.check,r,g,s)),u-=g,s+=g,n.length-=g),n.length))break e;n.length=0,n.mode=YS;case YS:if(n.flags&2048){if(u===0)break e;g=0;do G=r[s+g++],n.head&&G&&n.length<65536&&(n.head.name+=String.fromCharCode(G));while(G&&g<u);if(n.flags&512&&n.wrap&4&&(n.check=jo(n.check,r,g,s)),u-=g,s+=g,G)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=KS;case KS:if(n.flags&4096){if(u===0)break e;g=0;do G=r[s+g++],n.head&&G&&n.length<65536&&(n.head.comment+=String.fromCharCode(G));while(G&&g<u);if(n.flags&512&&n.wrap&4&&(n.check=jo(n.check,r,g,s)),u-=g,s+=g,G)break e}else n.head&&(n.head.comment=null);n.mode=JS;case JS:if(n.flags&512){for(;d<16;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(n.wrap&4&&h!==(n.check&65535)){t.msg="header crc mismatch",n.mode=kr;break}h=0,d=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=Tl;break;case XS:for(;d<32;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}t.adler=n.check=c_(h),h=0,d=0,n.mode=dg;case dg:if(n.havedict===0)return t.next_out=l,t.avail_out=c,t.next_in=s,t.avail_in=u,n.hold=h,n.bits=d,$B;t.adler=n.check=1,n.mode=Tl;case Tl:if(e===UB||e===cm)break e;case ev:if(n.last){h>>>=d&7,d-=d&7,n.mode=nv;break}for(;d<3;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}switch(n.last=h&1,h>>>=1,d-=1,h&3){case 0:n.mode=ZS;break;case 1:if(KB(n),n.mode=fm,e===cm){h>>>=2,d-=2;break e}break;case 2:n.mode=e_;break;case 3:t.msg="invalid block type",n.mode=kr}h>>>=2,d-=2;break;case ZS:for(h>>>=d&7,d-=d&7;d<32;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if((h&65535)!==(h>>>16^65535)){t.msg="invalid stored block lengths",n.mode=kr;break}if(n.length=h&65535,h=0,d=0,n.mode=tv,e===cm)break e;case tv:n.mode=QS;case QS:if(g=n.length,g){if(g>u&&(g=u),g>c&&(g=c),g===0)break e;a.set(r.subarray(s,s+g),l),u-=g,s+=g,c-=g,l+=g,n.length-=g;break}n.mode=Tl;break;case e_:for(;d<14;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(n.nlen=(h&31)+257,h>>>=5,d-=5,n.ndist=(h&31)+1,h>>>=5,d-=5,n.ncode=(h&15)+4,h>>>=4,d-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=kr;break}n.have=0,n.mode=t_;case t_:for(;n.have<n.ncode;){for(;d<3;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.lens[$[n.have++]]=h&7,h>>>=3,d-=3}for(;n.have<19;)n.lens[$[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,X={bits:n.lenbits},P=id(FB,n.lens,0,19,n.lencode,0,n.work,X),n.lenbits=X.bits,P){t.msg="invalid code lengths set",n.mode=kr;break}n.have=0,n.mode=n_;case n_:for(;n.have<n.nlen+n.ndist;){for(;N=n.lencode[h&(1<<n.lenbits)-1],A=N>>>24,j=N>>>16&255,L=N&65535,!(A<=d);){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(L<16)h>>>=A,d-=A,n.lens[n.have++]=L;else{if(L===16){for(F=A+2;d<F;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(h>>>=A,d-=A,n.have===0){t.msg="invalid bit length repeat",n.mode=kr;break}G=n.lens[n.have-1],g=3+(h&3),h>>>=2,d-=2}else if(L===17){for(F=A+3;d<F;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}h>>>=A,d-=A,G=0,g=3+(h&7),h>>>=3,d-=3}else{for(F=A+7;d<F;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}h>>>=A,d-=A,G=0,g=11+(h&127),h>>>=7,d-=7}if(n.have+g>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=kr;break}for(;g--;)n.lens[n.have++]=G}}if(n.mode===kr)break;if(n.lens[256]===0){t.msg="invalid code -- missing end-of-block",n.mode=kr;break}if(n.lenbits=9,X={bits:n.lenbits},P=id(oA,n.lens,0,n.nlen,n.lencode,0,n.work,X),n.lenbits=X.bits,P){t.msg="invalid literal/lengths set",n.mode=kr;break}if(n.distbits=6,n.distcode=n.distdyn,X={bits:n.distbits},P=id(lA,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,X),n.distbits=X.bits,P){t.msg="invalid distances set",n.mode=kr;break}if(n.mode=fm,e===cm)break e;case fm:n.mode=hm;case hm:if(u>=6&&c>=258){t.next_out=l,t.avail_out=c,t.next_in=s,t.avail_in=u,n.hold=h,n.bits=d,RB(t,y),l=t.next_out,a=t.output,c=t.avail_out,s=t.next_in,r=t.input,u=t.avail_in,h=n.hold,d=n.bits,n.mode===Tl&&(n.back=-1);break}for(n.back=0;N=n.lencode[h&(1<<n.lenbits)-1],A=N>>>24,j=N>>>16&255,L=N&65535,!(A<=d);){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(j&&(j&240)===0){for(R=A,I=j,ee=L;N=n.lencode[ee+((h&(1<<R+I)-1)>>R)],A=N>>>24,j=N>>>16&255,L=N&65535,!(R+A<=d);){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}h>>>=R,d-=R,n.back+=R}if(h>>>=A,d-=A,n.back+=A,n.length=L,j===0){n.mode=o_;break}if(j&32){n.back=-1,n.mode=Tl;break}if(j&64){t.msg="invalid literal/length code",n.mode=kr;break}n.extra=j&15,n.mode=r_;case r_:if(n.extra){for(F=n.extra;d<F;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.length+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=a_;case a_:for(;N=n.distcode[h&(1<<n.distbits)-1],A=N>>>24,j=N>>>16&255,L=N&65535,!(A<=d);){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if((j&240)===0){for(R=A,I=j,ee=L;N=n.distcode[ee+((h&(1<<R+I)-1)>>R)],A=N>>>24,j=N>>>16&255,L=N&65535,!(R+A<=d);){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}h>>>=R,d-=R,n.back+=R}if(h>>>=A,d-=A,n.back+=A,j&64){t.msg="invalid distance code",n.mode=kr;break}n.offset=L,n.extra=j&15,n.mode=i_;case i_:if(n.extra){for(F=n.extra;d<F;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}n.offset+=h&(1<<n.extra)-1,h>>>=n.extra,d-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=kr;break}n.mode=s_;case s_:if(c===0)break e;if(g=y-c,n.offset>g){if(g=n.offset-g,g>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=kr;break}g>n.wnext?(g-=n.wnext,x=n.wsize-g):x=n.wnext-g,g>n.length&&(g=n.length),_=n.window}else _=a,x=l-n.offset,g=n.length;g>c&&(g=c),c-=g,n.length-=g;do a[l++]=_[x++];while(--g);n.length===0&&(n.mode=hm);break;case o_:if(c===0)break e;a[l++]=n.length,c--,n.mode=hm;break;case nv:if(n.wrap){for(;d<32;){if(u===0)break e;u--,h|=r[s++]<<d,d+=8}if(y-=c,t.total_out+=y,n.total+=y,n.wrap&4&&y&&(t.adler=n.check=n.flags?jo(n.check,a,y,l-y):yy(n.check,a,y,l-y)),y=c,n.wrap&4&&(n.flags?h:c_(h))!==n.check){t.msg="incorrect data check",n.mode=kr;break}h=0,d=0}n.mode=l_;case l_:if(n.wrap&&n.flags){for(;d<32;){if(u===0)break e;u--,h+=r[s++]<<d,d+=8}if(n.wrap&4&&h!==(n.total&4294967295)){t.msg="incorrect length check",n.mode=kr;break}h=0,d=0}n.mode=u_;case u_:P=BB;break e;case kr:P=uA;break e;case fA:return cA;case hA:default:return Es}return t.next_out=l,t.avail_out=c,t.next_in=s,t.avail_in=u,n.hold=h,n.bits=d,(n.wsize||y!==t.avail_out&&n.mode<kr&&(n.mode<nv||e!==$S))&&vA(t,t.output,t.next_out,y-t.avail_out),m-=t.avail_in,y-=t.avail_out,t.total_in+=m,t.total_out+=y,n.total+=y,n.wrap&4&&y&&(t.adler=n.check=n.flags?jo(n.check,a,y,t.next_out-y):yy(n.check,a,y,t.next_out-y)),t.data_type=n.bits+(n.last?64:0)+(n.mode===Tl?128:0)+(n.mode===fm||n.mode===tv?256:0),(m===0&&y===0||e===$S)&&P===mc&&(P=zB),P},XB=t=>{if(yc(t))return Es;let e=t.state;return e.window&&(e.window=null),t.state=null,mc},ZB=(t,e)=>{if(yc(t))return Es;const n=t.state;return(n.wrap&2)===0?Es:(n.head=e,e.done=!1,mc)},QB=(t,e)=>{const n=e.length;let r,a,s;return yc(t)||(r=t.state,r.wrap!==0&&r.mode!==dg)?Es:r.mode===dg&&(a=1,a=yy(a,e,n,0),a!==r.check)?uA:(s=vA(t,e,n,n),s?(r.mode=fA,cA):(r.havedict=1,mc))};var e$=pA,t$=mA,n$=dA,r$=YB,a$=gA,i$=JB,s$=XB,o$=ZB,l$=QB,u$="pako inflate (from Nodeca project)",Rl={inflateReset:e$,inflateReset2:t$,inflateResetKeep:n$,inflateInit:r$,inflateInit2:a$,inflate:i$,inflateEnd:s$,inflateGetHeader:o$,inflateSetDictionary:l$,inflateInfo:u$};function c$(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var f$=c$;const yA=Object.prototype.toString,{Z_NO_FLUSH:h$,Z_FINISH:d$,Z_OK:_d,Z_STREAM_END:iv,Z_NEED_DICT:sv,Z_STREAM_ERROR:p$,Z_DATA_ERROR:h_,Z_MEM_ERROR:m$}=aA;function $d(t){this.options=iA.assign({chunkSize:1024*64,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15)===0&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new jB,this.strm.avail_out=0;let n=Rl.inflateInit2(this.strm,e.windowBits);if(n!==_d)throw new Error(by[n]);if(this.header=new f$,Rl.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=wy.string2buf(e.dictionary):yA.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(n=Rl.inflateSetDictionary(this.strm,e.dictionary),n!==_d)))throw new Error(by[n])}$d.prototype.push=function(t,e){const n=this.strm,r=this.options.chunkSize,a=this.options.dictionary;let s,l,u;if(this.ended)return!1;for(e===~~e?l=e:l=e===!0?d$:h$,yA.call(t)==="[object ArrayBuffer]"?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;){for(n.avail_out===0&&(n.output=new Uint8Array(r),n.next_out=0,n.avail_out=r),s=Rl.inflate(n,l),s===sv&&a&&(s=Rl.inflateSetDictionary(n,a),s===_d?s=Rl.inflate(n,l):s===h_&&(s=sv));n.avail_in>0&&s===iv&&n.state.wrap>0&&t[n.next_in]!==0;)Rl.inflateReset(n),s=Rl.inflate(n,l);switch(s){case p$:case h_:case sv:case m$:return this.onEnd(s),this.ended=!0,!1}if(u=n.avail_out,n.next_out&&(n.avail_out===0||s===iv))if(this.options.to==="string"){let c=wy.utf8border(n.output,n.next_out),h=n.next_out-c,d=wy.buf2string(n.output,c);n.next_out=h,n.avail_out=r-h,h&&n.output.set(n.output.subarray(c,c+h),0),this.onData(d)}else this.onData(n.output.length===n.next_out?n.output:n.output.subarray(0,n.next_out));if(!(s===_d&&u===0)){if(s===iv)return s=Rl.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(n.avail_in===0)break}}return!0};$d.prototype.onData=function(t){this.chunks.push(t)};$d.prototype.onEnd=function(t){t===_d&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=iA.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function g$(t,e){const n=new $d(e);if(n.push(t),n.err)throw n.msg||by[n.err];return n.result}var v$=$d,y$=g$,b$={Inflate:v$,inflate:y$};const{Inflate:w$,inflate:x$}=b$;var d_=w$,S$=x$;const bA=[];for(let t=0;t<256;t++){let e=t;for(let n=0;n<8;n++)e&1?e=3988292384^e>>>1:e=e>>>1;bA[t]=e}const p_=4294967295;function _$(t,e,n){let r=t;for(let a=0;a<n;a++)r=bA[(r^e[a])&255]^r>>>8;return r}function E$(t,e){return(_$(p_,t,e)^p_)>>>0}function m_(t,e,n){const r=t.readUint32(),a=E$(new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e);if(a!==r)throw new Error(`CRC mismatch for chunk ${n}. Expected ${r}, found ${a}`)}function wA(t,e,n){for(let r=0;r<n;r++)e[r]=t[r]}function xA(t,e,n,r){let a=0;for(;a<r;a++)e[a]=t[a];for(;a<n;a++)e[a]=t[a]+e[a-r]&255}function SA(t,e,n,r){let a=0;if(n.length===0)for(;a<r;a++)e[a]=t[a];else for(;a<r;a++)e[a]=t[a]+n[a]&255}function _A(t,e,n,r,a){let s=0;if(n.length===0){for(;s<a;s++)e[s]=t[s];for(;s<r;s++)e[s]=t[s]+(e[s-a]>>1)&255}else{for(;s<a;s++)e[s]=t[s]+(n[s]>>1)&255;for(;s<r;s++)e[s]=t[s]+(e[s-a]+n[s]>>1)&255}}function EA(t,e,n,r,a){let s=0;if(n.length===0){for(;s<a;s++)e[s]=t[s];for(;s<r;s++)e[s]=t[s]+e[s-a]&255}else{for(;s<a;s++)e[s]=t[s]+n[s]&255;for(;s<r;s++)e[s]=t[s]+A$(e[s-a],n[s],n[s-a])&255}}function A$(t,e,n){const r=t+e-n,a=Math.abs(r-t),s=Math.abs(r-e),l=Math.abs(r-n);return a<=s&&a<=l?t:s<=l?e:n}function N$(t,e,n,r,a,s){switch(t){case 0:wA(e,n,a);break;case 1:xA(e,n,a,s);break;case 2:SA(e,n,r,a);break;case 3:_A(e,n,r,a,s);break;case 4:EA(e,n,r,a,s);break;default:throw new Error(`Unsupported filter: ${t}`)}}const C$=new Uint16Array([255]),T$=new Uint8Array(C$.buffer),L$=T$[0]===255;function j$(t){const{data:e,width:n,height:r,channels:a,depth:s}=t,l=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],u=Math.ceil(s/8)*a,c=new Uint8Array(r*n*u);let h=0;for(let d=0;d<7;d++){const m=l[d],y=Math.ceil((n-m.x)/m.xStep),g=Math.ceil((r-m.y)/m.yStep);if(y<=0||g<=0)continue;const x=y*u,_=new Uint8Array(x);for(let N=0;N<g;N++){const A=e[h++],j=e.subarray(h,h+x);h+=x;const L=new Uint8Array(x);N$(A,j,L,_,x,u),_.set(L);for(let R=0;R<y;R++){const I=m.x+R*m.xStep,ee=m.y+N*m.yStep;if(!(I>=n||ee>=r))for(let G=0;G<u;G++)c[(ee*n+I)*u+G]=L[R*u+G]}}}if(s===16){const d=new Uint16Array(c.buffer);if(L$)for(let m=0;m<d.length;m++)d[m]=O$(d[m]);return d}else return c}function O$(t){return(t&255)<<8|t>>8&255}const R$=new Uint16Array([255]),k$=new Uint8Array(R$.buffer),D$=k$[0]===255,P$=new Uint8Array(0);function g_(t){const{data:e,width:n,height:r,channels:a,depth:s}=t,l=Math.ceil(s/8)*a,u=Math.ceil(s/8*a*n),c=new Uint8Array(r*u);let h=P$,d=0,m,y;for(let g=0;g<r;g++){switch(m=e.subarray(d+1,d+1+u),y=c.subarray(g*u,(g+1)*u),e[d]){case 0:wA(m,y,u);break;case 1:xA(m,y,u,l);break;case 2:SA(m,y,h,u);break;case 3:_A(m,y,h,u,l);break;case 4:EA(m,y,h,u,l);break;default:throw new Error(`Unsupported filter: ${e[d]}`)}h=y,d+=u+1}if(s===16){const g=new Uint16Array(c.buffer);if(D$)for(let x=0;x<g.length;x++)g[x]=M$(g[x]);return g}else return c}function M$(t){return(t&255)<<8|t>>8&255}const Tm=Uint8Array.of(137,80,78,71,13,10,26,10);function v_(t){if(!I$(t.readBytes(Tm.length)))throw new Error("wrong PNG signature")}function I$(t){if(t.length<Tm.length)return!1;for(let e=0;e<Tm.length;e++)if(t[e]!==Tm[e])return!1;return!0}const F$="tEXt",U$=0,AA=new TextDecoder("latin1");function B$(t){if(z$(t),t.length===0||t.length>79)throw new Error("keyword length must be between 1 and 79")}const $$=/^[\u0000-\u00FF]*$/;function z$(t){if(!$$.test(t))throw new Error("invalid latin1 text")}function q$(t,e,n){const r=NA(e);t[r]=H$(e,n-r.length-1)}function NA(t){for(t.mark();t.readByte()!==U$;);const e=t.offset;t.reset();const n=AA.decode(t.readBytes(e-t.offset-1));return t.skip(1),B$(n),n}function H$(t,e){return AA.decode(t.readBytes(e))}const ns={UNKNOWN:-1,GREYSCALE:0,TRUECOLOUR:2,INDEXED_COLOUR:3,GREYSCALE_ALPHA:4,TRUECOLOUR_ALPHA:6},ov={UNKNOWN:-1,DEFLATE:0},y_={UNKNOWN:-1,ADAPTIVE:0},lv={UNKNOWN:-1,NO_INTERLACE:0,ADAM7:1},dm={NONE:0,BACKGROUND:1,PREVIOUS:2},uv={SOURCE:0,OVER:1};class V$ extends f2{constructor(n,r={}){super(n);rr(this,"_checkCrc");rr(this,"_inflator");rr(this,"_png");rr(this,"_apng");rr(this,"_end");rr(this,"_hasPalette");rr(this,"_palette");rr(this,"_hasTransparency");rr(this,"_transparency");rr(this,"_compressionMethod");rr(this,"_filterMethod");rr(this,"_interlaceMethod");rr(this,"_colorType");rr(this,"_isAnimated");rr(this,"_numberOfFrames");rr(this,"_numberOfPlays");rr(this,"_frames");rr(this,"_writingDataChunks");const{checkCrc:a=!1}=r;this._checkCrc=a,this._inflator=new d_,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=ov.UNKNOWN,this._filterMethod=y_.UNKNOWN,this._interlaceMethod=lv.UNKNOWN,this._colorType=ns.UNKNOWN,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(v_(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeChunk(n,r)}return this.decodeImage(),this._png}decodeApng(){for(v_(this);!this._end;){const n=this.readUint32(),r=this.readChars(4);this.decodeApngChunk(n,r)}return this.decodeApngImage(),this._apng}decodeChunk(n,r){const a=this.offset;switch(r){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(n);break;case"IDAT":this.decodeIDAT(n);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(n);break;case"iCCP":this.decodeiCCP(n);break;case F$:q$(this._png.text,this,n);break;case"pHYs":this.decodepHYs();break;default:this.skip(n);break}if(this.offset-a!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?m_(this,n+4,r):this.skip(4)}decodeApngChunk(n,r){const a=this.offset;switch(r!=="fdAT"&&r!=="IDAT"&&this._writingDataChunks&&this.pushDataToFrame(),r){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(n);break;default:this.decodeChunk(n,r),this.offset=a+n;break}if(this.offset-a!==n)throw new Error(`Length mismatch while decoding chunk ${r}`);this._checkCrc?m_(this,n+4,r):this.skip(4)}decodeIHDR(){const n=this._png;n.width=this.readUint32(),n.height=this.readUint32(),n.depth=G$(this.readUint8());const r=this.readUint8();this._colorType=r;let a;switch(r){case ns.GREYSCALE:a=1;break;case ns.TRUECOLOUR:a=3;break;case ns.INDEXED_COLOUR:a=1;break;case ns.GREYSCALE_ALPHA:a=2;break;case ns.TRUECOLOUR_ALPHA:a=4;break;case ns.UNKNOWN:default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=a,this._compressionMethod=this.readUint8(),this._compressionMethod!==ov.DEFLATE)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const n={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(n)}decodePLTE(n){if(n%3!==0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${n}`);const r=n/3;this._hasPalette=!0;const a=[];this._palette=a;for(let s=0;s<r;s++)a.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(n){this._writingDataChunks=!0;const r=n,a=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,a,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodeFDAT(n){this._writingDataChunks=!0;let r=n,a=this.offset+this.byteOffset;if(a+=4,r-=4,this._inflator.push(new Uint8Array(this.buffer,a,r)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(n)}decodetRNS(n){switch(this._colorType){case ns.GREYSCALE:case ns.TRUECOLOUR:{if(n%2!==0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${n}`);if(n/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${n/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(n/2);for(let r=0;r<n/2;r++)this._transparency[r]=this.readUint16();break}case ns.INDEXED_COLOUR:{if(n>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${n} vs ${this._palette.length})`);let r=0;for(;r<n;r++){const a=this.readByte();this._palette[r].push(a)}for(;r<this._palette.length;r++)this._palette[r].push(255);break}case ns.UNKNOWN:case ns.GREYSCALE_ALPHA:case ns.TRUECOLOUR_ALPHA:default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(n){const r=NA(this),a=this.readUint8();if(a!==ov.DEFLATE)throw new Error(`Unsupported iCCP compression method: ${a}`);const s=this.readBytes(n-r.length-2);this._png.iccEmbeddedProfile={name:r,profile:S$(s)}}decodepHYs(){const n=this.readUint32(),r=this.readUint32(),a=this.readByte();this._png.resolution={x:n,y:r,unit:a}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let n=0;n<this._numberOfFrames;n++){const r={sequenceNumber:this._frames[n].sequenceNumber,delayNumber:this._frames[n].delayNumber,delayDenominator:this._frames[n].delayDenominator,data:this._apng.depth===8?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},a=this._frames.at(n);if(a){if(a.data=g_({data:a.data,width:a.width,height:a.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),n===0||a.xOffset===0&&a.yOffset===0&&a.width===this._png.width&&a.height===this._png.height)r.data=a.data;else{const s=this._apng.frames.at(n-1);this.disposeFrame(a,s,r),this.addFrameDataToCanvas(r,a)}this._apng.frames.push(r)}}return this._apng}disposeFrame(n,r,a){switch(n.disposeOp){case dm.NONE:break;case dm.BACKGROUND:for(let s=0;s<this._png.height;s++)for(let l=0;l<this._png.width;l++){const u=(s*n.width+l)*this._png.channels;for(let c=0;c<this._png.channels;c++)a.data[u+c]=0}break;case dm.PREVIOUS:a.data.set(r.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(n,r){const a=1<<this._png.depth,s=(l,u)=>{const c=((l+r.yOffset)*this._png.width+r.xOffset+u)*this._png.channels,h=(l*r.width+u)*this._png.channels;return{index:c,frameIndex:h}};switch(r.blendOp){case uv.SOURCE:for(let l=0;l<r.height;l++)for(let u=0;u<r.width;u++){const{index:c,frameIndex:h}=s(l,u);for(let d=0;d<this._png.channels;d++)n.data[c+d]=r.data[h+d]}break;case uv.OVER:for(let l=0;l<r.height;l++)for(let u=0;u<r.width;u++){const{index:c,frameIndex:h}=s(l,u);for(let d=0;d<this._png.channels;d++){const m=r.data[h+this._png.channels-1]/a,y=d%(this._png.channels-1)===0?1:r.data[h+d],g=Math.floor(m*y+(1-m)*n.data[c+d]);n.data[c+d]+=g}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){var r;if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const n=this._isAnimated?((r=this._frames)==null?void 0:r.at(0)).data:this._inflator.result;if(this._filterMethod!==y_.ADAPTIVE)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===lv.NO_INTERLACE)this._png.data=g_({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(this._interlaceMethod===lv.ADAM7)this._png.data=j$({data:n,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const n=this._inflator.result,r=this._frames.at(-1);r?r.data=n:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:dm.NONE,blendOp:uv.SOURCE,data:n}),this._inflator=new d_,this._writingDataChunks=!1}}function G$(t){if(t!==1&&t!==2&&t!==4&&t!==8&&t!==16)throw new Error(`invalid bit depth: ${t}`);return t}var b_;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"})(b_||(b_={}));function W$(t,e){return new V$(t,e).decode()}var Qt=(function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this})();function cv(){Qt.console&&typeof Qt.console.log=="function"&&Qt.console.log.apply(Qt.console,arguments)}var pr={log:cv,warn:function(t){Qt.console&&(typeof Qt.console.warn=="function"?Qt.console.warn.apply(Qt.console,arguments):cv.call(null,arguments))},error:function(t){Qt.console&&(typeof Qt.console.error=="function"?Qt.console.error.apply(Qt.console,arguments):cv(t))}};function fv(t,e,n){var r=new XMLHttpRequest;r.open("GET",t),r.responseType="blob",r.onload=function(){ac(r.response,e,n)},r.onerror=function(){pr.error("could not download file")},r.send()}function w_(t){var e=new XMLHttpRequest;e.open("HEAD",t,!1);try{e.send()}catch{}return e.status>=200&&e.status<=299}function pm(t){try{t.dispatchEvent(new MouseEvent("click"))}catch{var e=document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),t.dispatchEvent(e)}}var ac=Qt.saveAs||((typeof window>"u"?"undefined":In(window))!=="object"||window!==Qt?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(t,e,n){var r=Qt.URL||Qt.webkitURL,a=document.createElement("a");e=e||t.name||"download",a.download=e,a.rel="noopener",typeof t=="string"?(a.href=t,a.origin!==location.origin?w_(a.href)?fv(t,e,n):pm(a,a.target="_blank"):pm(a)):(a.href=r.createObjectURL(t),setTimeout(function(){r.revokeObjectURL(a.href)},4e4),setTimeout(function(){pm(a)},0))}:"msSaveOrOpenBlob"in navigator?function(t,e,n){if(e=e||t.name||"download",typeof t=="string")if(w_(t))fv(t,e,n);else{var r=document.createElement("a");r.href=t,r.target="_blank",setTimeout(function(){pm(r)})}else navigator.msSaveOrOpenBlob((function(a,s){return s===void 0?s={autoBom:!1}:In(s)!=="object"&&(pr.warn("Deprecated: Expected third argument to be a object"),s={autoBom:!s}),s.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(a.type)?new Blob(["\uFEFF",a],{type:a.type}):a})(t,n),e)}:function(t,e,n,r){if((r=r||open("","_blank"))&&(r.document.title=r.document.body.innerText="downloading..."),typeof t=="string")return fv(t,e,n);var a=t.type==="application/octet-stream",s=/constructor/i.test(Qt.HTMLElement)||Qt.safari,l=/CriOS\/[\d]+/.test(navigator.userAgent);if((l||a&&s)&&(typeof FileReader>"u"?"undefined":In(FileReader))==="object"){var u=new FileReader;u.onloadend=function(){var d=u.result;d=l?d:d.replace(/^data:[^;]*;/,"data:attachment/file;"),r?r.location.href=d:location=d,r=null},u.readAsDataURL(t)}else{var c=Qt.URL||Qt.webkitURL,h=c.createObjectURL(t);r?r.location=h:location.href=h,r=null,setTimeout(function(){c.revokeObjectURL(h)},4e4)}});/**
|
|
1001
|
+
* A class to parse color values
|
|
1002
|
+
* @author Stoyan Stefanov <sstoo@gmail.com>
|
|
1003
|
+
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
|
|
1004
|
+
* @license Use it if you like it
|
|
1005
|
+
*/function CA(t){var e;t=t||"",this.ok=!1,t.charAt(0)=="#"&&(t=t.substr(1,6)),t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[t=(t=t.replace(/ /g,"")).toLowerCase()]||t;for(var n=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(u){return[parseInt(u[1]),parseInt(u[2]),parseInt(u[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(u){return[parseInt(u[1],16),parseInt(u[2],16),parseInt(u[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(u){return[parseInt(u[1]+u[1],16),parseInt(u[2]+u[2],16),parseInt(u[3]+u[3],16)]}}],r=0;r<n.length;r++){var a=n[r].re,s=n[r].process,l=a.exec(t);l&&(e=s(l),this.r=e[0],this.g=e[1],this.b=e[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var u=this.r.toString(16),c=this.g.toString(16),h=this.b.toString(16);return u.length==1&&(u="0"+u),c.length==1&&(c="0"+c),h.length==1&&(h="0"+h),"#"+u+c+h}}var Lm=Qt.atob.bind(Qt),x_=Qt.btoa.bind(Qt);/**
|
|
1006
|
+
* @license
|
|
1007
|
+
* Joseph Myers does not specify a particular license for his work.
|
|
1008
|
+
*
|
|
1009
|
+
* Author: Joseph Myers
|
|
1010
|
+
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
|
|
1011
|
+
*
|
|
1012
|
+
* Modified by: Owen Leong
|
|
1013
|
+
*/function hv(t,e){var n=t[0],r=t[1],a=t[2],s=t[3];n=ri(n,r,a,s,e[0],7,-680876936),s=ri(s,n,r,a,e[1],12,-389564586),a=ri(a,s,n,r,e[2],17,606105819),r=ri(r,a,s,n,e[3],22,-1044525330),n=ri(n,r,a,s,e[4],7,-176418897),s=ri(s,n,r,a,e[5],12,1200080426),a=ri(a,s,n,r,e[6],17,-1473231341),r=ri(r,a,s,n,e[7],22,-45705983),n=ri(n,r,a,s,e[8],7,1770035416),s=ri(s,n,r,a,e[9],12,-1958414417),a=ri(a,s,n,r,e[10],17,-42063),r=ri(r,a,s,n,e[11],22,-1990404162),n=ri(n,r,a,s,e[12],7,1804603682),s=ri(s,n,r,a,e[13],12,-40341101),a=ri(a,s,n,r,e[14],17,-1502002290),n=ai(n,r=ri(r,a,s,n,e[15],22,1236535329),a,s,e[1],5,-165796510),s=ai(s,n,r,a,e[6],9,-1069501632),a=ai(a,s,n,r,e[11],14,643717713),r=ai(r,a,s,n,e[0],20,-373897302),n=ai(n,r,a,s,e[5],5,-701558691),s=ai(s,n,r,a,e[10],9,38016083),a=ai(a,s,n,r,e[15],14,-660478335),r=ai(r,a,s,n,e[4],20,-405537848),n=ai(n,r,a,s,e[9],5,568446438),s=ai(s,n,r,a,e[14],9,-1019803690),a=ai(a,s,n,r,e[3],14,-187363961),r=ai(r,a,s,n,e[8],20,1163531501),n=ai(n,r,a,s,e[13],5,-1444681467),s=ai(s,n,r,a,e[2],9,-51403784),a=ai(a,s,n,r,e[7],14,1735328473),n=ii(n,r=ai(r,a,s,n,e[12],20,-1926607734),a,s,e[5],4,-378558),s=ii(s,n,r,a,e[8],11,-2022574463),a=ii(a,s,n,r,e[11],16,1839030562),r=ii(r,a,s,n,e[14],23,-35309556),n=ii(n,r,a,s,e[1],4,-1530992060),s=ii(s,n,r,a,e[4],11,1272893353),a=ii(a,s,n,r,e[7],16,-155497632),r=ii(r,a,s,n,e[10],23,-1094730640),n=ii(n,r,a,s,e[13],4,681279174),s=ii(s,n,r,a,e[0],11,-358537222),a=ii(a,s,n,r,e[3],16,-722521979),r=ii(r,a,s,n,e[6],23,76029189),n=ii(n,r,a,s,e[9],4,-640364487),s=ii(s,n,r,a,e[12],11,-421815835),a=ii(a,s,n,r,e[15],16,530742520),n=si(n,r=ii(r,a,s,n,e[2],23,-995338651),a,s,e[0],6,-198630844),s=si(s,n,r,a,e[7],10,1126891415),a=si(a,s,n,r,e[14],15,-1416354905),r=si(r,a,s,n,e[5],21,-57434055),n=si(n,r,a,s,e[12],6,1700485571),s=si(s,n,r,a,e[3],10,-1894986606),a=si(a,s,n,r,e[10],15,-1051523),r=si(r,a,s,n,e[1],21,-2054922799),n=si(n,r,a,s,e[8],6,1873313359),s=si(s,n,r,a,e[15],10,-30611744),a=si(a,s,n,r,e[6],15,-1560198380),r=si(r,a,s,n,e[13],21,1309151649),n=si(n,r,a,s,e[4],6,-145523070),s=si(s,n,r,a,e[11],10,-1120210379),a=si(a,s,n,r,e[2],15,718787259),r=si(r,a,s,n,e[9],21,-343485551),t[0]=Nu(n,t[0]),t[1]=Nu(r,t[1]),t[2]=Nu(a,t[2]),t[3]=Nu(s,t[3])}function Vg(t,e,n,r,a,s){return e=Nu(Nu(e,t),Nu(r,s)),Nu(e<<a|e>>>32-a,n)}function ri(t,e,n,r,a,s,l){return Vg(e&n|~e&r,t,e,a,s,l)}function ai(t,e,n,r,a,s,l){return Vg(e&r|n&~r,t,e,a,s,l)}function ii(t,e,n,r,a,s,l){return Vg(e^n^r,t,e,a,s,l)}function si(t,e,n,r,a,s,l){return Vg(n^(e|~r),t,e,a,s,l)}function TA(t){var e,n=t.length,r=[1732584193,-271733879,-1732584194,271733878];for(e=64;e<=t.length;e+=64)hv(r,Y$(t.substring(e-64,e)));t=t.substring(e-64);var a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(e=0;e<t.length;e++)a[e>>2]|=t.charCodeAt(e)<<(e%4<<3);if(a[e>>2]|=128<<(e%4<<3),e>55)for(hv(r,a),e=0;e<16;e++)a[e]=0;return a[14]=8*n,hv(r,a),r}function Y$(t){var e,n=[];for(e=0;e<64;e+=4)n[e>>2]=t.charCodeAt(e)+(t.charCodeAt(e+1)<<8)+(t.charCodeAt(e+2)<<16)+(t.charCodeAt(e+3)<<24);return n}var S_="0123456789abcdef".split("");function K$(t){for(var e="",n=0;n<4;n++)e+=S_[t>>8*n+4&15]+S_[t>>8*n&15];return e}function J$(t){return String.fromCharCode(255&t,(65280&t)>>8,(16711680&t)>>16,(4278190080&t)>>24)}function xy(t){return TA(t).map(J$).join("")}var X$=(function(t){for(var e=0;e<t.length;e++)t[e]=K$(t[e]);return t.join("")})(TA("hello"))!="5d41402abc4b2a76b9719d911017c592";function Nu(t,e){if(X$){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}return t+e&4294967295}/**
|
|
1014
|
+
* @license
|
|
1015
|
+
* FPDF is released under a permissive license: there is no usage restriction.
|
|
1016
|
+
* You may embed it freely in your application (commercial or not), with or
|
|
1017
|
+
* without modifications.
|
|
1018
|
+
*
|
|
1019
|
+
* Reference: http://www.fpdf.org/en/script/script37.php
|
|
1020
|
+
*/function Sy(t,e){var n,r,a,s;if(t!==n){for(var l=(a=t,s=1+(256/t.length|0),new Array(s+1).join(a)),u=[],c=0;c<256;c++)u[c]=c;var h=0;for(c=0;c<256;c++){var d=u[c];h=(h+d+l.charCodeAt(c))%256,u[c]=u[h],u[h]=d}n=t,r=u}else u=r;var m=e.length,y=0,g=0,x="";for(c=0;c<m;c++)g=(g+(d=u[y=(y+1)%256]))%256,u[y]=u[g],u[g]=d,l=u[(u[y]+u[g])%256],x+=String.fromCharCode(e.charCodeAt(c)^l);return x}/**
|
|
1021
|
+
* @license
|
|
1022
|
+
* Licensed under the MIT License.
|
|
1023
|
+
* http://opensource.org/licenses/mit-license
|
|
1024
|
+
* Author: Owen Leong (@owenl131)
|
|
1025
|
+
* Date: 15 Oct 2020
|
|
1026
|
+
* References:
|
|
1027
|
+
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
|
|
1028
|
+
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
|
|
1029
|
+
* http://www.fpdf.org/en/script/script37.php
|
|
1030
|
+
*/var __={print:4,modify:8,copy:16,"annot-forms":32};function Ef(t,e,n,r){this.v=1,this.r=2;var a=192;t.forEach(function(u){if(__.perm!==void 0)throw new Error("Invalid permission: "+u);a+=__[u]}),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var s=(e+this.padding).substr(0,32),l=(n+this.padding).substr(0,32);this.O=this.processOwnerPassword(s,l),this.P=-(1+(255^a)),this.encryptionKey=xy(s+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(r)).substr(0,5),this.U=Sy(this.encryptionKey,this.padding)}function Af(t){if(/[^\u0000-\u00ff]/.test(t))throw new Error("Invalid PDF Name Object: "+t+", Only accept ASCII characters.");for(var e="",n=t.length,r=0;r<n;r++){var a=t.charCodeAt(r);e+=a<33||a===35||a===37||a===40||a===41||a===47||a===60||a===62||a===91||a===93||a===123||a===125||a>126?"#"+("0"+a.toString(16)).slice(-2):t[r]}return e}function E_(t){if(In(t)!=="object")throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var e={};this.subscribe=function(n,r,a){if(a=a||!1,typeof n!="string"||typeof r!="function"||typeof a!="boolean")throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");e.hasOwnProperty(n)||(e[n]={});var s=Math.random().toString(35);return e[n][s]=[r,!!a],s},this.unsubscribe=function(n){for(var r in e)if(e[r][n])return delete e[r][n],Object.keys(e[r]).length===0&&delete e[r],!0;return!1},this.publish=function(n){if(e.hasOwnProperty(n)){var r=Array.prototype.slice.call(arguments,1),a=[];for(var s in e[n]){var l=e[n][s];try{l[0].apply(t,r)}catch(u){Qt.console&&pr.error("jsPDF PubSub Error",u.message,u)}l[1]&&a.push(s)}a.length&&a.forEach(this.unsubscribe)}},this.getTopics=function(){return e}}function pg(t){if(!(this instanceof pg))return new pg(t);var e="opacity,stroke-opacity".split(",");for(var n in t)t.hasOwnProperty(n)&&e.indexOf(n)>=0&&(this[n]=t[n]);this.id="",this.objectNumber=-1}function LA(t,e){this.gState=t,this.matrix=e,this.id="",this.objectNumber=-1}function ic(t,e,n,r,a){if(!(this instanceof ic))return new ic(t,e,n,r,a);this.type=t==="axial"?2:3,this.coords=e,this.colors=n,LA.call(this,r,a)}function Tf(t,e,n,r,a){if(!(this instanceof Tf))return new Tf(t,e,n,r,a);this.boundingBox=t,this.xStep=e,this.yStep=n,this.stream="",this.cloneIndex=0,LA.call(this,r,a)}function jt(t){var e,n=typeof arguments[0]=="string"?arguments[0]:"p",r=arguments[1],a=arguments[2],s=arguments[3],l=[],u=1,c=16,h="S",d=null;In(t=t||{})==="object"&&(n=t.orientation,r=t.unit||r,a=t.format||a,s=t.compress||t.compressPdf||s,(d=t.encryption||null)!==null&&(d.userPassword=d.userPassword||"",d.ownerPassword=d.ownerPassword||"",d.userPermissions=d.userPermissions||[]),u=typeof t.userUnit=="number"?Math.abs(t.userUnit):1,t.precision!==void 0&&(e=t.precision),t.floatPrecision!==void 0&&(c=t.floatPrecision),h=t.defaultPathOperation||"S"),l=t.filters||(s===!0?["FlateEncode"]:l),r=r||"mm",n=(""+(n||"P")).toLowerCase();var m=t.putOnlyUsedFonts||!1,y={},g={internal:{},__private__:{}};g.__private__.PubSub=E_;var x="1.3",_=g.__private__.getPdfVersion=function(){return x};g.__private__.setPdfVersion=function(C){x=C};var N={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};g.__private__.getPageFormats=function(){return N};var A=g.__private__.getPageFormat=function(C){return N[C]};a=a||"a4";var j="compat",L="advanced",R=j;function I(){this.saveGraphicsState(),ne(new At(kt,0,0,-kt,0,Ko()*kt).toString()+" cm"),this.setFontSize(this.getFontSize()/kt),h="n",R=L}function ee(){this.restoreGraphicsState(),h="S",R=j}var G=g.__private__.combineFontStyleAndFontWeight=function(C,q){if(C=="bold"&&q=="normal"||C=="bold"&&q==400||C=="normal"&&q=="italic"||C=="bold"&&q=="italic")throw new Error("Invalid Combination of fontweight and fontstyle");return q&&(C=q==400||q==="normal"?C==="italic"?"italic":"normal":q!=700&&q!=="bold"||C!=="normal"?(q==700?"bold":q)+""+C:"bold"),C};g.advancedAPI=function(C){var q=R===j;return q&&I.call(this),typeof C!="function"||(C(this),q&&ee.call(this)),this},g.compatAPI=function(C){var q=R===L;return q&&ee.call(this),typeof C!="function"||(C(this),q&&I.call(this)),this},g.isAdvancedAPI=function(){return R===L};var P,B=function(C){if(R!==L)throw new Error(C+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},X=g.roundToPrecision=g.__private__.roundToPrecision=function(C,q){var ue=e||q;if(isNaN(C)||isNaN(ue))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return C.toFixed(ue).replace(/0+$/,"")};P=g.hpf=g.__private__.hpf=typeof c=="number"?function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.hpf");return X(C,c)}:c==="smart"?function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.hpf");return X(C,C>-1&&C<1?16:5)}:function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.hpf");return X(C,16)};var F=g.f2=g.__private__.f2=function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.f2");return X(C,2)},$=g.__private__.f3=function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.f3");return X(C,3)},K=g.scale=g.__private__.scale=function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.scale");return R===j?C*kt:R===L?C:void 0},Y=function(C){return K((function(q){return R===j?Ko()-q:R===L?q:void 0})(C))};g.__private__.setPrecision=g.setPrecision=function(C){typeof parseInt(C,10)=="number"&&(e=parseInt(C,10))};var he,te="00000000000000000000000000000000",oe=g.__private__.getFileId=function(){return te},le=g.__private__.setFileId=function(C){return te=C!==void 0&&/^[a-fA-F0-9]{32}$/.test(C)?C.toUpperCase():te.split("").map(function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))}).join(""),d!==null&&(Dr=new Ef(d.userPermissions,d.userPassword,d.ownerPassword,te)),te};g.setFileId=function(C){return le(C),this},g.getFileId=function(){return oe()};var pe=g.__private__.convertDateToPDFDate=function(C){var q=C.getTimezoneOffset(),ue=q<0?"+":"-",ye=Math.floor(Math.abs(q/60)),_e=Math.abs(q%60),Ue=[ue,Z(ye),"'",Z(_e),"'"].join("");return["D:",C.getFullYear(),Z(C.getMonth()+1),Z(C.getDate()),Z(C.getHours()),Z(C.getMinutes()),Z(C.getSeconds()),Ue].join("")},Ne=g.__private__.convertPDFDateToDate=function(C){var q=parseInt(C.substr(2,4),10),ue=parseInt(C.substr(6,2),10)-1,ye=parseInt(C.substr(8,2),10),_e=parseInt(C.substr(10,2),10),Ue=parseInt(C.substr(12,2),10),Xe=parseInt(C.substr(14,2),10);return new Date(q,ue,ye,_e,Ue,Xe,0)},U=g.__private__.setCreationDate=function(C){var q;if(C===void 0&&(C=new Date),C instanceof Date)q=pe(C);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(C))throw new Error("Invalid argument passed to jsPDF.setCreationDate");q=C}return he=q},O=g.__private__.getCreationDate=function(C){var q=he;return C==="jsDate"&&(q=Ne(he)),q};g.setCreationDate=function(C){return U(C),this},g.getCreationDate=function(C){return O(C)};var V,Z=g.__private__.padd2=function(C){return("0"+parseInt(C)).slice(-2)},ie=g.__private__.padd2Hex=function(C){return("00"+(C=C.toString())).substr(C.length)},z=0,se=[],ge=[],xe=0,Re=[],De=[],qe=!1,Pe=ge;g.__private__.setCustomOutputDestination=function(C){qe=!0,Pe=C};var Ke=function(C){qe||(Pe=C)};g.__private__.resetCustomOutputDestination=function(){qe=!1,Pe=ge};var ne=g.__private__.out=function(C){return C=C.toString(),xe+=C.length+1,Pe.push(C),Pe},We=g.__private__.write=function(C){return ne(arguments.length===1?C.toString():Array.prototype.join.call(arguments," "))},it=g.__private__.getArrayBuffer=function(C){for(var q=C.length,ue=new ArrayBuffer(q),ye=new Uint8Array(ue);q--;)ye[q]=C.charCodeAt(q);return ue},tt=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];g.__private__.getStandardFonts=function(){return tt};var Ve=t.fontSize||16;g.__private__.setFontSize=g.setFontSize=function(C){return Ve=R===L?C/kt:C,this};var gt,ut=g.__private__.getFontSize=g.getFontSize=function(){return R===j?Ve:Ve*kt},Ot=t.R2L||!1;g.__private__.setR2L=g.setR2L=function(C){return Ot=C,this},g.__private__.getR2L=g.getR2L=function(){return Ot};var Ct,en=g.__private__.setZoomMode=function(C){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(C))gt=C;else if(isNaN(C)){if([void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(C)===-1)throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+C+'" is not recognized.');gt=C}else gt=parseInt(C,10)};g.__private__.getZoomMode=function(){return gt};var tn,Bt=g.__private__.setPageMode=function(C){if([void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(C)==-1)throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+C+'" is not recognized.');Ct=C};g.__private__.getPageMode=function(){return Ct};var pn=g.__private__.setLayoutMode=function(C){if([void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(C)==-1)throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+C+'" is not recognized.');tn=C};g.__private__.getLayoutMode=function(){return tn},g.__private__.setDisplayMode=g.setDisplayMode=function(C,q,ue){return en(C),pn(q),Bt(ue),this};var an={title:"",subject:"",author:"",keywords:"",creator:""};g.__private__.getDocumentProperty=function(C){if(Object.keys(an).indexOf(C)===-1)throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return an[C]},g.__private__.getDocumentProperties=function(){return an},g.__private__.setDocumentProperties=g.setProperties=g.setDocumentProperties=function(C){for(var q in an)an.hasOwnProperty(q)&&C[q]&&(an[q]=C[q]);return this},g.__private__.setDocumentProperty=function(C,q){if(Object.keys(an).indexOf(C)===-1)throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return an[C]=q};var lt,kt,Et,gr,fn,Dt={},Tt={},mn=[],Lt={},Hn={},Ut={},qt={},kn=null,nn=0,_t=[],Sn=new E_(g),Xa=t.hotfixes||[],sa={},ci={},ma=[],At=function C(q,ue,ye,_e,Ue,Xe){if(!(this instanceof C))return new C(q,ue,ye,_e,Ue,Xe);isNaN(q)&&(q=1),isNaN(ue)&&(ue=0),isNaN(ye)&&(ye=0),isNaN(_e)&&(_e=1),isNaN(Ue)&&(Ue=0),isNaN(Xe)&&(Xe=0),this._matrix=[q,ue,ye,_e,Ue,Xe]};Object.defineProperty(At.prototype,"sx",{get:function(){return this._matrix[0]},set:function(C){this._matrix[0]=C}}),Object.defineProperty(At.prototype,"shy",{get:function(){return this._matrix[1]},set:function(C){this._matrix[1]=C}}),Object.defineProperty(At.prototype,"shx",{get:function(){return this._matrix[2]},set:function(C){this._matrix[2]=C}}),Object.defineProperty(At.prototype,"sy",{get:function(){return this._matrix[3]},set:function(C){this._matrix[3]=C}}),Object.defineProperty(At.prototype,"tx",{get:function(){return this._matrix[4]},set:function(C){this._matrix[4]=C}}),Object.defineProperty(At.prototype,"ty",{get:function(){return this._matrix[5]},set:function(C){this._matrix[5]=C}}),Object.defineProperty(At.prototype,"a",{get:function(){return this._matrix[0]},set:function(C){this._matrix[0]=C}}),Object.defineProperty(At.prototype,"b",{get:function(){return this._matrix[1]},set:function(C){this._matrix[1]=C}}),Object.defineProperty(At.prototype,"c",{get:function(){return this._matrix[2]},set:function(C){this._matrix[2]=C}}),Object.defineProperty(At.prototype,"d",{get:function(){return this._matrix[3]},set:function(C){this._matrix[3]=C}}),Object.defineProperty(At.prototype,"e",{get:function(){return this._matrix[4]},set:function(C){this._matrix[4]=C}}),Object.defineProperty(At.prototype,"f",{get:function(){return this._matrix[5]},set:function(C){this._matrix[5]=C}}),Object.defineProperty(At.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(At.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(At.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(At.prototype,"isIdentity",{get:function(){return this.sx===1&&this.shy===0&&this.shx===0&&this.sy===1&&this.tx===0&&this.ty===0}}),At.prototype.join=function(C){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(P).join(C)},At.prototype.multiply=function(C){var q=C.sx*this.sx+C.shy*this.shx,ue=C.sx*this.shy+C.shy*this.sy,ye=C.shx*this.sx+C.sy*this.shx,_e=C.shx*this.shy+C.sy*this.sy,Ue=C.tx*this.sx+C.ty*this.shx+this.tx,Xe=C.tx*this.shy+C.ty*this.sy+this.ty;return new At(q,ue,ye,_e,Ue,Xe)},At.prototype.decompose=function(){var C=this.sx,q=this.shy,ue=this.shx,ye=this.sy,_e=this.tx,Ue=this.ty,Xe=Math.sqrt(C*C+q*q),pt=(C/=Xe)*ue+(q/=Xe)*ye;ue-=C*pt,ye-=q*pt;var vt=Math.sqrt(ue*ue+ye*ye);return pt/=vt,C*(ye/=vt)<q*(ue/=vt)&&(C=-C,q=-q,pt=-pt,Xe=-Xe),{scale:new At(Xe,0,0,vt,0,0),translate:new At(1,0,0,1,_e,Ue),rotate:new At(C,q,-q,C,0,0),skew:new At(1,0,pt,1,0,0)}},At.prototype.toString=function(C){return this.join(" ")},At.prototype.inversed=function(){var C=this.sx,q=this.shy,ue=this.shx,ye=this.sy,_e=this.tx,Ue=this.ty,Xe=1/(C*ye-q*ue),pt=ye*Xe,vt=-q*Xe,Xt=-ue*Xe,sn=C*Xe;return new At(pt,vt,Xt,sn,-pt*_e-Xt*Ue,-vt*_e-sn*Ue)},At.prototype.applyToPoint=function(C){var q=C.x*this.sx+C.y*this.shx+this.tx,ue=C.x*this.shy+C.y*this.sy+this.ty;return new Wo(q,ue)},At.prototype.applyToRectangle=function(C){var q=this.applyToPoint(C),ue=this.applyToPoint(new Wo(C.x+C.w,C.y+C.h));return new Yo(q.x,q.y,ue.x-q.x,ue.y-q.y)},At.prototype.clone=function(){var C=this.sx,q=this.shy,ue=this.shx,ye=this.sy,_e=this.tx,Ue=this.ty;return new At(C,q,ue,ye,_e,Ue)},g.Matrix=At;var yi=g.matrixMult=function(C,q){return q.multiply(C)},bi=new At(1,0,0,1,0,0);g.unitMatrix=g.identityMatrix=bi;var Ba=function(C,q){if(!Hn[C]){var ue=(q instanceof ic?"Sh":"P")+(Object.keys(Lt).length+1).toString(10);q.id=ue,Hn[C]=ue,Lt[ue]=q,Sn.publish("addPattern",q)}};g.ShadingPattern=ic,g.TilingPattern=Tf,g.addShadingPattern=function(C,q){return B("addShadingPattern()"),Ba(C,q),this},g.beginTilingPattern=function(C){B("beginTilingPattern()"),Os(C.boundingBox[0],C.boundingBox[1],C.boundingBox[2]-C.boundingBox[0],C.boundingBox[3]-C.boundingBox[1],C.matrix)},g.endTilingPattern=function(C,q){B("endTilingPattern()"),q.stream=De[V].join(`
|
|
1031
|
+
`),Ba(C,q),Sn.publish("endTilingPattern",q),ma.pop().restore()};var de,ve=g.__private__.newObject=function(){var C=Ee();return Be(C,!0),C},Ee=g.__private__.newObjectDeferred=function(){return z++,se[z]=function(){return xe},z},Be=function(C,q){return q=typeof q=="boolean"&&q,se[C]=xe,q&&ne(C+" 0 obj"),C},Je=g.__private__.newAdditionalObject=function(){var C={objId:Ee(),content:""};return Re.push(C),C},at=Ee(),et=Ee(),ct=g.__private__.decodeColorString=function(C){var q=C.split(" ");if(q.length!==2||q[1]!=="g"&&q[1]!=="G")q.length!==5||q[4]!=="k"&&q[4]!=="K"||(q=[(1-q[0])*(1-q[3]),(1-q[1])*(1-q[3]),(1-q[2])*(1-q[3]),"r"]);else{var ue=parseFloat(q[0]);q=[ue,ue,ue,"r"]}for(var ye="#",_e=0;_e<3;_e++)ye+=("0"+Math.floor(255*parseFloat(q[_e])).toString(16)).slice(-2);return ye},Qe=g.__private__.encodeColorString=function(C){var q;typeof C=="string"&&(C={ch1:C});var ue=C.ch1,ye=C.ch2,_e=C.ch3,Ue=C.ch4,Xe=C.pdfColorType==="draw"?["G","RG","K"]:["g","rg","k"];if(typeof ue=="string"&&ue.charAt(0)!=="#"){var pt=new CA(ue);if(pt.ok)ue=pt.toHex();else if(!/^\d*\.?\d*$/.test(ue))throw new Error('Invalid color "'+ue+'" passed to jsPDF.encodeColorString.')}if(typeof ue=="string"&&/^#[0-9A-Fa-f]{3}$/.test(ue)&&(ue="#"+ue[1]+ue[1]+ue[2]+ue[2]+ue[3]+ue[3]),typeof ue=="string"&&/^#[0-9A-Fa-f]{6}$/.test(ue)){var vt=parseInt(ue.substr(1),16);ue=vt>>16&255,ye=vt>>8&255,_e=255&vt}if(ye===void 0||Ue===void 0&&ue===ye&&ye===_e)q=typeof ue=="string"?ue+" "+Xe[0]:C.precision===2?F(ue/255)+" "+Xe[0]:$(ue/255)+" "+Xe[0];else if(Ue===void 0||In(Ue)==="object"){if(Ue&&!isNaN(Ue.a)&&Ue.a===0)return["1.","1.","1.",Xe[1]].join(" ");q=typeof ue=="string"?[ue,ye,_e,Xe[1]].join(" "):C.precision===2?[F(ue/255),F(ye/255),F(_e/255),Xe[1]].join(" "):[$(ue/255),$(ye/255),$(_e/255),Xe[1]].join(" ")}else q=typeof ue=="string"?[ue,ye,_e,Ue,Xe[2]].join(" "):C.precision===2?[F(ue),F(ye),F(_e),F(Ue),Xe[2]].join(" "):[$(ue),$(ye),$(_e),$(Ue),Xe[2]].join(" ");return q},st=g.__private__.getFilters=function(){return l},St=g.__private__.putStream=function(C){var q=(C=C||{}).data||"",ue=C.filters||st(),ye=C.alreadyAppliedFilters||[],_e=C.addLength1||!1,Ue=q.length,Xe=C.objectId,pt=function(ur){return ur};if(d!==null&&Xe===void 0)throw new Error("ObjectId must be passed to putStream for file encryption");d!==null&&(pt=Dr.encryptor(Xe,0));var vt={};ue===!0&&(ue=["FlateEncode"]);var Xt=C.additionalKeyValues||[],sn=(vt=jt.API.processDataByFilters!==void 0?jt.API.processDataByFilters(q,ue):{data:q,reverseChain:[]}).reverseChain+(Array.isArray(ye)?ye.join(" "):ye.toString());if(vt.data.length!==0&&(Xt.push({key:"Length",value:vt.data.length}),_e===!0&&Xt.push({key:"Length1",value:Ue})),sn.length!=0)if(sn.split("/").length-1==1)Xt.push({key:"Filter",value:sn});else{Xt.push({key:"Filter",value:"["+sn+"]"});for(var An=0;An<Xt.length;An+=1)if(Xt[An].key==="DecodeParms"){for(var Ur=[],Qn=0;Qn<vt.reverseChain.split("/").length-1;Qn+=1)Ur.push("null");Ur.push(Xt[An].value),Xt[An].value="["+Ur.join(" ")+"]"}}ne("<<");for(var Jn=0;Jn<Xt.length;Jn++)ne("/"+Xt[Jn].key+" "+Xt[Jn].value);ne(">>"),vt.data.length!==0&&(ne("stream"),ne(pt(vt.data)),ne("endstream"))},Ht=g.__private__.putPage=function(C){var q=C.number,ue=C.data,ye=C.objId,_e=C.contentsObjId;Be(ye,!0),ne("<</Type /Page"),ne("/Parent "+C.rootDictionaryObjId+" 0 R"),ne("/Resources "+C.resourceDictionaryObjId+" 0 R"),ne("/MediaBox ["+parseFloat(P(C.mediaBox.bottomLeftX))+" "+parseFloat(P(C.mediaBox.bottomLeftY))+" "+P(C.mediaBox.topRightX)+" "+P(C.mediaBox.topRightY)+"]"),C.cropBox!==null&&ne("/CropBox ["+P(C.cropBox.bottomLeftX)+" "+P(C.cropBox.bottomLeftY)+" "+P(C.cropBox.topRightX)+" "+P(C.cropBox.topRightY)+"]"),C.bleedBox!==null&&ne("/BleedBox ["+P(C.bleedBox.bottomLeftX)+" "+P(C.bleedBox.bottomLeftY)+" "+P(C.bleedBox.topRightX)+" "+P(C.bleedBox.topRightY)+"]"),C.trimBox!==null&&ne("/TrimBox ["+P(C.trimBox.bottomLeftX)+" "+P(C.trimBox.bottomLeftY)+" "+P(C.trimBox.topRightX)+" "+P(C.trimBox.topRightY)+"]"),C.artBox!==null&&ne("/ArtBox ["+P(C.artBox.bottomLeftX)+" "+P(C.artBox.bottomLeftY)+" "+P(C.artBox.topRightX)+" "+P(C.artBox.topRightY)+"]"),typeof C.userUnit=="number"&&C.userUnit!==1&&ne("/UserUnit "+C.userUnit),Sn.publish("putPage",{objId:ye,pageContext:_t[q],pageNumber:q,page:ue}),ne("/Contents "+_e+" 0 R"),ne(">>"),ne("endobj");var Ue=ue.join(`
|
|
1032
|
+
`);return R===L&&(Ue+=`
|
|
1033
|
+
Q`),Be(_e,!0),St({data:Ue,filters:st(),objectId:_e}),ne("endobj"),ye},dt=g.__private__.putPages=function(){var C,q,ue=[];for(C=1;C<=nn;C++)_t[C].objId=Ee(),_t[C].contentsObjId=Ee();for(C=1;C<=nn;C++)ue.push(Ht({number:C,data:De[C],objId:_t[C].objId,contentsObjId:_t[C].contentsObjId,mediaBox:_t[C].mediaBox,cropBox:_t[C].cropBox,bleedBox:_t[C].bleedBox,trimBox:_t[C].trimBox,artBox:_t[C].artBox,userUnit:_t[C].userUnit,rootDictionaryObjId:at,resourceDictionaryObjId:et}));Be(at,!0),ne("<</Type /Pages");var ye="/Kids [";for(q=0;q<nn;q++)ye+=ue[q]+" 0 R ";ne(ye+"]"),ne("/Count "+nn),ne(">>"),ne("endobj"),Sn.publish("postPutPages")},Yt=function(C){Sn.publish("putFont",{font:C,out:ne,newObject:ve,putStream:St}),C.isAlreadyPutted!==!0&&(C.objectNumber=ve(),ne("<<"),ne("/Type /Font"),ne("/BaseFont /"+Af(C.postScriptName)),ne("/Subtype /Type1"),typeof C.encoding=="string"&&ne("/Encoding /"+C.encoding),ne("/FirstChar 32"),ne("/LastChar 255"),ne(">>"),ne("endobj"))},bn=function(C){C.objectNumber=ve();var q=[];q.push({key:"Type",value:"/XObject"}),q.push({key:"Subtype",value:"/Form"}),q.push({key:"BBox",value:"["+[P(C.x),P(C.y),P(C.x+C.width),P(C.y+C.height)].join(" ")+"]"}),q.push({key:"Matrix",value:"["+C.matrix.toString()+"]"});var ue=C.pages[1].join(`
|
|
1034
|
+
`);St({data:ue,additionalKeyValues:q,objectId:C.objectNumber}),ne("endobj")},Bn=function(C,q){q||(q=21);var ue=ve(),ye=(function(Xe,pt){var vt,Xt=[],sn=1/(pt-1);for(vt=0;vt<1;vt+=sn)Xt.push(vt);if(Xt.push(1),Xe[0].offset!=0){var An={offset:0,color:Xe[0].color};Xe.unshift(An)}if(Xe[Xe.length-1].offset!=1){var Ur={offset:1,color:Xe[Xe.length-1].color};Xe.push(Ur)}for(var Qn="",Jn=0,ur=0;ur<Xt.length;ur++){for(vt=Xt[ur];vt>Xe[Jn+1].offset;)Jn++;var yr=Xe[Jn].offset,br=(vt-yr)/(Xe[Jn+1].offset-yr),ja=Xe[Jn].color,Ps=Xe[Jn+1].color;Qn+=ie(Math.round((1-br)*ja[0]+br*Ps[0]).toString(16))+ie(Math.round((1-br)*ja[1]+br*Ps[1]).toString(16))+ie(Math.round((1-br)*ja[2]+br*Ps[2]).toString(16))}return Qn.trim()})(C.colors,q),_e=[];_e.push({key:"FunctionType",value:"0"}),_e.push({key:"Domain",value:"[0.0 1.0]"}),_e.push({key:"Size",value:"["+q+"]"}),_e.push({key:"BitsPerSample",value:"8"}),_e.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),_e.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),St({data:ye,additionalKeyValues:_e,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:ue}),ne("endobj"),C.objectNumber=ve(),ne("<< /ShadingType "+C.type),ne("/ColorSpace /DeviceRGB");var Ue="/Coords ["+P(parseFloat(C.coords[0]))+" "+P(parseFloat(C.coords[1]))+" ";C.type===2?Ue+=P(parseFloat(C.coords[2]))+" "+P(parseFloat(C.coords[3])):Ue+=P(parseFloat(C.coords[2]))+" "+P(parseFloat(C.coords[3]))+" "+P(parseFloat(C.coords[4]))+" "+P(parseFloat(C.coords[5])),ne(Ue+="]"),C.matrix&&ne("/Matrix ["+C.matrix.toString()+"]"),ne("/Function "+ue+" 0 R"),ne("/Extend [true true]"),ne(">>"),ne("endobj")},_n=function(C,q){var ue=Ee(),ye=ve();q.push({resourcesOid:ue,objectOid:ye}),C.objectNumber=ye;var _e=[];_e.push({key:"Type",value:"/Pattern"}),_e.push({key:"PatternType",value:"1"}),_e.push({key:"PaintType",value:"1"}),_e.push({key:"TilingType",value:"1"}),_e.push({key:"BBox",value:"["+C.boundingBox.map(P).join(" ")+"]"}),_e.push({key:"XStep",value:P(C.xStep)}),_e.push({key:"YStep",value:P(C.yStep)}),_e.push({key:"Resources",value:ue+" 0 R"}),C.matrix&&_e.push({key:"Matrix",value:"["+C.matrix.toString()+"]"}),St({data:C.stream,additionalKeyValues:_e,objectId:C.objectNumber}),ne("endobj")},En=function(C){for(var q in C.objectNumber=ve(),ne("<<"),C)switch(q){case"opacity":ne("/ca "+F(C[q]));break;case"stroke-opacity":ne("/CA "+F(C[q]))}ne(">>"),ne("endobj")},lr=function(C){Be(C.resourcesOid,!0),ne("<<"),ne("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),(function(){for(var q in ne("/Font <<"),Dt)Dt.hasOwnProperty(q)&&(m===!1||m===!0&&y.hasOwnProperty(q))&&ne("/"+q+" "+Dt[q].objectNumber+" 0 R");ne(">>")})(),(function(){if(Object.keys(Lt).length>0){for(var q in ne("/Shading <<"),Lt)Lt.hasOwnProperty(q)&&Lt[q]instanceof ic&&Lt[q].objectNumber>=0&&ne("/"+q+" "+Lt[q].objectNumber+" 0 R");Sn.publish("putShadingPatternDict"),ne(">>")}})(),(function(q){if(Object.keys(Lt).length>0){for(var ue in ne("/Pattern <<"),Lt)Lt.hasOwnProperty(ue)&&Lt[ue]instanceof g.TilingPattern&&Lt[ue].objectNumber>=0&&Lt[ue].objectNumber<q&&ne("/"+ue+" "+Lt[ue].objectNumber+" 0 R");Sn.publish("putTilingPatternDict"),ne(">>")}})(C.objectOid),(function(){if(Object.keys(Ut).length>0){var q;for(q in ne("/ExtGState <<"),Ut)Ut.hasOwnProperty(q)&&Ut[q].objectNumber>=0&&ne("/"+q+" "+Ut[q].objectNumber+" 0 R");Sn.publish("putGStateDict"),ne(">>")}})(),(function(){for(var q in ne("/XObject <<"),sa)sa.hasOwnProperty(q)&&sa[q].objectNumber>=0&&ne("/"+q+" "+sa[q].objectNumber+" 0 R");Sn.publish("putXobjectDict"),ne(">>")})(),ne(">>"),ne("endobj")},wn=function(C){Tt[C.fontName]=Tt[C.fontName]||{},Tt[C.fontName][C.fontStyle]=C.id},zi=function(C,q,ue,ye,_e){var Ue={id:"F"+(Object.keys(Dt).length+1).toString(10),postScriptName:C,fontName:q,fontStyle:ue,encoding:ye,isStandardFont:_e||!1,metadata:{}};return Sn.publish("addFont",{font:Ue,instance:this}),Dt[Ue.id]=Ue,wn(Ue),Ue.id},Nr=g.__private__.pdfEscape=g.pdfEscape=function(C,q){return(function(ue,ye){var _e,Ue,Xe,pt,vt,Xt,sn,An,Ur;if(Xe=(ye=ye||{}).sourceEncoding||"Unicode",vt=ye.outputEncoding,(ye.autoencode||vt)&&Dt[lt].metadata&&Dt[lt].metadata[Xe]&&Dt[lt].metadata[Xe].encoding&&(pt=Dt[lt].metadata[Xe].encoding,!vt&&Dt[lt].encoding&&(vt=Dt[lt].encoding),!vt&&pt.codePages&&(vt=pt.codePages[0]),typeof vt=="string"&&(vt=pt[vt]),vt)){for(sn=!1,Xt=[],_e=0,Ue=ue.length;_e<Ue;_e++)(An=vt[ue.charCodeAt(_e)])?Xt.push(String.fromCharCode(An)):Xt.push(ue[_e]),Xt[_e].charCodeAt(0)>>8&&(sn=!0);ue=Xt.join("")}for(_e=ue.length;sn===void 0&&_e!==0;)ue.charCodeAt(_e-1)>>8&&(sn=!0),_e--;if(!sn)return ue;for(Xt=ye.noBOM?[]:[254,255],_e=0,Ue=ue.length;_e<Ue;_e++){if((Ur=(An=ue.charCodeAt(_e))>>8)>>8)throw new Error("Character at position "+_e+" of string '"+ue+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");Xt.push(Ur),Xt.push(An-(Ur<<8))}return String.fromCharCode.apply(void 0,Xt)})(C,q).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},oa=g.__private__.beginPage=function(C){De[++nn]=[],_t[nn]={objId:0,contentsObjId:0,userUnit:Number(u),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(C[0]),topRightY:Number(C[1])}},Ns(nn),Ke(De[V])},la=function(C,q){var ue,ye,_e;switch(n=q||n,typeof C=="string"&&(ue=A(C.toLowerCase()),Array.isArray(ue)&&(ye=ue[0],_e=ue[1])),Array.isArray(C)&&(ye=C[0]*kt,_e=C[1]*kt),isNaN(ye)&&(ye=a[0],_e=a[1]),(ye>14400||_e>14400)&&(pr.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),ye=Math.min(14400,ye),_e=Math.min(14400,_e)),a=[ye,_e],n.substr(0,1)){case"l":_e>ye&&(a=[_e,ye]);break;case"p":ye>_e&&(a=[_e,ye])}oa(a),ku(Ft),ne(Ls),Yi!==0&&ne(Yi+" J"),Ki!==0&&ne(Ki+" j"),Sn.publish("addPage",{pageNumber:nn})},Ca=function(C){C>0&&C<=nn&&(De.splice(C,1),_t.splice(C,1),nn--,V>nn&&(V=nn),this.setPage(V))},Ns=function(C){C>0&&C<=nn&&(V=C)},Za=g.__private__.getNumberOfPages=g.getNumberOfPages=function(){return De.length-1},Cs=function(C,q,ue){var ye,_e=void 0;return ue=ue||{},C=C!==void 0?C:Dt[lt].fontName,q=q!==void 0?q:Dt[lt].fontStyle,ye=C.toLowerCase(),Tt[ye]!==void 0&&Tt[ye][q]!==void 0?_e=Tt[ye][q]:Tt[C]!==void 0&&Tt[C][q]!==void 0?_e=Tt[C][q]:ue.disableWarning===!1&&pr.warn("Unable to look up font label for font '"+C+"', '"+q+"'. Refer to getFontList() for available fonts."),_e||ue.noFallback||(_e=Tt.times[q])==null&&(_e=Tt.times.normal),_e},ua=g.__private__.putInfo=function(){var C=ve(),q=function(ye){return ye};for(var ue in d!==null&&(q=Dr.encryptor(C,0)),ne("<<"),ne("/Producer ("+Nr(q("jsPDF "+jt.version))+")"),an)an.hasOwnProperty(ue)&&an[ue]&&ne("/"+ue.substr(0,1).toUpperCase()+ue.substr(1)+" ("+Nr(q(an[ue]))+")");ne("/CreationDate ("+Nr(q(he))+")"),ne(">>"),ne("endobj")},Qa=g.__private__.putCatalog=function(C){var q=(C=C||{}).rootDictionaryObjId||at;switch(ve(),ne("<<"),ne("/Type /Catalog"),ne("/Pages "+q+" 0 R"),gt||(gt="fullwidth"),gt){case"fullwidth":ne("/OpenAction [3 0 R /FitH null]");break;case"fullheight":ne("/OpenAction [3 0 R /FitV null]");break;case"fullpage":ne("/OpenAction [3 0 R /Fit]");break;case"original":ne("/OpenAction [3 0 R /XYZ null null 1]");break;default:var ue=""+gt;ue.substr(ue.length-1)==="%"&&(gt=parseInt(gt)/100),typeof gt=="number"&&ne("/OpenAction [3 0 R /XYZ null null "+F(gt)+"]")}switch(tn||(tn="continuous"),tn){case"continuous":ne("/PageLayout /OneColumn");break;case"single":ne("/PageLayout /SinglePage");break;case"two":case"twoleft":ne("/PageLayout /TwoColumnLeft");break;case"tworight":ne("/PageLayout /TwoColumnRight")}Ct&&ne("/PageMode /"+Ct),Sn.publish("putCatalog"),ne(">>"),ne("endobj")},Kt=g.__private__.putTrailer=function(){ne("trailer"),ne("<<"),ne("/Size "+(z+1)),ne("/Root "+z+" 0 R"),ne("/Info "+(z-1)+" 0 R"),d!==null&&ne("/Encrypt "+Dr.oid+" 0 R"),ne("/ID [ <"+te+"> <"+te+"> ]"),ne(">>")},Jt=g.__private__.putHeader=function(){ne("%PDF-"+x),ne("%ºß¬à")},Ta=g.__private__.putXRef=function(){var C="0000000000";ne("xref"),ne("0 "+(z+1)),ne("0000000000 65535 f ");for(var q=1;q<=z;q++)typeof se[q]=="function"?ne((C+se[q]()).slice(-10)+" 00000 n "):se[q]!==void 0?ne((C+se[q]).slice(-10)+" 00000 n "):ne("0000000000 00000 n ")},Fr=g.__private__.buildDocument=function(){var C;z=0,xe=0,ge=[],se=[],Re=[],at=Ee(),et=Ee(),Ke(ge),Sn.publish("buildDocument"),Jt(),dt(),(function(){Sn.publish("putAdditionalObjects");for(var ue=0;ue<Re.length;ue++){var ye=Re[ue];Be(ye.objId,!0),ne(ye.content),ne("endobj")}Sn.publish("postPutAdditionalObjects")})(),C=[],(function(){for(var ue in Dt)Dt.hasOwnProperty(ue)&&(m===!1||m===!0&&y.hasOwnProperty(ue))&&Yt(Dt[ue])})(),(function(){var ue;for(ue in Ut)Ut.hasOwnProperty(ue)&&En(Ut[ue])})(),(function(){for(var ue in sa)sa.hasOwnProperty(ue)&&bn(sa[ue])})(),(function(ue){var ye;for(ye in Lt)Lt.hasOwnProperty(ye)&&(Lt[ye]instanceof ic?Bn(Lt[ye]):Lt[ye]instanceof Tf&&_n(Lt[ye],ue))})(C),Sn.publish("putResources"),C.forEach(lr),lr({resourcesOid:et,objectOid:Number.MAX_SAFE_INTEGER}),Sn.publish("postPutResources"),d!==null&&(Dr.oid=ve(),ne("<<"),ne("/Filter /Standard"),ne("/V "+Dr.v),ne("/R "+Dr.r),ne("/U <"+Dr.toHexString(Dr.U)+">"),ne("/O <"+Dr.toHexString(Dr.O)+">"),ne("/P "+Dr.P),ne(">>"),ne("endobj")),ua(),Qa();var q=xe;return Ta(),Kt(),ne("startxref"),ne(""+q),ne("%%EOF"),Ke(De[V]),ge.join(`
|
|
1035
|
+
`)},qi=g.__private__.getBlob=function(C){return new Blob([it(C)],{type:"application/pdf"})},us=function(C){for(;C.firstChild;)C.removeChild(C.firstChild)},hn=function(C){var q,ue=C.document,ye=ue.documentElement,_e=ue.head,Ue=ue.body;return _e||(_e=ue.createElement("head"),ye.appendChild(_e)),Ue||(Ue=ue.createElement("body"),ye.appendChild(Ue)),us(_e),us(Ue),(q=ue.createElement("style")).appendChild(ue.createTextNode("html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}")),_e.appendChild(q),{document:ue,body:Ue}},ei=g.output=g.__private__.output=(de=function(C,q){switch(typeof(q=q||{})=="string"?q={filename:q}:q.filename=q.filename||"generated.pdf",C){case void 0:return Fr();case"save":g.save(q.filename);break;case"arraybuffer":return it(Fr());case"blob":return qi(Fr());case"bloburi":case"bloburl":if(Qt.URL!==void 0&&typeof Qt.URL.createObjectURL=="function")return Qt.URL&&Qt.URL.createObjectURL(qi(Fr()))||void 0;pr.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var ue="",ye=Fr();try{ue=x_(ye)}catch{ue=x_(unescape(encodeURIComponent(ye)))}return"data:application/pdf;filename="+encodeURIComponent(q.filename)+";base64,"+ue;case"pdfobjectnewwindow":if(Object.prototype.toString.call(Qt)==="[object Window]"){var _e="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",Ue=!q.pdfObjectUrl;Ue||(_e=q.pdfObjectUrl);var Xe=Qt.open();if(Xe!==null){var pt=hn(Xe),vt=pt.document.createElement("script"),Xt=this;vt.src=_e,Ue&&(vt.integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==",vt.crossOrigin="anonymous"),vt.onload=function(){Xe.PDFObject.embed(Xt.output("dataurlstring"),q)},pt.body.appendChild(vt)}return Xe}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if(Object.prototype.toString.call(Qt)==="[object Window]"){var sn=q.pdfJsUrl||"examples/PDF.js/web/viewer.html",An=Qt.open();if(An!==null){var Ur=hn(An),Qn=Ur.document.createElement("iframe"),Jn=sn.indexOf("?")===-1?"?":"&";Xt=this,Qn.id="pdfViewer",Qn.width="500px",Qn.height="400px",Qn.src=sn+Jn+"file=&downloadName="+encodeURIComponent(q.filename),Qn.onload=function(){An.document.title=q.filename,Qn.contentWindow.PDFViewerApplication.open(Xt.output("bloburl"))},Ur.body.appendChild(Qn)}return An}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if(Object.prototype.toString.call(Qt)!=="[object Window]")throw new Error("The option dataurlnewwindow just works in a browser-environment.");var ur=Qt.open();if(ur!==null){var yr=hn(ur),br=yr.document.createElement("iframe");br.src=this.output("datauristring",q),yr.body.appendChild(br),ur.document.title=q.filename}if(ur||typeof safari>"u")return ur;break;case"datauri":case"dataurl":return Qt.document.location.href=this.output("datauristring",q);default:return null}},de.foo=function(){try{return de.apply(this,arguments)}catch(ue){var C=ue.stack||"";~C.indexOf(" at ")&&(C=C.split(" at ")[1]);var q="Error in function "+C.split(`
|
|
1036
|
+
`)[0].split("<")[0]+": "+ue.message;if(!Qt.console)throw new Error(q);Qt.console.error(q,ue),Qt.alert&&alert(q)}},de.foo.bar=de,de.foo),vr=function(C){return Array.isArray(Xa)===!0&&Xa.indexOf(C)>-1};switch(r){case"pt":kt=1;break;case"mm":kt=72/25.4;break;case"cm":kt=72/2.54;break;case"in":kt=72;break;case"px":kt=vr("px_scaling")==1?.75:96/72;break;case"pc":case"em":kt=12;break;case"ex":kt=6;break;default:if(typeof r!="number")throw new Error("Invalid unit: "+r);kt=r}var Dr=null;U(),le();var Lu=g.__private__.getPageInfo=g.getPageInfo=function(C){if(isNaN(C)||C%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:_t[C].objId,pageNumber:C,pageContext:_t[C]}},ju=g.__private__.getPageInfoByObjId=function(C){if(isNaN(C)||C%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var q in _t)if(_t[q].objId===C)break;return Lu(q)},ao=g.__private__.getCurrentPageInfo=g.getCurrentPageInfo=function(){return{objId:_t[V].objId,pageNumber:V,pageContext:_t[V]}};g.addPage=function(){return la.apply(this,arguments),this},g.setPage=function(){return Ns.apply(this,arguments),Ke.call(this,De[V]),this},g.insertPage=function(C){return this.addPage(),this.movePage(V,C),this},g.movePage=function(C,q){var ue,ye;if(C>q){ue=De[C],ye=_t[C];for(var _e=C;_e>q;_e--)De[_e]=De[_e-1],_t[_e]=_t[_e-1];De[q]=ue,_t[q]=ye,this.setPage(q)}else if(C<q){ue=De[C],ye=_t[C];for(var Ue=C;Ue<q;Ue++)De[Ue]=De[Ue+1],_t[Ue]=_t[Ue+1];De[q]=ue,_t[q]=ye,this.setPage(q)}return this},g.deletePage=function(){return Ca.apply(this,arguments),this},g.__private__.text=g.text=function(C,q,ue,ye,_e){var Ue,Xe,pt,vt,Xt,sn,An,Ur,Qn,Jn=(ye=ye||{}).scope||this;if(typeof C=="number"&&typeof q=="number"&&(typeof ue=="string"||Array.isArray(ue))){var ur=ue;ue=q,q=C,C=ur}if(arguments[3]instanceof At==0?(pt=arguments[4],vt=arguments[5],In(An=arguments[3])==="object"&&An!==null||(typeof pt=="string"&&(vt=pt,pt=null),typeof An=="string"&&(vt=An,An=null),typeof An=="number"&&(pt=An,An=null),ye={flags:An,angle:pt,align:vt})):(B("The transform parameter of text() with a Matrix value"),Qn=_e),isNaN(q)||isNaN(ue)||C==null)throw new Error("Invalid arguments passed to jsPDF.text");if(C.length===0)return Jn;var yr,br="",ja=typeof ye.lineHeightFactor=="number"?ye.lineHeightFactor:xi,Ps=Jn.internal.scaleFactor;function Mu(Fn){return Fn=Fn.split(" ").join(Array(ye.TabLen||9).join(" ")),Nr(Fn,An)}function Ms(Fn){for(var Xn,Tr=Fn.concat(),cr=[],ds=Tr.length;ds--;)typeof(Xn=Tr.shift())=="string"?cr.push(Xn):Array.isArray(Fn)&&(Xn.length===1||Xn[1]===void 0&&Xn[2]===void 0)?cr.push(Xn[0]):cr.push([Xn[0],Xn[1],Xn[2]]);return cr}function Ji(Fn,Xn){var Tr;if(typeof Fn=="string")Tr=Xn(Fn)[0];else if(Array.isArray(Fn)){for(var cr,ds,Wl=Fn.concat(),sl=[],Nc=Wl.length;Nc--;)typeof(cr=Wl.shift())=="string"?sl.push(Xn(cr)[0]):Array.isArray(cr)&&typeof cr[0]=="string"&&(ds=Xn(cr[0],cr[1],cr[2]),sl.push([ds[0],ds[1],ds[2]]));Tr=sl}return Tr}var so=!1,oo=!0;if(typeof C=="string")so=!0;else if(Array.isArray(C)){var Jo=C.concat();Xe=[];for(var Xo,ga=Jo.length;ga--;)(typeof(Xo=Jo.shift())!="string"||Array.isArray(Xo)&&typeof Xo[0]!="string")&&(oo=!1);so=oo}if(so===!1)throw new Error('Type of text must be string or Array. "'+C+'" is not recognized.');typeof C=="string"&&(C=C.match(/[\r?\n]/)?C.split(/\r\n|\r|\n/g):[C]);var lo=Ve/Jn.internal.scaleFactor,Si=lo*(ja-1);switch(ye.baseline){case"bottom":ue-=Si;break;case"top":ue+=lo-Si;break;case"hanging":ue+=lo-2*Si;break;case"middle":ue+=lo/2-Si}if((sn=ye.maxWidth||0)>0&&(typeof C=="string"?C=Jn.splitTextToSize(C,sn):Object.prototype.toString.call(C)==="[object Array]"&&(C=C.reduce(function(Fn,Xn){return Fn.concat(Jn.splitTextToSize(Xn,sn))},[]))),Ue={text:C,x:q,y:ue,options:ye,mutex:{pdfEscape:Nr,activeFontKey:lt,fonts:Dt,activeFontSize:Ve}},Sn.publish("preProcessText",Ue),C=Ue.text,pt=(ye=Ue.options).angle,Qn instanceof At==0&&pt&&typeof pt=="number"){pt*=Math.PI/180,ye.rotationDirection===0&&(pt=-pt),R===L&&(pt=-pt);var Iu=Math.cos(pt),hs=Math.sin(pt);Qn=new At(Iu,hs,-hs,Iu,0,0)}else pt&&pt instanceof At&&(Qn=pt);R!==L||Qn||(Qn=bi),(Xt=ye.charSpace||Go)!==void 0&&(br+=P(K(Xt))+` Tc
|
|
1037
|
+
`,this.setCharSpace(this.getCharSpace()||0)),(Ur=ye.horizontalScale)!==void 0&&(br+=P(100*Ur)+` Tz
|
|
1038
|
+
`),ye.lang;var $a=-1,Fu=ye.renderingMode!==void 0?ye.renderingMode:ye.stroke,Zo=Jn.internal.getCurrentPageInfo().pageContext;switch(Fu){case 0:case!1:case"fill":$a=0;break;case 1:case!0:case"stroke":$a=1;break;case 2:case"fillThenStroke":$a=2;break;case 3:case"invisible":$a=3;break;case 4:case"fillAndAddForClipping":$a=4;break;case 5:case"strokeAndAddPathForClipping":$a=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":$a=6;break;case 7:case"addToPathForClipping":$a=7}var uo=Zo.usedRenderingMode!==void 0?Zo.usedRenderingMode:-1;$a!==-1?br+=$a+` Tr
|
|
1039
|
+
`:uo!==-1&&(br+=`0 Tr
|
|
1040
|
+
`),$a!==-1&&(Zo.usedRenderingMode=$a),vt=ye.align||"left";var Oa,Qo=Ve*ja,co=Jn.internal.pageSize.getWidth(),el=Dt[lt];Xt=ye.charSpace||Go,sn=ye.maxWidth||0,An=Object.assign({autoencode:!0,noBOM:!0},ye.flags);var fo=[],tl=function(Fn){return Jn.getStringUnitWidth(Fn,{font:el,charSpace:Xt,fontSize:Ve,doKerning:!1})*Ve/Ps};if(Object.prototype.toString.call(C)==="[object Array]"){var va;Xe=Ms(C),vt!=="left"&&(Oa=Xe.map(tl));var za,nl=0;if(vt==="right"){q-=Oa[0],C=[],ga=Xe.length;for(var Is=0;Is<ga;Is++)Is===0?(za=Wi(q),va=fi(ue)):(za=K(nl-Oa[Is]),va=-Qo),C.push([Xe[Is],za,va]),nl=Oa[Is]}else if(vt==="center"){q-=Oa[0]/2,C=[],ga=Xe.length;for(var ho=0;ho<ga;ho++)ho===0?(za=Wi(q),va=fi(ue)):(za=K((nl-Oa[ho])/2),va=-Qo),C.push([Xe[ho],za,va]),nl=Oa[ho]}else if(vt==="left"){C=[],ga=Xe.length;for(var Hl=0;Hl<ga;Hl++)C.push(Xe[Hl])}else if(vt==="justify"&&el.encoding==="Identity-H"){C=[],ga=Xe.length,sn=sn!==0?sn:co;for(var rl=0,Br=0;Br<ga;Br++)if(va=Br===0?fi(ue):-Qo,za=Br===0?Wi(q):rl,Br<ga-1){var Zf=K((sn-Oa[Br])/(Xe[Br].split(" ").length-1)),Cr=Xe[Br].split(" ");C.push([Cr[0]+" ",za,va]),rl=0;for(var qa=1;qa<Cr.length;qa++){var po=(tl(Cr[qa-1]+" "+Cr[qa])-tl(Cr[qa]))*Ps+Zf;qa==Cr.length-1?C.push([Cr[qa],po,0]):C.push([Cr[qa]+" ",po,0]),rl-=po}}else C.push([Xe[Br],za,va]);C.push(["",rl,0])}else{if(vt!=="justify")throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(C=[],ga=Xe.length,sn=sn!==0?sn:co,Br=0;Br<ga;Br++){va=Br===0?fi(ue):-Qo,za=Br===0?Wi(q):0;var Vl=Xe[Br].split(" ").length-1,Gl=Vl>0?(sn-Oa[Br])/Vl:0;Br<ga-1?fo.push(P(K(Gl))):fo.push(0),C.push([Xe[Br],za,va])}}}(typeof ye.R2L=="boolean"?ye.R2L:Ot)===!0&&(C=Ji(C,function(Fn,Xn,Tr){return[Fn.split("").reverse().join(""),Xn,Tr]})),Ue={text:C,x:q,y:ue,options:ye,mutex:{pdfEscape:Nr,activeFontKey:lt,fonts:Dt,activeFontSize:Ve}},Sn.publish("postProcessText",Ue),C=Ue.text,yr=Ue.mutex.isHex||!1;var al=Dt[lt].encoding;al!=="WinAnsiEncoding"&&al!=="StandardEncoding"||(C=Ji(C,function(Fn,Xn,Tr){return[Mu(Fn),Xn,Tr]})),Xe=Ms(C),C=[];for(var Fs,il,di,Xi=Array.isArray(Xe[0])?1:0,_i="",mo=function(Fn,Xn,Tr){var cr="";return Tr instanceof At?(Tr=typeof ye.angle=="number"?yi(Tr,new At(1,0,0,1,Fn,Xn)):yi(new At(1,0,0,1,Fn,Xn),Tr),R===L&&(Tr=yi(new At(1,0,0,-1,0,0),Tr)),cr=Tr.join(" ")+` Tm
|
|
1041
|
+
`):cr=P(Fn)+" "+P(Xn)+` Td
|
|
1042
|
+
`,cr},ya=0;ya<Xe.length;ya++){switch(_i="",Xi){case 1:di=(yr?"<":"(")+Xe[ya][0]+(yr?">":")"),Fs=parseFloat(Xe[ya][1]),il=parseFloat(Xe[ya][2]);break;case 0:di=(yr?"<":"(")+Xe[ya]+(yr?">":")"),Fs=Wi(q),il=fi(ue)}fo!==void 0&&fo[ya]!==void 0&&(_i=fo[ya]+` Tw
|
|
1043
|
+
`),ya===0?C.push(_i+mo(Fs,il,Qn)+di):Xi===0?C.push(_i+di):Xi===1&&C.push(_i+mo(Fs,il,Qn)+di)}C=Xi===0?C.join(` Tj
|
|
1044
|
+
T* `):C.join(` Tj
|
|
1045
|
+
`),C+=` Tj
|
|
1046
|
+
`;var Ra=`BT
|
|
1047
|
+
/`;return Ra+=lt+" "+Ve+` Tf
|
|
1048
|
+
`,Ra+=P(Ve*ja)+` TL
|
|
1049
|
+
`,Ra+=hi+`
|
|
1050
|
+
`,Ra+=br,Ra+=C,ne(Ra+="ET"),y[lt]=!0,Jn};var wc=g.__private__.clip=g.clip=function(C){return ne(C==="evenodd"?"W*":"W"),this};g.clipEvenOdd=function(){return wc("evenodd")},g.__private__.discardPath=g.discardPath=function(){return ne("n"),this};var Hi=g.__private__.isValidStyle=function(C){var q=!1;return[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(C)!==-1&&(q=!0),q};g.__private__.setDefaultPathOperation=g.setDefaultPathOperation=function(C){return Hi(C)&&(h=C),this};var Ts=g.__private__.getStyle=g.getStyle=function(C){var q=h;switch(C){case"D":case"S":q="S";break;case"F":q="f";break;case"FD":case"DF":q="B";break;case"f":case"f*":case"B":case"B*":q=C}return q},Ul=g.close=function(){return ne("h"),this};g.stroke=function(){return ne("S"),this},g.fill=function(C){return Ho("f",C),this},g.fillEvenOdd=function(C){return Ho("f*",C),this},g.fillStroke=function(C){return Ho("B",C),this},g.fillStrokeEvenOdd=function(C){return Ho("B*",C),this};var Ho=function(C,q){In(q)==="object"?Jf(q,C):ne(C)},Bl=function(C){C===null||R===L&&C===void 0||(C=Ts(C),ne(C))};function Ou(C,q,ue,ye,_e){var Ue=new Tf(q||this.boundingBox,ue||this.xStep,ye||this.yStep,this.gState,_e||this.matrix);Ue.stream=this.stream;var Xe=C+"$$"+this.cloneIndex+++"$$";return Ba(Xe,Ue),Ue}var Jf=function(C,q){var ue=Hn[C.key],ye=Lt[ue];if(ye instanceof ic)ne("q"),ne(Xf(q)),ye.gState&&g.setGState(ye.gState),ne(C.matrix.toString()+" cm"),ne("/"+ue+" sh"),ne("Q");else if(ye instanceof Tf){var _e=new At(1,0,0,-1,0,Ko());C.matrix&&(_e=_e.multiply(C.matrix||bi),ue=Ou.call(ye,C.key,C.boundingBox,C.xStep,C.yStep,_e).id),ne("q"),ne("/Pattern cs"),ne("/"+ue+" scn"),ye.gState&&g.setGState(ye.gState),ne(q),ne("Q")}},Xf=function(C){switch(C){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},Vi=g.moveTo=function(C,q){return ne(P(K(C))+" "+P(Y(q))+" m"),this},wi=g.lineTo=function(C,q){return ne(P(K(C))+" "+P(Y(q))+" l"),this},cs=g.curveTo=function(C,q,ue,ye,_e,Ue){return ne([P(K(C)),P(Y(q)),P(K(ue)),P(Y(ye)),P(K(_e)),P(Y(Ue)),"c"].join(" ")),this};g.__private__.line=g.line=function(C,q,ue,ye,_e){if(isNaN(C)||isNaN(q)||isNaN(ue)||isNaN(ye)||!Hi(_e))throw new Error("Invalid arguments passed to jsPDF.line");return R===j?this.lines([[ue-C,ye-q]],C,q,[1,1],_e||"S"):this.lines([[ue-C,ye-q]],C,q,[1,1]).stroke()},g.__private__.lines=g.lines=function(C,q,ue,ye,_e,Ue){var Xe,pt,vt,Xt,sn,An,Ur,Qn,Jn,ur,yr,br;if(typeof C=="number"&&(br=ue,ue=q,q=C,C=br),ye=ye||[1,1],Ue=Ue||!1,isNaN(q)||isNaN(ue)||!Array.isArray(C)||!Array.isArray(ye)||!Hi(_e)||typeof Ue!="boolean")throw new Error("Invalid arguments passed to jsPDF.lines");for(Vi(q,ue),Xe=ye[0],pt=ye[1],Xt=C.length,ur=q,yr=ue,vt=0;vt<Xt;vt++)(sn=C[vt]).length===2?(ur=sn[0]*Xe+ur,yr=sn[1]*pt+yr,wi(ur,yr)):(An=sn[0]*Xe+ur,Ur=sn[1]*pt+yr,Qn=sn[2]*Xe+ur,Jn=sn[3]*pt+yr,ur=sn[4]*Xe+ur,yr=sn[5]*pt+yr,cs(An,Ur,Qn,Jn,ur,yr));return Ue&&Ul(),Bl(_e),this},g.path=function(C){for(var q=0;q<C.length;q++){var ue=C[q],ye=ue.c;switch(ue.op){case"m":Vi(ye[0],ye[1]);break;case"l":wi(ye[0],ye[1]);break;case"c":cs.apply(this,ye);break;case"h":Ul()}}return this},g.__private__.rect=g.rect=function(C,q,ue,ye,_e){if(isNaN(C)||isNaN(q)||isNaN(ue)||isNaN(ye)||!Hi(_e))throw new Error("Invalid arguments passed to jsPDF.rect");return R===j&&(ye=-ye),ne([P(K(C)),P(Y(q)),P(K(ue)),P(K(ye)),"re"].join(" ")),Bl(_e),this},g.__private__.triangle=g.triangle=function(C,q,ue,ye,_e,Ue,Xe){if(isNaN(C)||isNaN(q)||isNaN(ue)||isNaN(ye)||isNaN(_e)||isNaN(Ue)||!Hi(Xe))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[ue-C,ye-q],[_e-ue,Ue-ye],[C-_e,q-Ue]],C,q,[1,1],Xe,!0),this},g.__private__.roundedRect=g.roundedRect=function(C,q,ue,ye,_e,Ue,Xe){if(isNaN(C)||isNaN(q)||isNaN(ue)||isNaN(ye)||isNaN(_e)||isNaN(Ue)||!Hi(Xe))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var pt=4/3*(Math.SQRT2-1);return _e=Math.min(_e,.5*ue),Ue=Math.min(Ue,.5*ye),this.lines([[ue-2*_e,0],[_e*pt,0,_e,Ue-Ue*pt,_e,Ue],[0,ye-2*Ue],[0,Ue*pt,-_e*pt,Ue,-_e,Ue],[2*_e-ue,0],[-_e*pt,0,-_e,-Ue*pt,-_e,-Ue],[0,2*Ue-ye],[0,-Ue*pt,_e*pt,-Ue,_e,-Ue]],C+_e,q,[1,1],Xe,!0),this},g.__private__.ellipse=g.ellipse=function(C,q,ue,ye,_e){if(isNaN(C)||isNaN(q)||isNaN(ue)||isNaN(ye)||!Hi(_e))throw new Error("Invalid arguments passed to jsPDF.ellipse");var Ue=4/3*(Math.SQRT2-1)*ue,Xe=4/3*(Math.SQRT2-1)*ye;return Vi(C+ue,q),cs(C+ue,q-Xe,C+Ue,q-ye,C,q-ye),cs(C-Ue,q-ye,C-ue,q-Xe,C-ue,q),cs(C-ue,q+Xe,C-Ue,q+ye,C,q+ye),cs(C+Ue,q+ye,C+ue,q+Xe,C+ue,q),Bl(_e),this},g.__private__.circle=g.circle=function(C,q,ue,ye){if(isNaN(C)||isNaN(q)||isNaN(ue)||!Hi(ye))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(C,q,ue,ue,ye)},g.setFont=function(C,q,ue){return ue&&(q=G(q,ue)),lt=Cs(C,q,{disableWarning:!1}),this};var Ru=g.__private__.getFont=g.getFont=function(){return Dt[Cs.apply(g,arguments)]};g.__private__.getFontList=g.getFontList=function(){var C,q,ue={};for(C in Tt)if(Tt.hasOwnProperty(C))for(q in ue[C]=[],Tt[C])Tt[C].hasOwnProperty(q)&&ue[C].push(q);return ue},g.addFont=function(C,q,ue,ye,_e){var Ue=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&Ue.indexOf(arguments[3])!==-1?_e=arguments[3]:arguments[3]&&Ue.indexOf(arguments[3])==-1&&(ue=G(ue,ye)),zi.call(this,C,q,ue,_e=_e||"Identity-H")};var xi,Ft=t.lineWidth||.200025,xc=g.__private__.getLineWidth=g.getLineWidth=function(){return Ft},ku=g.__private__.setLineWidth=g.setLineWidth=function(C){return Ft=C,ne(P(K(C))+" w"),this};g.__private__.setLineDash=jt.API.setLineDash=jt.API.setLineDashPattern=function(C,q){if(C=C||[],q=q||0,isNaN(q)||!Array.isArray(C))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return C=C.map(function(ue){return P(K(ue))}).join(" "),q=P(K(q)),ne("["+C+"] "+q+" d"),this};var Sc=g.__private__.getLineHeight=g.getLineHeight=function(){return Ve*xi};g.__private__.getLineHeight=g.getLineHeight=function(){return Ve*xi};var Vo=g.__private__.setLineHeightFactor=g.setLineHeightFactor=function(C){return typeof(C=C||1.15)=="number"&&(xi=C),this},Gi=g.__private__.getLineHeightFactor=g.getLineHeightFactor=function(){return xi};Vo(t.lineHeight);var Wi=g.__private__.getHorizontalCoordinate=function(C){return K(C)},fi=g.__private__.getVerticalCoordinate=function(C){return R===L?C:_t[V].mediaBox.topRightY-_t[V].mediaBox.bottomLeftY-K(C)},fs=g.__private__.getHorizontalCoordinateString=g.getHorizontalCoordinateString=function(C){return P(Wi(C))},Du=g.__private__.getVerticalCoordinateString=g.getVerticalCoordinateString=function(C){return P(fi(C))},Ls=t.strokeColor||"0 G";g.__private__.getStrokeColor=g.getDrawColor=function(){return ct(Ls)},g.__private__.setStrokeColor=g.setDrawColor=function(C,q,ue,ye){return Ls=Qe({ch1:C,ch2:q,ch3:ue,ch4:ye,pdfColorType:"draw",precision:2}),ne(Ls),this};var $l=t.fillColor||"0 g";g.__private__.getFillColor=g.getFillColor=function(){return ct($l)},g.__private__.setFillColor=g.setFillColor=function(C,q,ue,ye){return $l=Qe({ch1:C,ch2:q,ch3:ue,ch4:ye,pdfColorType:"fill",precision:2}),ne($l),this};var hi=t.textColor||"0 g",zl=g.__private__.getTextColor=g.getTextColor=function(){return ct(hi)};g.__private__.setTextColor=g.setTextColor=function(C,q,ue,ye){return hi=Qe({ch1:C,ch2:q,ch3:ue,ch4:ye,pdfColorType:"text",precision:3}),this};var Go=t.charSpace,La=g.__private__.getCharSpace=g.getCharSpace=function(){return parseFloat(Go||0)};g.__private__.setCharSpace=g.setCharSpace=function(C){if(isNaN(C))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return Go=C,this};var Yi=0;g.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},g.__private__.setLineCap=g.setLineCap=function(C){var q=g.CapJoinStyles[C];if(q===void 0)throw new Error("Line cap style of '"+C+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Yi=q,ne(q+" J"),this};var Ki=0;g.__private__.setLineJoin=g.setLineJoin=function(C){var q=g.CapJoinStyles[C];if(q===void 0)throw new Error("Line join style of '"+C+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Ki=q,ne(q+" j"),this},g.__private__.setLineMiterLimit=g.__private__.setMiterLimit=g.setLineMiterLimit=g.setMiterLimit=function(C){if(C=C||0,isNaN(C))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return ne(P(K(C))+" M"),this},g.GState=pg,g.setGState=function(C){(C=typeof C=="string"?Ut[qt[C]]:js(null,C)).equals(kn)||(ne("/"+C.id+" gs"),kn=C)};var js=function(C,q){if(!C||!qt[C]){var ue=!1;for(var ye in Ut)if(Ut.hasOwnProperty(ye)&&Ut[ye].equals(q)){ue=!0;break}if(ue)q=Ut[ye];else{var _e="GS"+(Object.keys(Ut).length+1).toString(10);Ut[_e]=q,q.id=_e}return C&&(qt[C]=q.id),Sn.publish("addGState",q),q}};g.addGState=function(C,q){return js(C,q),this},g.saveGraphicsState=function(){return ne("q"),mn.push({key:lt,size:Ve,color:hi}),this},g.restoreGraphicsState=function(){ne("Q");var C=mn.pop();return lt=C.key,Ve=C.size,hi=C.color,kn=null,this},g.setCurrentTransformationMatrix=function(C){return ne(C.toString()+" cm"),this},g.comment=function(C){return ne("#"+C),this};var Wo=function(C,q){var ue=C||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return ue},set:function(Ue){isNaN(Ue)||(ue=parseFloat(Ue))}});var ye=q||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return ye},set:function(Ue){isNaN(Ue)||(ye=parseFloat(Ue))}});var _e="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return _e},set:function(Ue){_e=Ue.toString()}}),this},Yo=function(C,q,ue,ye){Wo.call(this,C,q),this.type="rect";var _e=ue||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return _e},set:function(Xe){isNaN(Xe)||(_e=parseFloat(Xe))}});var Ue=ye||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return Ue},set:function(Xe){isNaN(Xe)||(Ue=parseFloat(Xe))}}),this},io=function(){this.page=nn,this.currentPage=V,this.pages=De.slice(0),this.pagesContext=_t.slice(0),this.x=Et,this.y=gr,this.matrix=fn,this.width=Pu(V),this.height=Ds(V),this.outputDestination=Pe,this.id="",this.objectNumber=-1};io.prototype.restore=function(){nn=this.page,V=this.currentPage,_t=this.pagesContext,De=this.pages,Et=this.x,gr=this.y,fn=this.matrix,ks(V,this.width),_c(V,this.height),Pe=this.outputDestination};var Os=function(C,q,ue,ye,_e){ma.push(new io),nn=V=0,De=[],Et=C,gr=q,fn=_e,oa([ue,ye])};for(var Rs in g.beginFormObject=function(C,q,ue,ye,_e){return Os(C,q,ue,ye,_e),this},g.endFormObject=function(C){return(function(q){if(ci[q])ma.pop().restore();else{var ue=new io,ye="Xo"+(Object.keys(sa).length+1).toString(10);ue.id=ye,ci[q]=ye,sa[ye]=ue,Sn.publish("addFormObject",ue),ma.pop().restore()}})(C),this},g.doFormObject=function(C,q){var ue=sa[ci[C]];return ne("q"),ne(q.toString()+" cm"),ne("/"+ue.id+" Do"),ne("Q"),this},g.getFormObject=function(C){var q=sa[ci[C]];return{x:q.x,y:q.y,width:q.width,height:q.height,matrix:q.matrix}},g.save=function(C,q){return C=C||"generated.pdf",(q=q||{}).returnPromise=q.returnPromise||!1,q.returnPromise===!1?(ac(qi(Fr()),C),typeof ac.unload=="function"&&Qt.setTimeout&&setTimeout(ac.unload,911),this):new Promise(function(ue,ye){try{var _e=ac(qi(Fr()),C);typeof ac.unload=="function"&&Qt.setTimeout&&setTimeout(ac.unload,911),ue(_e)}catch(Ue){ye(Ue.message)}})},jt.API)jt.API.hasOwnProperty(Rs)&&(Rs==="events"&&jt.API.events.length?(function(C,q){var ue,ye,_e;for(_e=q.length-1;_e!==-1;_e--)ue=q[_e][0],ye=q[_e][1],C.subscribe.apply(C,[ue].concat(typeof ye=="function"?[ye]:ye))})(Sn,jt.API.events):g[Rs]=jt.API[Rs]);function Pu(C){return _t[C].mediaBox.topRightX-_t[C].mediaBox.bottomLeftX}function ks(C,q){_t[C].mediaBox.topRightX=q+_t[C].mediaBox.bottomLeftX}function Ds(C){return _t[C].mediaBox.topRightY-_t[C].mediaBox.bottomLeftY}function _c(C,q){_t[C].mediaBox.topRightY=q+_t[C].mediaBox.bottomLeftY}var ql=g.getPageWidth=function(C){return Pu(C=C||V)/kt},Ec=g.setPageWidth=function(C,q){ks(C,q*kt)},Ko=g.getPageHeight=function(C){return Ds(C=C||V)/kt},Ac=g.setPageHeight=function(C,q){_c(C,q*kt)};return g.internal={pdfEscape:Nr,getStyle:Ts,getFont:Ru,getFontSize:ut,getCharSpace:La,getTextColor:zl,getLineHeight:Sc,getLineHeightFactor:Gi,getLineWidth:xc,write:We,getHorizontalCoordinate:Wi,getVerticalCoordinate:fi,getCoordinateString:fs,getVerticalCoordinateString:Du,collections:{},newObject:ve,newAdditionalObject:Je,newObjectDeferred:Ee,newObjectDeferredBegin:Be,getFilters:st,putStream:St,events:Sn,scaleFactor:kt,pageSize:{getWidth:function(){return ql(V)},setWidth:function(C){Ec(V,C)},getHeight:function(){return Ko(V)},setHeight:function(C){Ac(V,C)}},encryptionOptions:d,encryption:Dr,getEncryptor:function(C){return d!==null?Dr.encryptor(C,0):function(q){return q}},output:ei,getNumberOfPages:Za,get pages(){return De},out:ne,f2:F,f3:$,getPageInfo:Lu,getPageInfoByObjId:ju,getCurrentPageInfo:ao,getPDFVersion:_,Point:Wo,Rectangle:Yo,Matrix:At,hasHotfix:vr},Object.defineProperty(g.internal.pageSize,"width",{get:function(){return ql(V)},set:function(C){Ec(V,C)},enumerable:!0,configurable:!0}),Object.defineProperty(g.internal.pageSize,"height",{get:function(){return Ko(V)},set:function(C){Ac(V,C)},enumerable:!0,configurable:!0}),(function(C){for(var q=0,ue=tt.length;q<ue;q++){var ye=zi.call(this,C[q][0],C[q][1],C[q][2],tt[q][3],!0);m===!1&&(y[ye]=!0);var _e=C[q][0].split("-");wn({id:ye,fontName:_e[0],fontStyle:_e[1]||""})}Sn.publish("addFonts",{fonts:Dt,dictionary:Tt})}).call(g,tt),lt="F1",la(a,n),Sn.publish("initialized"),g}Ef.prototype.lsbFirstWord=function(t){return String.fromCharCode(255&t,t>>8&255,t>>16&255,t>>24&255)},Ef.prototype.toHexString=function(t){return t.split("").map(function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)}).join("")},Ef.prototype.hexToBytes=function(t){for(var e=[],n=0;n<t.length;n+=2)e.push(String.fromCharCode(parseInt(t.substr(n,2),16)));return e.join("")},Ef.prototype.processOwnerPassword=function(t,e){return Sy(xy(e).substr(0,5),t)},Ef.prototype.encryptor=function(t,e){var n=xy(this.encryptionKey+String.fromCharCode(255&t,t>>8&255,t>>16&255,255&e,e>>8&255)).substr(0,10);return function(r){return Sy(n,r)}},pg.prototype.equals=function(t){var e,n="id,objectNumber,equals";if(!t||In(t)!==In(this))return!1;var r=0;for(e in this)if(!(n.indexOf(e)>=0)){if(this.hasOwnProperty(e)&&!t.hasOwnProperty(e)||this[e]!==t[e])return!1;r++}for(e in t)t.hasOwnProperty(e)&&n.indexOf(e)<0&&r--;return r===0},jt.API={events:[]},jt.version="4.2.1";var Wr=jt.API,h2=1,bc=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},gf=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},gc=function(t){return t.toString().replace(/#/g,"#23").replace(/[\s\n\r()<>[\]{}\/%]/g,function(e){var n=e.charCodeAt(0).toString(16).toUpperCase();return"#"+(n.length===1?"0"+n:n)})},un=function(t){return t.toFixed(2)},bu=function(t){return t.toFixed(5)};Wr.__acroform__={};var $i=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},A_=function(t){return t*h2},Ro=function(t){var e=new OA,n=wt.internal.getHeight(t)||0,r=wt.internal.getWidth(t)||0;return e.BBox=[0,0,Number(un(r)),Number(un(n))],e},Z$=Wr.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},Q$=Wr.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},ez=Wr.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},ta=Wr.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return ez(t,e-1)},na=Wr.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return Z$(t,e-1)},ra=Wr.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return Q$(t,e-1)},tz=Wr.__acroform__.calculateCoordinates=function(t,e){var n=e.internal.getHorizontalCoordinate,r=e.internal.getVerticalCoordinate,a=t[0],s=t[1],l=t[2],u=t[3],c={};return c.lowerLeft_X=n(a)||0,c.lowerLeft_Y=r(s+u)||0,c.upperRight_X=n(a+l)||0,c.upperRight_Y=r(s)||0,[Number(un(c.lowerLeft_X)),Number(un(c.lowerLeft_Y)),Number(un(c.upperRight_X)),Number(un(c.upperRight_Y))]},nz=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t._V||t.DV,r=_y(t,n),a=t.scope.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(t.scope.__private__.encodeColorString(t.color)),e.push("/"+a+" "+un(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var s=Ro(t);return s.scope=t.scope,s.stream=e.join(`
|
|
1051
|
+
`),s}},_y=function(t,e){var n=t.fontSize===0?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},a=(e=(e=e.substr(0,1)=="("?e.substr(1):e).substr(e.length-1)==")"?e.substr(0,e.length-1):e).split(" ");a=t.multiline?a.map(function(F){return F.split(`
|
|
1052
|
+
`)}):a.map(function(F){return[F]});var s=n,l=wt.internal.getHeight(t)||0;l=l<0?-l:l;var u=wt.internal.getWidth(t)||0;u=u<0?-u:u;var c=function(F,$,K){if(F+1<a.length){var Y=$+" "+a[F+1][0];return mm(Y,t,K).width<=u-4}return!1};s++;e:for(;s>0;){e="",s--;var h,d,m=mm("3",t,s).height,y=t.multiline?l-s:(l-m)/2,g=y+=2,x=0,_=0,N=0;if(s<=0){e=`(...) Tj
|
|
1053
|
+
`,e+="% Width of Text: "+mm(e,t,s=12).width+", FieldWidth:"+u+`
|
|
1054
|
+
`;break}for(var A="",j=0,L=0;L<a.length;L++)if(a.hasOwnProperty(L)){var R=!1;if(a[L].length!==1&&N!==a[L].length-1){if((m+2)*(j+2)+2>l)continue e;A+=a[L][N],R=!0,_=L,L--}else{A=(A+=a[L][N]+" ").substr(A.length-1)==" "?A.substr(0,A.length-1):A;var I=parseInt(L),ee=c(I,A,s),G=L>=a.length-1;if(ee&&!G){A+=" ",N=0;continue}if(ee||G){if(G)_=I;else if(t.multiline&&(m+2)*(j+2)+2>l)continue e}else{if(!t.multiline||(m+2)*(j+2)+2>l)continue e;_=I}}for(var P="",B=x;B<=_;B++){var X=a[B];if(t.multiline){if(B===_){P+=X[N]+" ",N=(N+1)%X.length;continue}if(B===x){P+=X[X.length-1]+" ";continue}}P+=X[0]+" "}switch(P=P.substr(P.length-1)==" "?P.substr(0,P.length-1):P,d=mm(P,t,s).width,t.textAlign){case"right":h=u-d-2;break;case"center":h=(u-d)/2;break;default:h=2}e+=un(h)+" "+un(g)+` Td
|
|
1055
|
+
`,e+="("+bc(P)+`) Tj
|
|
1056
|
+
`,e+=-un(h)+` 0 Td
|
|
1057
|
+
`,g=-(s+2),d=0,x=R?_:_+1,j++,A=""}break}return r.text=e,r.fontSize=s,r},mm=function(t,e,n){var r=e.scope.internal.getFont(e.fontName,e.fontStyle),a=e.scope.getStringUnitWidth(t,{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:e.scope.getStringUnitWidth("3",{font:r,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:a}},rz={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},az=function(t,e){var n={type:"reference",object:t};e.internal.getPageInfo(t.page).pageContext.annotations.find(function(r){return r.type===n.type&&r.object===n.object})===void 0&&e.internal.getPageInfo(t.page).pageContext.annotations.push(n)},iz=function(t,e){if(e.scope=t,t.internal!==void 0&&(t.internal.acroformPlugin===void 0||t.internal.acroformPlugin.isInitialized===!1)){if(no.FieldNum=0,t.internal.acroformPlugin=JSON.parse(JSON.stringify(rz)),t.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");h2=t.internal.scaleFactor,t.internal.acroformPlugin.acroFormDictionaryRoot=new RA,t.internal.acroformPlugin.acroFormDictionaryRoot.scope=t,t.internal.acroformPlugin.acroFormDictionaryRoot._eventID=t.internal.events.subscribe("postPutResources",function(){(function(n){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0})(t)}),t.internal.events.subscribe("buildDocument",function(){(function(n){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var r=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var a in r)if(r.hasOwnProperty(a)){var s=r[a];s.objId=void 0,s.hasAnnotation&&az(s,n)}})(t)}),t.internal.events.subscribe("putCatalog",function(){(function(n){if(n.internal.acroformPlugin.acroFormDictionaryRoot===void 0)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")})(t)}),t.internal.events.subscribe("postPutPages",function(n){(function(r,a){var s=!r;for(var l in r||(a.internal.newObjectDeferredBegin(a.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),a.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),r=r||a.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(r.hasOwnProperty(l)){var u=r[l],c=[],h=u.Rect;if(u.Rect&&(u.Rect=tz(u.Rect,a)),a.internal.newObjectDeferredBegin(u.objId,!0),u.DA=wt.createDefaultAppearanceStream(u),In(u)==="object"&&typeof u.getKeyValueListForStream=="function"&&(c=u.getKeyValueListForStream()),u.Rect=h,u.hasAppearanceStream&&!u.appearanceStreamContent){var d=nz(u);c.push({key:"AP",value:"<</N "+d+">>"}),a.internal.acroformPlugin.xForms.push(d)}if(u.appearanceStreamContent){var m="";for(var y in u.appearanceStreamContent)if(u.appearanceStreamContent.hasOwnProperty(y)){var g=u.appearanceStreamContent[y];if(m+="/"+y+" ",m+="<<",Object.keys(g).length>=1||Array.isArray(g)){for(var l in g)if(g.hasOwnProperty(l)){var x=g[l];typeof x=="function"&&(x=x.call(a,u)),m+="/"+l+" "+x+" ",a.internal.acroformPlugin.xForms.indexOf(x)>=0||a.internal.acroformPlugin.xForms.push(x)}}else typeof(x=g)=="function"&&(x=x.call(a,u)),m+="/"+l+" "+x,a.internal.acroformPlugin.xForms.indexOf(x)>=0||a.internal.acroformPlugin.xForms.push(x);m+=">>"}c.push({key:"AP",value:`<<
|
|
1058
|
+
`+m+">>"})}a.internal.putStream({additionalKeyValues:c,objectId:u.objId}),a.internal.out("endobj")}s&&(function(_,N){for(var A in _)if(_.hasOwnProperty(A)){var j=A,L=_[A];N.internal.newObjectDeferredBegin(L.objId,!0),In(L)==="object"&&typeof L.putStream=="function"&&L.putStream(),delete _[j]}})(a.internal.acroformPlugin.xForms,a)})(n,t)}),t.internal.acroformPlugin.isInitialized=!0}},jA=Wr.__acroform__.arrayToPdfArray=function(t,e,n){var r=function(l){return l};if(Array.isArray(t)){for(var a="[",s=0;s<t.length;s++)switch(s!==0&&(a+=" "),In(t[s])){case"boolean":case"number":case"object":a+=t[s].toString();break;case"string":t[s].substr(0,1)==="/"?a+="/"+gc(t[s].substr(1)):(e!==void 0&&n&&(r=n.internal.getEncryptor(e)),a+="("+bc(r(t[s].toString()))+")")}return a+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},dv=function(t,e,n){var r=function(a){return a};return e!==void 0&&n&&(r=n.internal.getEncryptor(e)),(t=t||"").toString(),"("+bc(r(t))+")"},Fo=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(this._objId===void 0){if(this.scope===void 0)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(t){this._objId=t}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};Fo.prototype.toString=function(){return this.objId+" 0 R"},Fo.prototype.putStream=function(){var t=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:t,objectId:this.objId}),this.scope.internal.out("endobj")},Fo.prototype.getKeyValueListForStream=function(){var t=[],e=Object.getOwnPropertyNames(this).filter(function(s){return s!="content"&&s!="appearanceStreamContent"&&s!="scope"&&s!="objId"&&s.substring(0,1)!="_"});for(var n in e)if(Object.getOwnPropertyDescriptor(this,e[n]).configurable===!1){var r=e[n],a=this[r];a&&(Array.isArray(a)?t.push({key:r,value:jA(a,this.objId,this.scope)}):a instanceof Fo?(a.scope=this.scope,t.push({key:r,value:a.objId+" 0 R"})):typeof a!="function"&&t.push({key:r,value:a}))}return t};var OA=function(){Fo.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return e},set:function(n){e=n}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(n){t=n.trim()},get:function(){return t||null}})};$i(OA,Fo);var RA=function(){Fo.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t){var n=function(r){return r};return this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),"("+bc(n(t))+")"}},set:function(n){t=n}})};$i(RA,Fo);var no=function t(){Fo.call(this);var e=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return e},set:function(A){if(isNaN(A))throw new Error('Invalid value "'+A+'" for attribute F supplied.');e=A}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!ta(e,3)},set:function(A){A?this.F=na(e,3):this.F=ra(e,3)}});var n=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return n},set:function(A){if(isNaN(A))throw new Error('Invalid value "'+A+'" for attribute Ff supplied.');n=A}});var r=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(r.length!==0)return r},set:function(A){r=A!==void 0?A:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[0])?0:r[0]},set:function(A){r[0]=A}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[1])?0:r[1]},set:function(A){r[1]=A}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[2])?0:r[2]},set:function(A){r[2]=A}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!r||isNaN(r[3])?0:r[3]},set:function(A){r[3]=A}});var a="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return a},set:function(A){switch(A){case"/Btn":case"/Tx":case"/Ch":case"/Sig":a=A;break;default:throw new Error('Invalid value "'+A+'" for attribute FT supplied.')}}});var s=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!s||s.length<1){if(this instanceof mg)return;s="FieldObject"+t.FieldNum++}var A=function(j){return j};return this.scope&&(A=this.scope.internal.getEncryptor(this.objId)),"("+bc(A(s))+")"},set:function(A){s=A.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return s},set:function(A){s=A}});var l="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return l},set:function(A){l=A}});var u="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return u},set:function(A){u=A}});var c=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return c},set:function(A){c=A}});var h=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return h===void 0?50/h2:h},set:function(A){h=A}});var d="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return d},set:function(A){d=A}});var m="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!m||this instanceof mg||this instanceof hc))return dv(m,this.objId,this.scope)},set:function(A){A=A.toString(),m=A}});var y=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(y)return this instanceof Ua==0?dv(y,this.objId,this.scope):y},set:function(A){A=A.toString(),y=this instanceof Ua==0?A.substr(0,1)==="("?gf(A.substr(1,A.length-2)):gf(A):A}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ua==1?gf(y.substr(1,y.length-1)):y},set:function(A){A=A.toString(),y=this instanceof Ua==1?"/"+gc(A):A}});var g=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(g)return g},set:function(A){this.V=A}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(g)return this instanceof Ua==0?dv(g,this.objId,this.scope):g},set:function(A){A=A.toString(),g=this instanceof Ua==0?A.substr(0,1)==="("?gf(A.substr(1,A.length-2)):gf(A):A}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Ua==1?gf(g.substr(1,g.length-1)):g},set:function(A){A=A.toString(),g=this instanceof Ua==1?"/"+gc(A):A}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var x,_=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return _},set:function(A){A=!!A,_=A}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(x)return x},set:function(A){x=A}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,1)},set:function(A){A?this.Ff=na(this.Ff,1):this.Ff=ra(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,2)},set:function(A){A?this.Ff=na(this.Ff,2):this.Ff=ra(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,3)},set:function(A){A?this.Ff=na(this.Ff,3):this.Ff=ra(this.Ff,3)}});var N=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(N!==null)return N},set:function(A){if([0,1,2].indexOf(A)===-1)throw new Error('Invalid value "'+A+'" for attribute Q supplied.');N=A}}),Object.defineProperty(this,"textAlign",{get:function(){var A;switch(N){case 0:default:A="left";break;case 1:A="center";break;case 2:A="right"}return A},configurable:!0,enumerable:!0,set:function(A){switch(A){case"right":case 2:N=2;break;case"center":case 1:N=1;break;default:N=0}}})};$i(no,Fo);var If=function(){no.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(n){t=n}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(n){t=n}});var e=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return jA(e,this.objId,this.scope)},set:function(n){var r,a;a=[],typeof(r=n)=="string"&&(a=(function(s,l,u){u||(u=1);for(var c,h=[];c=l.exec(s);)h.push(c[u]);return h})(r,/\((.*?)\)/g)),e=a}}),this.getOptions=function(){return e},this.setOptions=function(n){e=n,this.sort&&e.sort()},this.addOption=function(n){n=(n=n||"").toString(),e.push(n),this.sort&&e.sort()},this.removeOption=function(n,r){for(r=r||!1,n=(n=n||"").toString();e.indexOf(n)!==-1&&(e.splice(e.indexOf(n),1),r!==!1););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,18)},set:function(n){n?this.Ff=na(this.Ff,18):this.Ff=ra(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,19)},set:function(n){this.combo===!0&&(n?this.Ff=na(this.Ff,19):this.Ff=ra(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,20)},set:function(n){n?(this.Ff=na(this.Ff,20),e.sort()):this.Ff=ra(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,22)},set:function(n){n?this.Ff=na(this.Ff,22):this.Ff=ra(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,23)},set:function(n){n?this.Ff=na(this.Ff,23):this.Ff=ra(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,27)},set:function(n){n?this.Ff=na(this.Ff,27):this.Ff=ra(this.Ff,27)}}),this.hasAppearanceStream=!1};$i(If,no);var Ff=function(){If.call(this),this.fontName="helvetica",this.combo=!1};$i(Ff,If);var Uf=function(){Ff.call(this),this.combo=!0};$i(Uf,Ff);var jm=function(){Uf.call(this),this.edit=!0};$i(jm,Uf);var Ua=function(){no.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,15)},set:function(n){n?this.Ff=na(this.Ff,15):this.Ff=ra(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,16)},set:function(n){n?this.Ff=na(this.Ff,16):this.Ff=ra(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,17)},set:function(n){n?this.Ff=na(this.Ff,17):this.Ff=ra(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,26)},set:function(n){n?this.Ff=na(this.Ff,26):this.Ff=ra(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var n=function(s){return s};if(this.scope&&(n=this.scope.internal.getEncryptor(this.objId)),Object.keys(e).length!==0){var r,a=[];for(r in a.push("<<"),e)a.push("/"+r+" ("+bc(n(e[r]))+")");return a.push(">>"),a.join(`
|
|
1059
|
+
`)}},set:function(n){In(n)==="object"&&(e=n)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(n){typeof n=="string"&&(e.CA=n)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(n){var r=n==null?"":n.toString();r.substr(0,1)==="/"&&(r=r.substr(1)),t="/"+gc(r)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(n){t="/"+gc(n)}})};$i(Ua,no);var Om=function(){Ua.call(this),this.pushButton=!0};$i(Om,Ua);var Bf=function(){Ua.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e!==void 0?e:[]}})};$i(Bf,Ua);var mg=function(){var t,e;no.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(a){t=a}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(a){e=a}});var n,r={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var a=function(u){return u};this.scope&&(a=this.scope.internal.getEncryptor(this.objId));var s,l=[];for(s in l.push("<<"),r)l.push("/"+s+" ("+bc(a(r[s]))+")");return l.push(">>"),l.join(`
|
|
1060
|
+
`)},set:function(a){In(a)==="object"&&(r=a)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return r.CA||""},set:function(a){typeof a=="string"&&(r.CA=a)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(a){var s=a==null?"":a.toString();s.substr(0,1)==="/"&&(s=s.substr(1)),n="/"+gc(s)}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(a){var s=a==null?"":a.toString();s.substr(0,1)==="/"&&(s=s.substr(1)),n="/"+gc(s)}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=wt.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};$i(mg,no),Bf.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},Bf.prototype.createOption=function(t){var e=new mg;return e.Parent=this,e.optionName=t,this.Kids.push(e),sz.call(this.scope,e),e};var Rm=function(){Ua.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=wt.CheckBox.createAppearanceStream()};$i(Rm,Ua);var hc=function(){no.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,13)},set:function(e){e?this.Ff=na(this.Ff,13):this.Ff=ra(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,21)},set:function(e){e?this.Ff=na(this.Ff,21):this.Ff=ra(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,23)},set:function(e){e?this.Ff=na(this.Ff,23):this.Ff=ra(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,24)},set:function(e){e?this.Ff=na(this.Ff,24):this.Ff=ra(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,25)},set:function(e){e?this.Ff=na(this.Ff,25):this.Ff=ra(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,26)},set:function(e){e?this.Ff=na(this.Ff,26):this.Ff=ra(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};$i(hc,no);var km=function(){hc.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!ta(this.Ff,14)},set:function(t){t?this.Ff=na(this.Ff,14):this.Ff=ra(this.Ff,14)}}),this.password=!0};$i(km,hc);var wt={CheckBox:{createAppearanceStream:function(){return{N:{On:wt.CheckBox.YesNormal},D:{On:wt.CheckBox.YesPushDown,Off:wt.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=Ro(t);e.scope=t.scope;var n=[],r=t.scope.internal.getFont(t.fontName,t.fontStyle).id,a=t.scope.__private__.encodeColorString(t.color),s=_y(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+un(wt.internal.getWidth(t))+" "+un(wt.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+r+" "+un(s.fontSize)+" Tf "+a),n.push("BT"),n.push(s.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join(`
|
|
1061
|
+
`),e},YesNormal:function(t){var e=Ro(t);e.scope=t.scope;var n=t.scope.internal.getFont(t.fontName,t.fontStyle).id,r=t.scope.__private__.encodeColorString(t.color),a=[],s=wt.internal.getHeight(t),l=wt.internal.getWidth(t),u=_y(t,t.caption);return a.push("1 g"),a.push("0 0 "+un(l)+" "+un(s)+" re"),a.push("f"),a.push("q"),a.push("0 0 1 rg"),a.push("0 0 "+un(l-1)+" "+un(s-1)+" re"),a.push("W"),a.push("n"),a.push("0 g"),a.push("BT"),a.push("/"+n+" "+un(u.fontSize)+" Tf "+r),a.push(u.text),a.push("ET"),a.push("Q"),e.stream=a.join(`
|
|
1062
|
+
`),e},OffPushDown:function(t){var e=Ro(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+un(wt.internal.getWidth(t))+" "+un(wt.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join(`
|
|
1063
|
+
`),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:wt.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=wt.RadioButton.Circle.YesNormal,e.D[t]=wt.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=Ro(t);e.scope=t.scope;var n=[],r=wt.internal.getWidth(t)<=wt.internal.getHeight(t)?wt.internal.getWidth(t)/4:wt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var a=wt.internal.Bezier_C,s=Number((r*a).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+bu(wt.internal.getWidth(t)/2)+" "+bu(wt.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+s+" "+s+" "+r+" 0 "+r+" c"),n.push("-"+s+" "+r+" -"+r+" "+s+" -"+r+" 0 c"),n.push("-"+r+" -"+s+" -"+s+" -"+r+" 0 -"+r+" c"),n.push(s+" -"+r+" "+r+" -"+s+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
|
|
1064
|
+
`),e},YesPushDown:function(t){var e=Ro(t);e.scope=t.scope;var n=[],r=wt.internal.getWidth(t)<=wt.internal.getHeight(t)?wt.internal.getWidth(t)/4:wt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var a=Number((2*r).toFixed(5)),s=Number((a*wt.internal.Bezier_C).toFixed(5)),l=Number((r*wt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+bu(wt.internal.getWidth(t)/2)+" "+bu(wt.internal.getHeight(t)/2)+" cm"),n.push(a+" 0 m"),n.push(a+" "+s+" "+s+" "+a+" 0 "+a+" c"),n.push("-"+s+" "+a+" -"+a+" "+s+" -"+a+" 0 c"),n.push("-"+a+" -"+s+" -"+s+" -"+a+" 0 -"+a+" c"),n.push(s+" -"+a+" "+a+" -"+s+" "+a+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+bu(wt.internal.getWidth(t)/2)+" "+bu(wt.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+l+" "+l+" "+r+" 0 "+r+" c"),n.push("-"+l+" "+r+" -"+r+" "+l+" -"+r+" 0 c"),n.push("-"+r+" -"+l+" -"+l+" -"+r+" 0 -"+r+" c"),n.push(l+" -"+r+" "+r+" -"+l+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
|
|
1065
|
+
`),e},OffPushDown:function(t){var e=Ro(t);e.scope=t.scope;var n=[],r=wt.internal.getWidth(t)<=wt.internal.getHeight(t)?wt.internal.getWidth(t)/4:wt.internal.getHeight(t)/4;r=Number((.9*r).toFixed(5));var a=Number((2*r).toFixed(5)),s=Number((a*wt.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+bu(wt.internal.getWidth(t)/2)+" "+bu(wt.internal.getHeight(t)/2)+" cm"),n.push(a+" 0 m"),n.push(a+" "+s+" "+s+" "+a+" 0 "+a+" c"),n.push("-"+s+" "+a+" -"+a+" "+s+" -"+a+" 0 c"),n.push("-"+a+" -"+s+" -"+s+" -"+a+" 0 -"+a+" c"),n.push(s+" -"+a+" "+a+" -"+s+" "+a+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join(`
|
|
1066
|
+
`),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:wt.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=wt.RadioButton.Cross.YesNormal,e.D[t]=wt.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=Ro(t);e.scope=t.scope;var n=[],r=wt.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+un(wt.internal.getWidth(t)-2)+" "+un(wt.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(un(r.x1.x)+" "+un(r.x1.y)+" m"),n.push(un(r.x2.x)+" "+un(r.x2.y)+" l"),n.push(un(r.x4.x)+" "+un(r.x4.y)+" m"),n.push(un(r.x3.x)+" "+un(r.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join(`
|
|
1067
|
+
`),e},YesPushDown:function(t){var e=Ro(t);e.scope=t.scope;var n=wt.internal.calculateCross(t),r=[];return r.push("0.749023 g"),r.push("0 0 "+un(wt.internal.getWidth(t))+" "+un(wt.internal.getHeight(t))+" re"),r.push("f"),r.push("q"),r.push("1 1 "+un(wt.internal.getWidth(t)-2)+" "+un(wt.internal.getHeight(t)-2)+" re"),r.push("W"),r.push("n"),r.push(un(n.x1.x)+" "+un(n.x1.y)+" m"),r.push(un(n.x2.x)+" "+un(n.x2.y)+" l"),r.push(un(n.x4.x)+" "+un(n.x4.y)+" m"),r.push(un(n.x3.x)+" "+un(n.x3.y)+" l"),r.push("s"),r.push("Q"),e.stream=r.join(`
|
|
1068
|
+
`),e},OffPushDown:function(t){var e=Ro(t);e.scope=t.scope;var n=[];return n.push("0.749023 g"),n.push("0 0 "+un(wt.internal.getWidth(t))+" "+un(wt.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join(`
|
|
1069
|
+
`),e}}},createDefaultAppearanceStream:function(t){var e=t.scope.internal.getFont(t.fontName,t.fontStyle).id,n=t.scope.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};wt.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=wt.internal.getWidth(t),n=wt.internal.getHeight(t),r=Math.min(e,n);return{x1:{x:(e-r)/2,y:(n-r)/2+r},x2:{x:(e-r)/2+r,y:(n-r)/2},x3:{x:(e-r)/2,y:(n-r)/2},x4:{x:(e-r)/2+r,y:(n-r)/2+r}}}},wt.internal.getWidth=function(t){var e=0;return In(t)==="object"&&(e=A_(t.Rect[2])),e},wt.internal.getHeight=function(t){var e=0;return In(t)==="object"&&(e=A_(t.Rect[3])),e};var sz=Wr.addField=function(t){if(iz(this,t),!(t instanceof no))throw new Error("Invalid argument passed to jsPDF.addField.");var e;return(e=t).scope.internal.acroformPlugin.printedOut&&(e.scope.internal.acroformPlugin.printedOut=!1,e.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e),t.page=t.scope.internal.getCurrentPageInfo().pageNumber,this};Wr.AcroFormChoiceField=If,Wr.AcroFormListBox=Ff,Wr.AcroFormComboBox=Uf,Wr.AcroFormEditBox=jm,Wr.AcroFormButton=Ua,Wr.AcroFormPushButton=Om,Wr.AcroFormRadioButton=Bf,Wr.AcroFormCheckBox=Rm,Wr.AcroFormTextField=hc,Wr.AcroFormPasswordField=km,Wr.AcroFormAppearance=wt,Wr.AcroForm={ChoiceField:If,ListBox:Ff,ComboBox:Uf,EditBox:jm,Button:Ua,PushButton:Om,RadioButton:Bf,CheckBox:Rm,TextField:hc,PasswordField:km,Appearance:wt},jt.AcroForm={ChoiceField:If,ListBox:Ff,ComboBox:Uf,EditBox:jm,Button:Ua,PushButton:Om,RadioButton:Bf,CheckBox:Rm,TextField:hc,PasswordField:km,Appearance:wt};jt.AcroForm;function kA(t){return t.reduce(function(e,n,r){return e[n]=r,e},{})}(function(t){var e="addImage_";t.__addimage__={};var n="UNKNOWN",r={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},a=t.__addimage__.getImageFileTypeByImageData=function(F,$){var K,Y,he,te,oe,le=n;if(($=$||n)==="RGBA"||F.data!==void 0&&F.data instanceof Uint8ClampedArray&&"height"in F&&"width"in F)return"RGBA";if(ee(F))for(oe in r)for(he=r[oe],K=0;K<he.length;K+=1){for(te=!0,Y=0;Y<he[K].length;Y+=1)if(he[K][Y]!==void 0&&he[K][Y]!==F[Y]){te=!1;break}if(te===!0){le=oe;break}}else for(oe in r)for(he=r[oe],K=0;K<he.length;K+=1){for(te=!0,Y=0;Y<he[K].length;Y+=1)if(he[K][Y]!==void 0&&he[K][Y]!==F.charCodeAt(Y)){te=!1;break}if(te===!0){le=oe;break}}return le===n&&$!==n&&(le=$),le},s=function F($){for(var K=this.internal.write,Y=this.internal.putStream,he=(0,this.internal.getFilters)();he.indexOf("FlateEncode")!==-1;)he.splice(he.indexOf("FlateEncode"),1);$.objectId=this.internal.newObject();var te=[];if(te.push({key:"Type",value:"/XObject"}),te.push({key:"Subtype",value:"/Image"}),te.push({key:"Width",value:$.width}),te.push({key:"Height",value:$.height}),$.colorSpace===A.INDEXED?te.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+($.palette.length/3-1)+" "+("sMask"in $&&$.sMask!==void 0?$.objectId+2:$.objectId+1)+" 0 R]"}):(te.push({key:"ColorSpace",value:"/"+$.colorSpace}),$.colorSpace===A.DEVICE_CMYK&&te.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),te.push({key:"BitsPerComponent",value:$.bitsPerComponent}),"decodeParameters"in $&&$.decodeParameters!==void 0&&te.push({key:"DecodeParms",value:"<<"+$.decodeParameters+">>"}),"transparency"in $&&Array.isArray($.transparency)&&$.transparency.length>0){for(var oe="",le=0,pe=$.transparency.length;le<pe;le++)oe+=$.transparency[le]+" "+$.transparency[le]+" ";te.push({key:"Mask",value:"["+oe+"]"})}$.sMask!==void 0&&te.push({key:"SMask",value:$.objectId+1+" 0 R"});var Ne=$.filter!==void 0?["/"+$.filter]:void 0;if(Y({data:$.data,additionalKeyValues:te,alreadyAppliedFilters:Ne,objectId:$.objectId}),K("endobj"),"sMask"in $&&$.sMask!==void 0){var U,O=(U=$.sMaskBitsPerComponent)!==null&&U!==void 0?U:$.bitsPerComponent,V={width:$.width,height:$.height,colorSpace:"DeviceGray",bitsPerComponent:O,data:$.sMask};"filter"in $&&(V.decodeParameters="/Predictor ".concat($.predictor," /Colors 1 /BitsPerComponent ").concat(O," /Columns ").concat($.width),V.filter=$.filter),F.call(this,V)}if($.colorSpace===A.INDEXED){var Z=this.internal.newObject();Y({data:P(new Uint8Array($.palette)),objectId:Z}),K("endobj")}},l=function(){var F=this.internal.collections[e+"images"];for(var $ in F)s.call(this,F[$])},u=function(){var F,$=this.internal.collections[e+"images"],K=this.internal.write;for(var Y in $)K("/I"+(F=$[Y]).index,F.objectId,"0","R")},c=function(){this.internal.collections[e+"images"]||(this.internal.collections[e+"images"]={},this.internal.events.subscribe("putResources",l),this.internal.events.subscribe("putXobjectDict",u))},h=function(){var F=this.internal.collections[e+"images"];return c.call(this),F},d=function(){return Object.keys(this.internal.collections[e+"images"]).length},m=function(F){return typeof t["process"+F.toUpperCase()]=="function"},y=function(F){return In(F)==="object"&&F.nodeType===1},g=function(F,$){if(F.nodeName==="IMG"&&F.hasAttribute("src")){var K=""+F.getAttribute("src");if(K.indexOf("data:image/")===0)return Lm(unescape(K).split("base64,").pop());var Y=t.loadFile(K,!0);if(Y!==void 0)return Y}if(F.nodeName==="CANVAS"){if(F.width===0||F.height===0)throw new Error("Given canvas must have data. Canvas width: "+F.width+", height: "+F.height);var he;switch($){case"PNG":he="image/png";break;case"WEBP":he="image/webp";break;default:he="image/jpeg"}return Lm(F.toDataURL(he,1).split("base64,").pop())}},x=function(F){var $=this.internal.collections[e+"images"];if($){for(var K in $)if(F===$[K].alias)return $[K]}},_=function(F,$,K){return F||$||(F=-96,$=-96),F<0&&(F=-1*K.width*72/F/this.internal.scaleFactor),$<0&&($=-1*K.height*72/$/this.internal.scaleFactor),F===0&&(F=$*K.width/K.height),$===0&&($=F*K.height/K.width),[F,$]},N=function(F,$,K,Y,he,te){var oe=_.call(this,K,Y,he),le=this.internal.getCoordinateString,pe=this.internal.getVerticalCoordinateString,Ne=h.call(this);if(K=oe[0],Y=oe[1],Ne[he.index]=he,te){te*=Math.PI/180;var U=Math.cos(te),O=Math.sin(te),V=function(ie){return ie.toFixed(4)},Z=[V(U),V(O),V(-1*O),V(U),0,0,"cm"]}this.internal.write("q"),te?(this.internal.write([1,"0","0",1,le(F),pe($+Y),"cm"].join(" ")),this.internal.write(Z.join(" ")),this.internal.write([le(K),"0","0",le(Y),"0","0","cm"].join(" "))):this.internal.write([le(K),"0","0",le(Y),le(F),pe($+Y),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+he.index+" Do"),this.internal.write("Q")},A=t.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};t.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var j=t.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},L=t.__addimage__.sHashCode=function(F){var $,K,Y=0;if(typeof F=="string")for(K=F.length,$=0;$<K;$++)Y=(Y<<5)-Y+F.charCodeAt($),Y|=0;else if(ee(F))for(K=F.byteLength/2,$=0;$<K;$++)Y=(Y<<5)-Y+F[$],Y|=0;return Y},R=t.__addimage__.validateStringAsBase64=function(F){(F=F||"").toString().trim();var $=!0;return F.length===0&&($=!1),F.length%4!=0&&($=!1),/^[A-Za-z0-9+/]+$/.test(F.substr(0,F.length-2))===!1&&($=!1),/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(F.substr(-2))===!1&&($=!1),$},I=t.__addimage__.extractImageFromDataUrl=function(F){if(F==null||!(F=F.trim()).startsWith("data:"))return null;var $=F.indexOf(",");return $<0?null:F.substring(0,$).trim().endsWith("base64")?F.substring($+1):null};t.__addimage__.isArrayBuffer=function(F){return F instanceof ArrayBuffer};var ee=t.__addimage__.isArrayBufferView=function(F){return F instanceof Int8Array||F instanceof Uint8Array||F instanceof Uint8ClampedArray||F instanceof Int16Array||F instanceof Uint16Array||F instanceof Int32Array||F instanceof Uint32Array||F instanceof Float32Array||F instanceof Float64Array},G=t.__addimage__.binaryStringToUint8Array=function(F){for(var $=F.length,K=new Uint8Array($),Y=0;Y<$;Y++)K[Y]=F.charCodeAt(Y);return K},P=t.__addimage__.arrayBufferToBinaryString=function(F){for(var $="",K=ee(F)?F:new Uint8Array(F),Y=0;Y<K.length;Y+=8192)$+=String.fromCharCode.apply(null,K.subarray(Y,Y+8192));return $};t.addImage=function(){var F,$,K,Y,he,te,oe,le,pe;if(typeof arguments[1]=="number"?($=n,K=arguments[1],Y=arguments[2],he=arguments[3],te=arguments[4],oe=arguments[5],le=arguments[6],pe=arguments[7]):($=arguments[1],K=arguments[2],Y=arguments[3],he=arguments[4],te=arguments[5],oe=arguments[6],le=arguments[7],pe=arguments[8]),In(F=arguments[0])==="object"&&!y(F)&&"imageData"in F){var Ne=F;F=Ne.imageData,$=Ne.format||$||n,K=Ne.x||K||0,Y=Ne.y||Y||0,he=Ne.w||Ne.width||he,te=Ne.h||Ne.height||te,oe=Ne.alias||oe,le=Ne.compression||le,pe=Ne.rotation||Ne.angle||pe}var U=this.internal.getFilters();if(le===void 0&&U.indexOf("FlateEncode")!==-1&&(le="SLOW"),isNaN(K)||isNaN(Y))throw new Error("Invalid coordinates passed to jsPDF.addImage");c.call(this);var O=B.call(this,F,$,oe,le);return N.call(this,K,Y,he,te,O,pe),this};var B=function(F,$,K,Y){var he,te,oe;if(typeof F=="string"&&a(F)===n){F=unescape(F);var le=X(F,!1);(le!==""||(le=t.loadFile(F,!0))!==void 0)&&(F=le)}if(y(F)&&(F=g(F,$)),$=a(F,$),!m($))throw new Error("addImage does not support files of type '"+$+"', please ensure that a plugin for '"+$+"' support is added.");if(((oe=K)==null||oe.length===0)&&(K=(function(pe){return typeof pe=="string"||ee(pe)?L(pe):ee(pe.data)?L(pe.data):null})(F)),(he=x.call(this,K))||(F instanceof Uint8Array||$==="RGBA"||(te=F,F=G(F)),he=this["process"+$.toUpperCase()](F,d.call(this),K,(function(pe){return pe&&typeof pe=="string"&&(pe=pe.toUpperCase()),pe in t.image_compression?pe:j.NONE})(Y),te)),!he)throw new Error("An unknown error occurred whilst processing the image.");return he},X=t.__addimage__.convertBase64ToBinaryString=function(F,$){$=typeof $!="boolean"||$;var K,Y="";if(typeof F=="string"){var he;K=(he=I(F))!==null&&he!==void 0?he:F;try{Y=Lm(K)}catch(te){if($)throw R(K)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+te.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return Y};t.getImageProperties=function(F){var $,K,Y="";if(y(F)&&(F=g(F)),typeof F=="string"&&a(F)===n&&((Y=X(F,!1))===""&&(Y=t.loadFile(F)||""),F=Y),K=a(F),!m(K))throw new Error("addImage does not support files of type '"+K+"', please ensure that a plugin for '"+K+"' support is added.");if(F instanceof Uint8Array||(F=G(F)),!($=this["process"+K.toUpperCase()](F)))throw new Error("An unknown error occurred whilst processing the image");return $.fileType=K,$}})(jt.API),(function(t){var e=function(n){if(n!==void 0&&n!="")return!0};jt.API.events.push(["addPage",function(n){this.internal.getPageInfo(n.pageNumber).pageContext.annotations=[]}]),t.events.push(["putPage",function(n){for(var r,a,s,l=this.internal.getCoordinateString,u=this.internal.getVerticalCoordinateString,c=this.internal.getPageInfoByObjId(n.objId),h=n.pageContext.annotations,d=!1,m=0;m<h.length&&!d;m++)switch((r=h[m]).type){case"link":(e(r.options.url)||e(r.options.pageNumber))&&(d=!0);break;case"reference":case"text":case"freetext":d=!0}if(d!=0){this.internal.write("/Annots [");for(var y=0;y<h.length;y++){r=h[y];var g=this.internal.pdfEscape,x=this.internal.getEncryptor(n.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var _=this.internal.newAdditionalObject(),N=this.internal.newAdditionalObject(),A=this.internal.getEncryptor(_.objId),j=r.title||"Note";s="<</Type /Annot /Subtype /Text "+(a="/Rect ["+l(r.bounds.x)+" "+u(r.bounds.y+r.bounds.h)+" "+l(r.bounds.x+r.bounds.w)+" "+u(r.bounds.y)+"] ")+"/Contents ("+g(A(r.contents))+")",s+=" /Popup "+N.objId+" 0 R",s+=" /P "+c.objId+" 0 R",s+=" /T ("+g(A(j))+") >>",_.content=s;var L=_.objId+" 0 R";s="<</Type /Annot /Subtype /Popup "+(a="/Rect ["+l(r.bounds.x+30)+" "+u(r.bounds.y+r.bounds.h)+" "+l(r.bounds.x+r.bounds.w+30)+" "+u(r.bounds.y)+"] ")+" /Parent "+L,r.open&&(s+=" /Open true"),s+=" >>",N.content=s,this.internal.write(_.objId,"0 R",N.objId,"0 R");break;case"freetext":a="/Rect ["+l(r.bounds.x)+" "+u(r.bounds.y)+" "+l(r.bounds.x+r.bounds.w)+" "+u(r.bounds.y+r.bounds.h)+"] ";var R="font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+(r.color||"#000000");s="<</Type /Annot /Subtype /FreeText "+a+"/Contents ("+g(x(r.contents))+")",s+=" /DS("+g(x(R))+")",s+=" /Border [0 0 0]",s+=" >>",this.internal.write(s);break;case"link":if(r.options.name){var I=this.annotations._nameMap[r.options.name];r.options.pageNumber=I.page,r.options.top=I.y}else r.options.top||(r.options.top=0);if(a="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",s="",r.options.url)s="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /A <</S /URI /URI ("+g(x(r.options.url))+") >>";else if(r.options.pageNumber)switch(s="<</Type /Annot /Subtype /Link "+a+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":s+=" /Fit]";break;case"FitH":s+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,s+=" /FitV "+r.options.left+"]";break;default:var ee=u(r.options.top);r.options.left=r.options.left||0,r.options.zoom===void 0&&(r.options.zoom=0),s+=" /XYZ "+r.options.left+" "+ee+" "+r.options.zoom+"]"}s!=""&&(s+=" >>",this.internal.write(s))}}this.internal.write("]")}}]),t.createAnnotation=function(n){var r=this.internal.getCurrentPageInfo();switch(n.type){case"link":this.link(n.bounds.x,n.bounds.y,n.bounds.w,n.bounds.h,n);break;case"text":case"freetext":r.pageContext.annotations.push(n)}},t.link=function(n,r,a,s,l){var u=this.internal.getCurrentPageInfo(),c=this.internal.getCoordinateString,h=this.internal.getVerticalCoordinateString;u.pageContext.annotations.push({finalBounds:{x:c(n),y:h(r),w:c(n+a),h:h(r+s)},options:l,type:"link"})},t.textWithLink=function(n,r,a,s){var l,u,c=this.getTextWidth(n),h=this.internal.getLineHeight()/this.internal.scaleFactor;if(s.maxWidth!==void 0){u=s.maxWidth;var d=this.splitTextToSize(n,u).length;l=Math.ceil(h*d)}else u=c,l=h;return this.text(n,r,a,s),a+=.2*h,s.align==="center"&&(r-=c/2),s.align==="right"&&(r-=c),this.link(r,a-h,u,l,s),c},t.getTextWidth=function(n){var r=this.internal.getFontSize();return this.getStringUnitWidth(n)*r/this.internal.scaleFactor}})(jt.API),(function(t){var e={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},n={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},r={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},a=[1570,1571,1573,1575];t.__arabicParser__={};var s=t.__arabicParser__.isInArabicSubstitutionA=function(_){return e[_.charCodeAt(0)]!==void 0},l=t.__arabicParser__.isArabicLetter=function(_){return typeof _=="string"&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(_)},u=t.__arabicParser__.isArabicEndLetter=function(_){return l(_)&&s(_)&&e[_.charCodeAt(0)].length<=2},c=t.__arabicParser__.isArabicAlfLetter=function(_){return l(_)&&a.indexOf(_.charCodeAt(0))>=0};t.__arabicParser__.arabicLetterHasIsolatedForm=function(_){return l(_)&&s(_)&&e[_.charCodeAt(0)].length>=1};var h=t.__arabicParser__.arabicLetterHasFinalForm=function(_){return l(_)&&s(_)&&e[_.charCodeAt(0)].length>=2};t.__arabicParser__.arabicLetterHasInitialForm=function(_){return l(_)&&s(_)&&e[_.charCodeAt(0)].length>=3};var d=t.__arabicParser__.arabicLetterHasMedialForm=function(_){return l(_)&&s(_)&&e[_.charCodeAt(0)].length==4},m=t.__arabicParser__.resolveLigatures=function(_){var N=0,A=n,j="",L=0;for(N=0;N<_.length;N+=1)A[_.charCodeAt(N)]!==void 0?(L++,typeof(A=A[_.charCodeAt(N)])=="number"&&(j+=String.fromCharCode(A),A=n,L=0),N===_.length-1&&(A=n,j+=_.charAt(N-(L-1)),N-=L-1,L=0)):(A=n,j+=_.charAt(N-L),N-=L,L=0);return j};t.__arabicParser__.isArabicDiacritic=function(_){return _!==void 0&&r[_.charCodeAt(0)]!==void 0};var y=t.__arabicParser__.getCorrectForm=function(_,N,A){return l(_)?s(_)===!1?-1:!h(_)||!l(N)&&!l(A)||!l(A)&&u(N)||u(_)&&!l(N)||u(_)&&c(N)||u(_)&&u(N)?0:d(_)&&l(N)&&!u(N)&&l(A)&&h(A)?3:u(_)||!l(A)?1:2:-1},g=function(_){var N=0,A=0,j=0,L="",R="",I="",ee=(_=_||"").split("\\s+"),G=[];for(N=0;N<ee.length;N+=1){for(G.push(""),A=0;A<ee[N].length;A+=1)L=ee[N][A],R=ee[N][A-1],I=ee[N][A+1],l(L)?(j=y(L,R,I),G[N]+=j!==-1?String.fromCharCode(e[L.charCodeAt(0)][j]):L):G[N]+=L;G[N]=m(G[N])}return G.join(" ")},x=t.__arabicParser__.processArabic=t.processArabic=function(){var _,N=typeof arguments[0]=="string"?arguments[0]:arguments[0].text,A=[];if(Array.isArray(N)){var j=0;for(A=[],j=0;j<N.length;j+=1)Array.isArray(N[j])?A.push([g(N[j][0]),N[j][1],N[j][2]]):A.push([g(N[j])]);_=A}else _=g(N);return typeof arguments[0]=="string"?_:(arguments[0].text=_,arguments[0])};t.events.push(["preProcessText",x])})(jt.API),jt.API.autoPrint=function(t){var e;return(t=t||{}).variant=t.variant||"non-conform",t.variant==="javascript"?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){this.internal.out("/OpenAction "+e+" 0 R")})),this},(function(t){var e=function(){var n=void 0;Object.defineProperty(this,"pdf",{get:function(){return n},set:function(u){n=u}});var r=150;Object.defineProperty(this,"width",{get:function(){return r},set:function(u){r=isNaN(u)||Number.isInteger(u)===!1||u<0?150:u,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=r+1)}});var a=300;Object.defineProperty(this,"height",{get:function(){return a},set:function(u){a=isNaN(u)||Number.isInteger(u)===!1||u<0?300:u,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=a+1)}});var s=[];Object.defineProperty(this,"childNodes",{get:function(){return s},set:function(u){s=u}});var l={};Object.defineProperty(this,"style",{get:function(){return l},set:function(u){l=u}}),Object.defineProperty(this,"parentNode",{})};e.prototype.getContext=function(n,r){var a;if((n=n||"2d")!=="2d")return null;for(a in r)this.pdf.context2d.hasOwnProperty(a)&&(this.pdf.context2d[a]=r[a]);return this.pdf.context2d._canvas=this,this.pdf.context2d},e.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},t.events.push(["initialized",function(){this.canvas=new e,this.canvas.pdf=this}])})(jt.API),(function(t){var e={left:0,top:0,bottom:0,right:0},n=!1,r=function(){this.internal.__cell__===void 0&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},e),this.internal.__cell__.margins.width=this.getPageWidth(),a.call(this))},a=function(){this.internal.__cell__.lastCell=new s,this.internal.__cell__.pages=1},s=function(){var c=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return c},set:function(_){c=_}});var h=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return h},set:function(_){h=_}});var d=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return d},set:function(_){d=_}});var m=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return m},set:function(_){m=_}});var y=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return y},set:function(_){y=_}});var g=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return g},set:function(_){g=_}});var x=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return x},set:function(_){x=_}}),this};s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},s.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},t.setHeaderFunction=function(c){return r.call(this),this.internal.__cell__.headerFunction=typeof c=="function"?c:void 0,this},t.getTextDimensions=function(c,h){r.call(this);var d=(h=h||{}).fontSize||this.getFontSize(),m=h.font||this.getFont(),y=h.scaleFactor||this.internal.scaleFactor,g=0,x=0,_=0,N=this;if(!Array.isArray(c)&&typeof c!="string"){if(typeof c!="number")throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");c=String(c)}var A=h.maxWidth;A>0?typeof c=="string"?c=this.splitTextToSize(c,A):Object.prototype.toString.call(c)==="[object Array]"&&(c=c.reduce(function(L,R){return L.concat(N.splitTextToSize(R,A))},[])):c=Array.isArray(c)?c:[c];for(var j=0;j<c.length;j++)g<(_=this.getStringUnitWidth(c[j],{font:m})*d)&&(g=_);return g!==0&&(x=c.length),{w:g/=y,h:Math.max((x*d*this.getLineHeightFactor()-d*(this.getLineHeightFactor()-1))/y,0)}},t.cellAddPage=function(){r.call(this),this.addPage();var c=this.internal.__cell__.margins||e;return this.internal.__cell__.lastCell=new s(c.left,c.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var l=t.cell=function(){var c;c=arguments[0]instanceof s?arguments[0]:new s(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5],arguments[6]),r.call(this);var h=this.internal.__cell__.lastCell,d=this.internal.__cell__.padding,m=this.internal.__cell__.margins||e,y=this.internal.__cell__.tableHeaderRow,g=this.internal.__cell__.printHeaders;return h.lineNumber!==void 0&&(h.lineNumber===c.lineNumber?(c.x=(h.x||0)+(h.width||0),c.y=h.y||0):h.y+h.height+c.height+m.bottom>this.getPageHeight()?(this.cellAddPage(),c.y=m.top,g&&y&&(this.printHeaderRow(c.lineNumber,!0),c.y+=y[0].height)):c.y=h.y+h.height||c.y),c.text[0]!==void 0&&(this.rect(c.x,c.y,c.width,c.height,n===!0?"FD":void 0),c.align==="right"?this.text(c.text,c.x+c.width-d,c.y+d,{align:"right",baseline:"top"}):c.align==="center"?this.text(c.text,c.x+c.width/2,c.y+d,{align:"center",baseline:"top",maxWidth:c.width-d-d}):this.text(c.text,c.x+d,c.y+d,{align:"left",baseline:"top",maxWidth:c.width-d-d})),this.internal.__cell__.lastCell=c,this};t.table=function(c,h,d,m,y){if(r.call(this),!d)throw new Error("No data for PDF table.");var g,x,_,N,A=[],j=[],L=[],R={},I={},ee=[],G=[],P=(y=y||{}).autoSize||!1,B=y.printHeaders!==!1,X=y.css&&y.css["font-size"]!==void 0?16*y.css["font-size"]:y.fontSize||12,F=y.margins||Object.assign({width:this.getPageWidth()},e),$=typeof y.padding=="number"?y.padding:3,K=y.headerBackgroundColor||"#c8c8c8",Y=y.headerTextColor||"#000";if(a.call(this),this.internal.__cell__.printHeaders=B,this.internal.__cell__.margins=F,this.internal.__cell__.table_font_size=X,this.internal.__cell__.padding=$,this.internal.__cell__.headerBackgroundColor=K,this.internal.__cell__.headerTextColor=Y,this.setFontSize(X),m==null)j=A=Object.keys(d[0]),L=A.map(function(){return"left"});else if(Array.isArray(m)&&In(m[0])==="object")for(A=m.map(function(Ne){return Ne.name}),j=m.map(function(Ne){return Ne.prompt||Ne.name||""}),L=m.map(function(Ne){return Ne.align||"left"}),g=0;g<m.length;g+=1)I[m[g].name]=.7499990551181103*m[g].width;else Array.isArray(m)&&typeof m[0]=="string"&&(j=A=m,L=A.map(function(){return"left"}));if(P||Array.isArray(m)&&typeof m[0]=="string")for(g=0;g<A.length;g+=1){for(R[N=A[g]]=d.map(function(Ne){return Ne[N]}),this.setFont(void 0,"bold"),ee.push(this.getTextDimensions(j[g],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),x=R[N],this.setFont(void 0,"normal"),_=0;_<x.length;_+=1)ee.push(this.getTextDimensions(x[_],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);I[N]=Math.max.apply(null,ee)+$+$,ee=[]}if(B){var he={};for(g=0;g<A.length;g+=1)he[A[g]]={},he[A[g]].text=j[g],he[A[g]].align=L[g];var te=u.call(this,he,I);G=A.map(function(Ne){return new s(c,h,I[Ne],te,he[Ne].text,void 0,he[Ne].align)}),this.setTableHeaderRow(G),this.printHeaderRow(1,!1)}var oe=m.reduce(function(Ne,U){return Ne[U.name]=U.align,Ne},{});for(g=0;g<d.length;g+=1){"rowStart"in y&&y.rowStart instanceof Function&&y.rowStart({row:g,data:d[g]},this);var le=u.call(this,d[g],I);for(_=0;_<A.length;_+=1){var pe=d[g][A[_]];"cellStart"in y&&y.cellStart instanceof Function&&y.cellStart({row:g,col:_,data:pe},this),l.call(this,new s(c,h,I[A[_]],le,pe,g+2,oe[A[_]]))}}return this.internal.__cell__.table_x=c,this.internal.__cell__.table_y=h,this};var u=function(c,h){var d=this.internal.__cell__.padding,m=this.internal.__cell__.table_font_size,y=this.internal.scaleFactor;return Object.keys(c).map(function(g){var x=c[g];return this.splitTextToSize(x.hasOwnProperty("text")?x.text:x,h[g]-d-d)},this).map(function(g){return this.getLineHeightFactor()*g.length*m/y+d+d},this).reduce(function(g,x){return Math.max(g,x)},0)};t.setTableHeaderRow=function(c){r.call(this),this.internal.__cell__.tableHeaderRow=c},t.printHeaderRow=function(c,h){if(r.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var d;if(n=!0,typeof this.internal.__cell__.headerFunction=="function"){var m=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new s(m[0],m[1],m[2],m[3],void 0,-1)}this.setFont(void 0,"bold");for(var y=[],g=0;g<this.internal.__cell__.tableHeaderRow.length;g+=1){d=this.internal.__cell__.tableHeaderRow[g].clone(),h&&(d.y=this.internal.__cell__.margins.top||0,y.push(d)),d.lineNumber=c;var x=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),l.call(this,d),this.setTextColor(x)}y.length>0&&this.setTableHeaderRow(y),this.setFont(void 0,"normal"),n=!1}})(jt.API);var DA={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},PA=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Ey=kA(PA),MA=[100,200,300,400,500,600,700,800,900],oz=kA(MA);function pv(t){var e=t.family.replace(/"|'/g,"").toLowerCase(),n=(function(s){return DA[s=s||"normal"]?s:"normal"})(t.style),r=(function(s){return s?typeof s=="number"?s>=100&&s<=900&&s%100==0?s:400:/^\d00$/.test(s)?parseInt(s):s==="bold"?700:400:400})(t.weight),a=(function(s){return typeof Ey[s=s||"normal"]=="number"?s:"normal"})(t.stretch);return{family:e,style:n,weight:r,stretch:a,src:t.src||[],ref:t.ref||{name:e,style:[a,n,r].join(" ")}}}function N_(t,e,n,r){var a;for(a=n;a>=0&&a<e.length;a+=r)if(t[e[a]])return t[e[a]];for(a=n;a>=0&&a<e.length;a-=r)if(t[e[a]])return t[e[a]]}var lz={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},C_={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function T_(t){return[t.stretch,t.style,t.weight,t.family].join(" ")}function L_(t){return t.trimLeft()}function uz(t,e){for(var n=0;n<t.length;){if(t.charAt(n)===e)return[t.substring(0,n),t.substring(n+1)];n+=1}return null}function cz(t){var e=t.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return e===null?null:[e[0],t.substring(e[0].length)]}var vf,gm,j_,O_,R_,mv=["times"];function k_(t,e,n,r,a){var s=4,l=P_;switch(a){case jt.API.image_compression.FAST:s=1,l=D_;break;case jt.API.image_compression.MEDIUM:s=6,l=M_;break;case jt.API.image_compression.SLOW:s=9,l=I_}t=(function(c,h,d,m){for(var y,g=c.length/h,x=new Uint8Array(c.length+g),_=[fz,D_,P_,M_,I_],N=0;N<g;N+=1){var A=N*h,j=c.subarray(A,A+h);if(m)x.set(m(j,d,y),A+N);else{for(var L=_.length,R=[],I=0;I<L;I+=1)R[I]=_[I](j,d,y);var ee=dz(R.concat());x.set(R[ee],A+N)}y=j}return x})(t,e,Math.ceil(n*r/8),l);var u=vy(t,{level:s});return jt.API.__addimage__.arrayBufferToBinaryString(u)}function fz(t){var e=Array.apply([],t);return e.unshift(0),e}function D_(t,e){var n=t.length,r=[];r[0]=1;for(var a=0;a<n;a+=1){var s=t[a-e]||0;r[a+1]=t[a]-s+256&255}return r}function P_(t,e,n){var r=t.length,a=[];a[0]=2;for(var s=0;s<r;s+=1){var l=n&&n[s]||0;a[s+1]=t[s]-l+256&255}return a}function M_(t,e,n){var r=t.length,a=[];a[0]=3;for(var s=0;s<r;s+=1){var l=t[s-e]||0,u=n&&n[s]||0;a[s+1]=t[s]+256-(l+u>>>1)&255}return a}function I_(t,e,n){var r=t.length,a=[];a[0]=4;for(var s=0;s<r;s+=1){var l=hz(t[s-e]||0,n&&n[s]||0,n&&n[s-e]||0);a[s+1]=t[s]-l+256&255}return a}function hz(t,e,n){if(t===e&&e===n)return t;var r=Math.abs(e-n),a=Math.abs(t-n),s=Math.abs(t+e-n-n);return r<=a&&r<=s?t:a<=s?e:n}function dz(t){var e=t.map(function(n){return n.reduce(function(r,a){return r+Math.abs(a)},0)});return e.indexOf(Math.min.apply(null,e))}function gv(t,e,n){var r=e*n,a=Math.floor(r/8),s=16-(r-8*a+n),l=(1<<n)-1;return IA(t,a)>>s&l}function F_(t,e,n,r){var a=n*r,s=Math.floor(a/8),l=16-(a-8*s+r),u=(1<<r)-1,c=(e&u)<<l;(function(h,d,m){if(d+1<h.byteLength)h.setUint16(d,m,!1);else{var y=m>>8&255;h.setUint8(d,y)}})(t,s,IA(t,s)&~(u<<l)&65535|c)}function IA(t,e){return e+1<t.byteLength?t.getUint16(e,!1):t.getUint8(e)<<8}function pz(t){var e=0;if(t[e++]!==71||t[e++]!==73||t[e++]!==70||t[e++]!==56||(t[e++]+1&253)!=56||t[e++]!==97)throw new Error("Invalid GIF 87a/89a header.");var n=t[e++]|t[e++]<<8,r=t[e++]|t[e++]<<8,a=t[e++],s=a>>7,l=1<<1+(7&a);t[e++],t[e++];var u=null,c=null;s&&(u=e,c=l,e+=3*l);var h=!0,d=[],m=0,y=null,g=0,x=null;for(this.width=n,this.height=r;h&&e<t.length;)switch(t[e++]){case 33:switch(t[e++]){case 255:if(t[e]!==11||t[e+1]==78&&t[e+2]==69&&t[e+3]==84&&t[e+4]==83&&t[e+5]==67&&t[e+6]==65&&t[e+7]==80&&t[e+8]==69&&t[e+9]==50&&t[e+10]==46&&t[e+11]==48&&t[e+12]==3&&t[e+13]==1&&t[e+16]==0)e+=14,x=t[e++]|t[e++]<<8,e++;else for(e+=12;;){if(!((F=t[e++])>=0))throw Error("Invalid block size");if(F===0)break;e+=F}break;case 249:if(t[e++]!==4||t[e+4]!==0)throw new Error("Invalid graphics extension block.");var _=t[e++];m=t[e++]|t[e++]<<8,y=t[e++],1&_||(y=null),g=_>>2&7,e++;break;case 254:for(;;){if(!((F=t[e++])>=0))throw Error("Invalid block size");if(F===0)break;e+=F}break;default:throw new Error("Unknown graphic control label: 0x"+t[e-1].toString(16))}break;case 44:var N=t[e++]|t[e++]<<8,A=t[e++]|t[e++]<<8,j=t[e++]|t[e++]<<8,L=t[e++]|t[e++]<<8,R=t[e++],I=R>>6&1,ee=1<<1+(7&R),G=u,P=c,B=!1;R>>7&&(B=!0,G=e,P=ee,e+=3*ee);var X=e;for(e++;;){var F;if(!((F=t[e++])>=0))throw Error("Invalid block size");if(F===0)break;e+=F}d.push({x:N,y:A,width:j,height:L,has_local_palette:B,palette_offset:G,palette_size:P,data_offset:X,data_length:e-X,transparent_index:y,interlaced:!!I,delay:m,disposal:g});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+t[e-1].toString(16))}this.numFrames=function(){return d.length},this.loopCount=function(){return x},this.frameInfo=function($){if($<0||$>=d.length)throw new Error("Frame index out of range.");return d[$]},this.decodeAndBlitFrameBGRA=function($,K){var Y=this.frameInfo($),he=Y.width*Y.height;if(he>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var te=new Uint8Array(he);U_(t,Y.data_offset,te,he);var oe=Y.palette_offset,le=Y.transparent_index;le===null&&(le=256);var pe=Y.width,Ne=n-pe,U=pe,O=4*(Y.y*n+Y.x),V=4*((Y.y+Y.height)*n+Y.x),Z=O,ie=4*Ne;Y.interlaced===!0&&(ie+=4*n*7);for(var z=8,se=0,ge=te.length;se<ge;++se){var xe=te[se];if(U===0&&(U=pe,(Z+=ie)>=V&&(ie=4*Ne+4*n*(z-1),Z=O+(pe+Ne)*(z<<1),z>>=1)),xe===le)Z+=4;else{var Re=t[oe+3*xe],De=t[oe+3*xe+1],qe=t[oe+3*xe+2];K[Z++]=qe,K[Z++]=De,K[Z++]=Re,K[Z++]=255}--U}},this.decodeAndBlitFrameRGBA=function($,K){var Y=this.frameInfo($),he=Y.width*Y.height;if(he>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");var te=new Uint8Array(he);U_(t,Y.data_offset,te,he);var oe=Y.palette_offset,le=Y.transparent_index;le===null&&(le=256);var pe=Y.width,Ne=n-pe,U=pe,O=4*(Y.y*n+Y.x),V=4*((Y.y+Y.height)*n+Y.x),Z=O,ie=4*Ne;Y.interlaced===!0&&(ie+=4*n*7);for(var z=8,se=0,ge=te.length;se<ge;++se){var xe=te[se];if(U===0&&(U=pe,(Z+=ie)>=V&&(ie=4*Ne+4*n*(z-1),Z=O+(pe+Ne)*(z<<1),z>>=1)),xe===le)Z+=4;else{var Re=t[oe+3*xe],De=t[oe+3*xe+1],qe=t[oe+3*xe+2];K[Z++]=Re,K[Z++]=De,K[Z++]=qe,K[Z++]=255}--U}}}function U_(t,e,n,r){for(var a=t[e++],s=1<<a,l=s+1,u=l+1,c=a+1,h=(1<<c)-1,d=0,m=0,y=0,g=t[e++],x=new Int32Array(4096),_=null;;){for(;d<16&&g!==0;)m|=t[e++]<<d,d+=8,g===1?g=t[e++]:--g;if(d<c)break;var N=m&h;if(m>>=c,d-=c,N!==s){if(N===l)break;for(var A=N<u?N:_,j=0,L=A;L>s;)L=x[L]>>8,++j;var R=L;if(y+j+(A!==N?1:0)>r)return void pr.log("Warning, gif stream longer than expected.");n[y++]=R;var I=y+=j;for(A!==N&&(n[y++]=R),L=A;j--;)L=x[L],n[--I]=255&L,L>>=8;_!==null&&u<4096&&(x[u++]=_<<8|R,u>=h+1&&c<12&&(++c,h=h<<1|1)),_=N}else u=l+1,h=(1<<(c=a+1))-1,_=null}return y!==r&&pr.log("Warning, gif stream shorter than expected."),n}/**
|
|
1070
|
+
* @license
|
|
1071
|
+
Copyright (c) 2008, Adobe Systems Incorporated
|
|
1072
|
+
All rights reserved.
|
|
1073
|
+
|
|
1074
|
+
Redistribution and use in source and binary forms, with or without
|
|
1075
|
+
modification, are permitted provided that the following conditions are
|
|
1076
|
+
met:
|
|
1077
|
+
|
|
1078
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
1079
|
+
this list of conditions and the following disclaimer.
|
|
1080
|
+
|
|
1081
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
1082
|
+
notice, this list of conditions and the following disclaimer in the
|
|
1083
|
+
documentation and/or other materials provided with the distribution.
|
|
1084
|
+
|
|
1085
|
+
* Neither the name of Adobe Systems Incorporated nor the names of its
|
|
1086
|
+
contributors may be used to endorse or promote products derived from
|
|
1087
|
+
this software without specific prior written permission.
|
|
1088
|
+
|
|
1089
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
1090
|
+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
1091
|
+
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
1092
|
+
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
1093
|
+
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
1094
|
+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
1095
|
+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
1096
|
+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
1097
|
+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
1098
|
+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
1099
|
+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1100
|
+
*/function vv(t){var e,n,r,a,s,l=Math.floor,u=new Array(64),c=new Array(64),h=new Array(64),d=new Array(64),m=new Array(65535),y=new Array(65535),g=new Array(64),x=new Array(64),_=[],N=0,A=7,j=new Array(64),L=new Array(64),R=new Array(64),I=new Array(256),ee=new Array(2048),G=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],P=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],B=[0,1,2,3,4,5,6,7,8,9,10,11],X=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],F=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],$=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],K=[0,1,2,3,4,5,6,7,8,9,10,11],Y=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],he=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function te(O,V){for(var Z=0,ie=0,z=new Array,se=1;se<=16;se++){for(var ge=1;ge<=O[se];ge++)z[V[ie]]=[],z[V[ie]][0]=Z,z[V[ie]][1]=se,ie++,Z++;Z*=2}return z}function oe(O){for(var V=O[0],Z=O[1]-1;Z>=0;)V&1<<Z&&(N|=1<<A),Z--,--A<0&&(N==255?(le(255),le(0)):le(N),A=7,N=0)}function le(O){_.push(O)}function pe(O){le(O>>8&255),le(255&O)}function Ne(O,V,Z,ie,z){for(var se,ge=z[0],xe=z[240],Re=(function(Ve,gt){var ut,Ot,Ct,en,tn,Bt,pn,an,lt,kt,Et=0;for(lt=0;lt<8;++lt){ut=Ve[Et],Ot=Ve[Et+1],Ct=Ve[Et+2],en=Ve[Et+3],tn=Ve[Et+4],Bt=Ve[Et+5],pn=Ve[Et+6];var gr=ut+(an=Ve[Et+7]),fn=ut-an,Dt=Ot+pn,Tt=Ot-pn,mn=Ct+Bt,Lt=Ct-Bt,Hn=en+tn,Ut=en-tn,qt=gr+Hn,kn=gr-Hn,nn=Dt+mn,_t=Dt-mn;Ve[Et]=qt+nn,Ve[Et+4]=qt-nn;var Sn=.707106781*(_t+kn);Ve[Et+2]=kn+Sn,Ve[Et+6]=kn-Sn;var Xa=.382683433*((qt=Ut+Lt)-(_t=Tt+fn)),sa=.5411961*qt+Xa,ci=1.306562965*_t+Xa,ma=.707106781*(nn=Lt+Tt),At=fn+ma,yi=fn-ma;Ve[Et+5]=yi+sa,Ve[Et+3]=yi-sa,Ve[Et+1]=At+ci,Ve[Et+7]=At-ci,Et+=8}for(Et=0,lt=0;lt<8;++lt){ut=Ve[Et],Ot=Ve[Et+8],Ct=Ve[Et+16],en=Ve[Et+24],tn=Ve[Et+32],Bt=Ve[Et+40],pn=Ve[Et+48];var bi=ut+(an=Ve[Et+56]),Ba=ut-an,de=Ot+pn,ve=Ot-pn,Ee=Ct+Bt,Be=Ct-Bt,Je=en+tn,at=en-tn,et=bi+Je,ct=bi-Je,Qe=de+Ee,st=de-Ee;Ve[Et]=et+Qe,Ve[Et+32]=et-Qe;var St=.707106781*(st+ct);Ve[Et+16]=ct+St,Ve[Et+48]=ct-St;var Ht=.382683433*((et=at+Be)-(st=ve+Ba)),dt=.5411961*et+Ht,Yt=1.306562965*st+Ht,bn=.707106781*(Qe=Be+ve),Bn=Ba+bn,_n=Ba-bn;Ve[Et+40]=_n+dt,Ve[Et+24]=_n-dt,Ve[Et+8]=Bn+Yt,Ve[Et+56]=Bn-Yt,Et++}for(lt=0;lt<64;++lt)kt=Ve[lt]*gt[lt],g[lt]=kt>0?kt+.5|0:kt-.5|0;return g})(O,V),De=0;De<64;++De)x[G[De]]=Re[De];var qe=x[0]-Z;Z=x[0],qe==0?oe(ie[0]):(oe(ie[y[se=32767+qe]]),oe(m[se]));for(var Pe=63;Pe>0&&x[Pe]==0;)Pe--;if(Pe==0)return oe(ge),Z;for(var Ke,ne=1;ne<=Pe;){for(var We=ne;x[ne]==0&&ne<=Pe;)++ne;var it=ne-We;if(it>=16){Ke=it>>4;for(var tt=1;tt<=Ke;++tt)oe(xe);it&=15}se=32767+x[ne],oe(z[(it<<4)+y[se]]),oe(m[se]),ne++}return Pe!=63&&oe(ge),Z}function U(O){O=Math.min(Math.max(O,1),100),s!=O&&((function(V){for(var Z=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],ie=0;ie<64;ie++){var z=l((Z[ie]*V+50)/100);z=Math.min(Math.max(z,1),255),u[G[ie]]=z}for(var se=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],ge=0;ge<64;ge++){var xe=l((se[ge]*V+50)/100);xe=Math.min(Math.max(xe,1),255),c[G[ge]]=xe}for(var Re=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],De=0,qe=0;qe<8;qe++)for(var Pe=0;Pe<8;Pe++)h[De]=1/(u[G[De]]*Re[qe]*Re[Pe]*8),d[De]=1/(c[G[De]]*Re[qe]*Re[Pe]*8),De++})(O<50?Math.floor(5e3/O):Math.floor(200-2*O)),s=O)}this.encode=function(O,V){V&&U(V),_=new Array,N=0,A=7,pe(65496),pe(65504),pe(16),le(74),le(70),le(73),le(70),le(0),le(1),le(1),le(0),pe(1),pe(1),le(0),le(0),(function(){pe(65499),pe(132),le(0);for(var Ot=0;Ot<64;Ot++)le(u[Ot]);le(1);for(var Ct=0;Ct<64;Ct++)le(c[Ct])})(),(function(Ot,Ct){pe(65472),pe(17),le(8),pe(Ct),pe(Ot),le(3),le(1),le(17),le(0),le(2),le(17),le(1),le(3),le(17),le(1)})(O.width,O.height),(function(){pe(65476),pe(418),le(0);for(var Ot=0;Ot<16;Ot++)le(P[Ot+1]);for(var Ct=0;Ct<=11;Ct++)le(B[Ct]);le(16);for(var en=0;en<16;en++)le(X[en+1]);for(var tn=0;tn<=161;tn++)le(F[tn]);le(1);for(var Bt=0;Bt<16;Bt++)le($[Bt+1]);for(var pn=0;pn<=11;pn++)le(K[pn]);le(17);for(var an=0;an<16;an++)le(Y[an+1]);for(var lt=0;lt<=161;lt++)le(he[lt])})(),pe(65498),pe(12),le(3),le(1),le(0),le(2),le(17),le(3),le(17),le(0),le(63),le(0);var Z=0,ie=0,z=0;N=0,A=7,this.encode.displayName="_encode_";for(var se,ge,xe,Re,De,qe,Pe,Ke,ne,We=O.data,it=O.width,tt=O.height,Ve=4*it,gt=0;gt<tt;){for(se=0;se<Ve;){for(De=Ve*gt+se,Pe=-1,Ke=0,ne=0;ne<64;ne++)qe=De+(Ke=ne>>3)*Ve+(Pe=4*(7&ne)),gt+Ke>=tt&&(qe-=Ve*(gt+1+Ke-tt)),se+Pe>=Ve&&(qe-=se+Pe-Ve+4),ge=We[qe++],xe=We[qe++],Re=We[qe++],j[ne]=(ee[ge]+ee[xe+256|0]+ee[Re+512|0]>>16)-128,L[ne]=(ee[ge+768|0]+ee[xe+1024|0]+ee[Re+1280|0]>>16)-128,R[ne]=(ee[ge+1280|0]+ee[xe+1536|0]+ee[Re+1792|0]>>16)-128;Z=Ne(j,h,Z,e,r),ie=Ne(L,d,ie,n,a),z=Ne(R,d,z,n,a),se+=32}gt+=8}if(A>=0){var ut=[];ut[1]=A+1,ut[0]=(1<<A+1)-1,oe(ut)}return pe(65497),new Uint8Array(_)},t=t||50,(function(){for(var O=String.fromCharCode,V=0;V<256;V++)I[V]=O(V)})(),e=te(P,B),n=te($,K),r=te(X,F),a=te(Y,he),(function(){for(var O=1,V=2,Z=1;Z<=15;Z++){for(var ie=O;ie<V;ie++)y[32767+ie]=Z,m[32767+ie]=[],m[32767+ie][1]=Z,m[32767+ie][0]=ie;for(var z=-(V-1);z<=-O;z++)y[32767+z]=Z,m[32767+z]=[],m[32767+z][1]=Z,m[32767+z][0]=V-1+z;O<<=1,V<<=1}})(),(function(){for(var O=0;O<256;O++)ee[O]=19595*O,ee[O+256|0]=38470*O,ee[O+512|0]=7471*O+32768,ee[O+768|0]=-11059*O,ee[O+1024|0]=-21709*O,ee[O+1280|0]=32768*O+8421375,ee[O+1536|0]=-27439*O,ee[O+1792|0]=-5329*O})(),U(t)}/**
|
|
1101
|
+
* @license
|
|
1102
|
+
* Copyright (c) 2017 Aras Abbasi
|
|
1103
|
+
*
|
|
1104
|
+
* Licensed under the MIT License.
|
|
1105
|
+
* http://opensource.org/licenses/mit-license
|
|
1106
|
+
*/function Ys(t,e){if(this.pos=0,this.buffer=t,this.datav=new DataView(t.buffer),this.is_with_alpha=!!e,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,["BM","BA","CI","CP","IC","PT"].indexOf(this.flag)===-1)throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function B_(t){function e(B){if(!B)throw Error("assert :P")}function n(B,X,F){for(var $=0;4>$;$++)if(B[X+$]!=F.charCodeAt($))return!0;return!1}function r(B,X,F,$,K){for(var Y=0;Y<K;Y++)B[X+Y]=F[$+Y]}function a(B,X,F,$){for(var K=0;K<$;K++)B[X+K]=F}function s(B){return new Int32Array(B)}function l(B,X){for(var F=[],$=0;$<B;$++)F.push(new X);return F}function u(B,X){var F=[];return(function $(K,Y,he){for(var te=he[Y],oe=0;oe<te&&(K.push(he.length>Y+1?[]:new X),!(he.length<Y+1));oe++)$(K[oe],Y+1,he)})(F,0,B),F}var c=function(){var B=this;function X(v,w){for(var T=1<<w-1>>>0;v&T;)T>>>=1;return T?(v&T-1)+T:v}function F(v,w,T,k,H){e(!(k%T));do v[w+(k-=T)]=H;while(0<k)}function $(v,w,T,k,H){if(e(2328>=H),512>=H)var W=s(512);else if((W=s(H))==null)return 0;return(function(J,re,ae,fe,be,Le){var ce,Se,Ce=re,Fe=1<<ae,Te=s(16),Ie=s(16);for(e(be!=0),e(fe!=null),e(J!=null),e(0<ae),Se=0;Se<be;++Se){if(15<fe[Se])return 0;++Te[fe[Se]]}if(Te[0]==be)return 0;for(Ie[1]=0,ce=1;15>ce;++ce){if(Te[ce]>1<<ce)return 0;Ie[ce+1]=Ie[ce]+Te[ce]}for(Se=0;Se<be;++Se)ce=fe[Se],0<fe[Se]&&(Le[Ie[ce]++]=Se);if(Ie[15]==1)return(fe=new K).g=0,fe.value=Le[0],F(J,Ce,1,Fe,fe),Fe;var ze,Ze=-1,Ye=Fe-1,bt=0,ft=1,Zt=1,mt=1<<ae;for(Se=0,ce=1,be=2;ce<=ae;++ce,be<<=1){if(ft+=Zt<<=1,0>(Zt-=Te[ce]))return 0;for(;0<Te[ce];--Te[ce])(fe=new K).g=ce,fe.value=Le[Se++],F(J,Ce+bt,be,mt,fe),bt=X(bt,ce)}for(ce=ae+1,be=2;15>=ce;++ce,be<<=1){if(ft+=Zt<<=1,0>(Zt-=Te[ce]))return 0;for(;0<Te[ce];--Te[ce]){if(fe=new K,(bt&Ye)!=Ze){for(Ce+=mt,ze=1<<(Ze=ce)-ae;15>Ze&&!(0>=(ze-=Te[Ze]));)++Ze,ze<<=1;Fe+=mt=1<<(ze=Ze-ae),J[re+(Ze=bt&Ye)].g=ze+ae,J[re+Ze].value=Ce-re-Ze}fe.g=ce-ae,fe.value=Le[Se++],F(J,Ce+(bt>>ae),be,mt,fe),bt=X(bt,ce)}}return ft!=2*Ie[15]-1?0:Fe})(v,w,T,k,H,W)}function K(){this.value=this.g=0}function Y(){this.value=this.g=0}function he(){this.G=l(5,K),this.H=s(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=l(el,Y)}function te(v,w,T,k){e(v!=null),e(w!=null),e(2147483648>k),v.Ca=254,v.I=0,v.b=-8,v.Ka=0,v.oa=w,v.pa=T,v.Jd=w,v.Yc=T+k,v.Zc=4<=k?T+k-4+1:T,ge(v)}function oe(v,w){for(var T=0;0<w--;)T|=Re(v,128)<<w;return T}function le(v,w){var T=oe(v,w);return xe(v)?-T:T}function pe(v,w,T,k){var H,W=0;for(e(v!=null),e(w!=null),e(4294967288>k),v.Sb=k,v.Ra=0,v.u=0,v.h=0,4<k&&(k=4),H=0;H<k;++H)W+=w[T+H]<<8*H;v.Ra=W,v.bb=k,v.oa=w,v.pa=T}function Ne(v){for(;8<=v.u&&v.bb<v.Sb;)v.Ra>>>=8,v.Ra+=v.oa[v.pa+v.bb]<<va-8>>>0,++v.bb,v.u-=8;ie(v)&&(v.h=1,v.u=0)}function U(v,w){if(e(0<=w),!v.h&&w<=tl){var T=Z(v)&fo[w];return v.u+=w,Ne(v),T}return v.h=1,v.u=0}function O(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function V(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function Z(v){return v.Ra>>>(v.u&va-1)>>>0}function ie(v){return e(v.bb<=v.Sb),v.h||v.bb==v.Sb&&v.u>va}function z(v,w){v.u=w,v.h=ie(v)}function se(v){v.u>=za&&(e(v.u>=za),Ne(v))}function ge(v){e(v!=null&&v.oa!=null),v.pa<v.Zc?(v.I=(v.oa[v.pa++]|v.I<<8)>>>0,v.b+=8):(e(v!=null&&v.oa!=null),v.pa<v.Yc?(v.b+=8,v.I=v.oa[v.pa++]|v.I<<8):v.Ka?v.b=0:(v.I<<=8,v.b+=8,v.Ka=1))}function xe(v){return oe(v,1)}function Re(v,w){var T=v.Ca;0>v.b&&ge(v);var k=v.b,H=T*w>>>8,W=(v.I>>>k>H)+0;for(W?(T-=H,v.I-=H+1<<k>>>0):T=H+1,k=T,H=0;256<=k;)H+=8,k>>=8;return k=7^H+nl[k],v.b-=k,v.Ca=(T<<k)-1,W}function De(v,w,T){v[w+0]=T>>24&255,v[w+1]=T>>16&255,v[w+2]=T>>8&255,v[w+3]=255&T}function qe(v,w){return v[w+0]|v[w+1]<<8}function Pe(v,w){return qe(v,w)|v[w+2]<<16}function Ke(v,w){return qe(v,w)|qe(v,w+2)<<16}function ne(v,w){var T=1<<w;return e(v!=null),e(0<w),v.X=s(T),v.X==null?0:(v.Mb=32-w,v.Xa=w,1)}function We(v,w){e(v!=null),e(w!=null),e(v.Xa==w.Xa),r(w.X,0,v.X,0,1<<w.Xa)}function it(){this.X=[],this.Xa=this.Mb=0}function tt(v,w,T,k){e(T!=null),e(k!=null);var H=T[0],W=k[0];return H==0&&(H=(v*W+w/2)/w),W==0&&(W=(w*H+v/2)/v),0>=H||0>=W?0:(T[0]=H,k[0]=W,1)}function Ve(v,w){return v+(1<<w)-1>>>w}function gt(v,w){return((4278255360&v)+(4278255360&w)>>>0&4278255360)+((16711935&v)+(16711935&w)>>>0&16711935)>>>0}function ut(v,w){B[w]=function(T,k,H,W,J,re,ae){var fe;for(fe=0;fe<J;++fe){var be=B[v](re[ae+fe-1],H,W+fe);re[ae+fe]=gt(T[k+fe],be)}}}function Ot(){this.ud=this.hd=this.jd=0}function Ct(v,w){return((4278124286&(v^w))>>>1)+(v&w)>>>0}function en(v){return 0<=v&&256>v?v:0>v?0:255<v?255:void 0}function tn(v,w){return en(v+(v-w+.5>>1))}function Bt(v,w,T){return Math.abs(w-T)-Math.abs(v-T)}function pn(v,w,T,k,H,W,J){for(k=W[J-1],T=0;T<H;++T)W[J+T]=k=gt(v[w+T],k)}function an(v,w,T,k,H){var W;for(W=0;W<T;++W){var J=v[w+W],re=J>>8&255,ae=16711935&(ae=(ae=16711935&J)+((re<<16)+re));k[H+W]=(4278255360&J)+ae>>>0}}function lt(v,w){w.jd=255&v,w.hd=v>>8&255,w.ud=v>>16&255}function kt(v,w,T,k,H,W){var J;for(J=0;J<k;++J){var re=w[T+J],ae=re>>>8,fe=re,be=255&(be=(be=re>>>16)+((v.jd<<24>>24)*(ae<<24>>24)>>>5));fe=255&(fe=(fe+=(v.hd<<24>>24)*(ae<<24>>24)>>>5)+((v.ud<<24>>24)*(be<<24>>24)>>>5)),H[W+J]=(4278255360&re)+(be<<16)+fe}}function Et(v,w,T,k,H){B[w]=function(W,J,re,ae,fe,be,Le,ce,Se){for(ae=Le;ae<ce;++ae)for(Le=0;Le<Se;++Le)fe[be++]=H(re[k(W[J++])])},B[v]=function(W,J,re,ae,fe,be,Le){var ce=8>>W.b,Se=W.Ea,Ce=W.K[0],Fe=W.w;if(8>ce)for(W=(1<<W.b)-1,Fe=(1<<ce)-1;J<re;++J){var Te,Ie=0;for(Te=0;Te<Se;++Te)Te&W||(Ie=k(ae[fe++])),be[Le++]=H(Ce[Ie&Fe]),Ie>>=ce}else B["VP8LMapColor"+T](ae,fe,Ce,Fe,be,Le,J,re,Se)}}function gr(v,w,T,k,H){for(T=w+T;w<T;){var W=v[w++];k[H++]=W>>16&255,k[H++]=W>>8&255,k[H++]=255&W}}function fn(v,w,T,k,H){for(T=w+T;w<T;){var W=v[w++];k[H++]=W>>16&255,k[H++]=W>>8&255,k[H++]=255&W,k[H++]=W>>24&255}}function Dt(v,w,T,k,H){for(T=w+T;w<T;){var W=(J=v[w++])>>16&240|J>>12&15,J=240&J|J>>28&15;k[H++]=W,k[H++]=J}}function Tt(v,w,T,k,H){for(T=w+T;w<T;){var W=(J=v[w++])>>16&248|J>>13&7,J=J>>5&224|J>>3&31;k[H++]=W,k[H++]=J}}function mn(v,w,T,k,H){for(T=w+T;w<T;){var W=v[w++];k[H++]=255&W,k[H++]=W>>8&255,k[H++]=W>>16&255}}function Lt(v,w,T,k,H,W){if(W==0)for(T=w+T;w<T;)De(k,((W=v[w++])[0]>>24|W[1]>>8&65280|W[2]<<8&16711680|W[3]<<24)>>>0),H+=32;else r(k,H,v,w,T)}function Hn(v,w){B[w][0]=B[v+"0"],B[w][1]=B[v+"1"],B[w][2]=B[v+"2"],B[w][3]=B[v+"3"],B[w][4]=B[v+"4"],B[w][5]=B[v+"5"],B[w][6]=B[v+"6"],B[w][7]=B[v+"7"],B[w][8]=B[v+"8"],B[w][9]=B[v+"9"],B[w][10]=B[v+"10"],B[w][11]=B[v+"11"],B[w][12]=B[v+"12"],B[w][13]=B[v+"13"],B[w][14]=B[v+"0"],B[w][15]=B[v+"0"]}function Ut(v){return v==Hu||v==Oc||v==Kl||v==Rc}function qt(){this.eb=[],this.size=this.A=this.fb=0}function kn(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function nn(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new qt,this.f.kb=new kn,this.sd=null}function _t(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function Sn(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function Xa(v){return alert("todo:WebPSamplerProcessPlane"),v.T}function sa(v,w){var T=v.T,k=w.ba.f.RGBA,H=k.eb,W=k.fb+v.ka*k.A,J=xa[w.ba.S],re=v.y,ae=v.O,fe=v.f,be=v.N,Le=v.ea,ce=v.W,Se=w.cc,Ce=w.dc,Fe=w.Mc,Te=w.Nc,Ie=v.ka,ze=v.ka+v.T,Ze=v.U,Ye=Ze+1>>1;for(Ie==0?J(re,ae,null,null,fe,be,Le,ce,fe,be,Le,ce,H,W,null,null,Ze):(J(w.ec,w.fc,re,ae,Se,Ce,Fe,Te,fe,be,Le,ce,H,W-k.A,H,W,Ze),++T);Ie+2<ze;Ie+=2)Se=fe,Ce=be,Fe=Le,Te=ce,be+=v.Rc,ce+=v.Rc,W+=2*k.A,J(re,(ae+=2*v.fa)-v.fa,re,ae,Se,Ce,Fe,Te,fe,be,Le,ce,H,W-k.A,H,W,Ze);return ae+=v.fa,v.j+ze<v.o?(r(w.ec,w.fc,re,ae,Ze),r(w.cc,w.dc,fe,be,Ye),r(w.Mc,w.Nc,Le,ce,Ye),T--):1&ze||J(re,ae,null,null,fe,be,Le,ce,fe,be,Le,ce,H,W+k.A,null,null,Ze),T}function ci(v,w,T){var k=v.F,H=[v.J];if(k!=null){var W=v.U,J=w.ba.S,re=J==qu||J==Kl;w=w.ba.f.RGBA;var ae=[0],fe=v.ka;ae[0]=v.T,v.Kb&&(fe==0?--ae[0]:(--fe,H[0]-=v.width),v.j+v.ka+v.T==v.o&&(ae[0]=v.o-v.j-fe));var be=w.eb;fe=w.fb+fe*w.A,v=Uu(k,H[0],v.width,W,ae,be,fe+(re?0:3),w.A),e(T==ae),v&&Ut(J)&&ol(be,fe,re,W,ae,w.A)}return 0}function ma(v){var w=v.ma,T=w.ba.S,k=11>T,H=T==Da||T==Ai||T==qu||T==Yl||T==12||Ut(T);if(w.memory=null,w.Ib=null,w.Jb=null,w.Nd=null,!Oa(w.Oa,v,H?11:12))return 0;if(H&&Ut(T)&&Ps(),v.da)alert("todo:use_scaling");else{if(k){if(w.Ib=Xa,v.Kb){if(T=v.U+1>>1,w.memory=s(v.U+2*T),w.memory==null)return 0;w.ec=w.memory,w.fc=0,w.cc=w.ec,w.dc=w.fc+v.U,w.Mc=w.cc,w.Nc=w.dc+T,w.Ib=sa,Ps()}}else alert("todo:EmitYUV");H&&(w.Jb=ci,k&&br())}if(k&&!So){for(v=0;256>v;++v)Sa[v]=89858*(v-128)+Zl>>Oi,Wg[v]=-22014*(v-128)+Zl,Gd[v]=-45773*(v-128),Ic[v]=113618*(v-128)+Zl>>Oi;for(v=fl;v<xo;++v)w=76283*(v-16)+Zl>>Oi,Yg[v-fl]=ua(w,255),Kg[v-fl]=ua(w+8>>4,15);So=1}return 1}function At(v){var w=v.ma,T=v.U,k=v.T;return e(!(1&v.ka)),0>=T||0>=k?0:(T=w.Ib(v,w),w.Jb!=null&&w.Jb(v,w,T),w.Dc+=T,1)}function yi(v){v.ma.memory=null}function bi(v,w,T,k){return U(v,8)!=47?0:(w[0]=U(v,14)+1,T[0]=U(v,14)+1,k[0]=U(v,1),U(v,3)!=0?0:!v.h)}function Ba(v,w){if(4>v)return v+1;var T=v-2>>1;return(2+(1&v)<<T)+U(w,T)+1}function de(v,w){return 120<w?w-120:1<=(T=((T=Ci[w-1])>>4)*v+(8-(15&T)))?T:1;var T}function ve(v,w,T){var k=Z(T),H=v[w+=255&k].g-8;return 0<H&&(z(T,T.u+8),k=Z(T),w+=v[w].value,w+=k&(1<<H)-1),z(T,T.u+v[w].g),v[w].value}function Ee(v,w,T){return T.g+=v.g,T.value+=v.value<<w>>>0,e(8>=T.g),v.g}function Be(v,w,T){var k=v.xc;return e((w=k==0?0:v.vc[v.md*(T>>k)+(w>>k)])<v.Wb),v.Ya[w]}function Je(v,w,T,k){var H=v.ab,W=v.c*w,J=v.C;w=J+w;var re=T,ae=k;for(k=v.Ta,T=v.Ua;0<H--;){var fe=v.gc[H],be=J,Le=w,ce=re,Se=ae,Ce=(ae=k,re=T,fe.Ea);switch(e(be<Le),e(Le<=fe.nc),fe.hc){case 2:Hl(ce,Se,(Le-be)*Ce,ae,re);break;case 0:var Fe=be,Te=Le,Ie=ae,ze=re,Ze=(mt=fe).Ea;Fe==0&&(Is(ce,Se,null,null,1,Ie,ze),pn(ce,Se+1,0,0,Ze-1,Ie,ze+1),Se+=Ze,ze+=Ze,++Fe);for(var Ye=1<<mt.b,bt=Ye-1,ft=Ve(Ze,mt.b),Zt=mt.K,mt=mt.w+(Fe>>mt.b)*ft;Fe<Te;){var xn=Zt,hr=mt,on=1;for(ho(ce,Se,Ie,ze-Ze,1,Ie,ze);on<Ze;){var ht=(on&~bt)+Ye;ht>Ze&&(ht=Ze),(0,qa[xn[hr++]>>8&15])(ce,Se+ +on,Ie,ze+on-Ze,ht-on,Ie,ze+on),on=ht}Se+=Ze,ze+=Ze,++Fe&bt||(mt+=ft)}Le!=fe.nc&&r(ae,re-Ce,ae,re+(Le-be-1)*Ce,Ce);break;case 1:for(Ce=ce,Te=Se,Ze=(ce=fe.Ea)-(ze=ce&~(Ie=(Se=1<<fe.b)-1)),Fe=Ve(ce,fe.b),Ye=fe.K,fe=fe.w+(be>>fe.b)*Fe;be<Le;){for(bt=Ye,ft=fe,Zt=new Ot,mt=Te+ze,xn=Te+ce;Te<mt;)lt(bt[ft++],Zt),po(Zt,Ce,Te,Se,ae,re),Te+=Se,re+=Se;Te<xn&&(lt(bt[ft++],Zt),po(Zt,Ce,Te,Ze,ae,re),Te+=Ze,re+=Ze),++be&Ie||(fe+=Fe)}break;case 3:if(ce==ae&&Se==re&&0<fe.b){for(Te=ae,ce=Ce=re+(Le-be)*Ce-(ze=(Le-be)*Ve(fe.Ea,fe.b)),Se=ae,Ie=re,Fe=[],ze=(Ze=ze)-1;0<=ze;--ze)Fe[ze]=Se[Ie+ze];for(ze=Ze-1;0<=ze;--ze)Te[ce+ze]=Fe[ze];rl(fe,be,Le,ae,Ce,ae,re)}else rl(fe,be,Le,ce,Se,ae,re)}re=k,ae=T}ae!=T&&r(k,T,re,ae,W)}function at(v,w){var T=v.V,k=v.Ba+v.c*v.C,H=w-v.C;if(e(w<=v.l.o),e(16>=H),0<H){var W=v.l,J=v.Ta,re=v.Ua,ae=W.width;if(Je(v,H,T,k),H=re=[re],e((T=v.C)<(k=w)),e(W.v<W.va),k>W.o&&(k=W.o),T<W.j){var fe=W.j-T;T=W.j,H[0]+=fe*ae}if(T>=k?T=0:(H[0]+=4*W.v,W.ka=T-W.j,W.U=W.va-W.v,W.T=k-T,T=1),T){if(re=re[0],11>(T=v.ca).S){var be=T.f.RGBA,Le=(k=T.S,H=W.U,W=W.T,fe=be.eb,be.A),ce=W;for(be=be.fb+v.Ma*be.A;0<ce--;){var Se=J,Ce=re,Fe=H,Te=fe,Ie=be;switch(k){case Lc:Vl(Se,Ce,Fe,Te,Ie);break;case Da:Gl(Se,Ce,Fe,Te,Ie);break;case Hu:Gl(Se,Ce,Fe,Te,Ie),ol(Te,Ie,0,Fe,1,0);break;case jc:il(Se,Ce,Fe,Te,Ie);break;case Ai:Lt(Se,Ce,Fe,Te,Ie,1);break;case Oc:Lt(Se,Ce,Fe,Te,Ie,1),ol(Te,Ie,0,Fe,1,0);break;case qu:Lt(Se,Ce,Fe,Te,Ie,0);break;case Kl:Lt(Se,Ce,Fe,Te,Ie,0),ol(Te,Ie,1,Fe,1,0);break;case Yl:al(Se,Ce,Fe,Te,Ie);break;case Rc:al(Se,Ce,Fe,Te,Ie),Ei(Te,Ie,Fe,1,0);break;case go:Fs(Se,Ce,Fe,Te,Ie);break;default:e(0)}re+=ae,be+=Le}v.Ma+=W}else alert("todo:EmitRescaledRowsYUVA");e(v.Ma<=T.height)}}v.C=w,e(v.C<=v.i)}function et(v){var w;if(0<v.ua)return 0;for(w=0;w<v.Wb;++w){var T=v.Ya[w].G,k=v.Ya[w].H;if(0<T[1][k[1]+0].g||0<T[2][k[2]+0].g||0<T[3][k[3]+0].g)return 0}return 1}function ct(v,w,T,k,H,W){if(v.Z!=0){var J=v.qd,re=v.rd;for(e(Bs[v.Z]!=null);w<T;++w)Bs[v.Z](J,re,k,H,k,H,W),J=k,re=H,H+=W;v.qd=J,v.rd=re}}function Qe(v,w){var T=v.l.ma,k=T.Z==0||T.Z==1?v.l.j:v.C;if(k=v.C<k?k:v.C,e(w<=v.l.o),w>k){var H=v.l.width,W=T.ca,J=T.tb+H*k,re=v.V,ae=v.Ba+v.c*k,fe=v.gc;e(v.ab==1),e(fe[0].hc==3),Zf(fe[0],k,w,re,ae,W,J),ct(T,k,w,W,J,H)}v.C=v.Ma=w}function st(v,w,T,k,H,W,J){var re=v.$/k,ae=v.$%k,fe=v.m,be=v.s,Le=T+v.$,ce=Le;H=T+k*H;var Se=T+k*W,Ce=280+be.ua,Fe=v.Pb?re:16777216,Te=0<be.ua?be.Wa:null,Ie=be.wc,ze=Le<Se?Be(be,ae,re):null;e(v.C<W),e(Se<=H);var Ze=!1;e:for(;;){for(;Ze||Le<Se;){var Ye=0;if(re>=Fe){var bt=Le-T;e((Fe=v).Pb),Fe.wd=Fe.m,Fe.xd=bt,0<Fe.s.ua&&We(Fe.s.Wa,Fe.s.vb),Fe=re+vo}if(ae&Ie||(ze=Be(be,ae,re)),e(ze!=null),ze.Qb&&(w[Le]=ze.qb,Ze=!0),!Ze)if(se(fe),ze.jc){Ye=fe,bt=w;var ft=Le,Zt=ze.pd[Z(Ye)&el-1];e(ze.jc),256>Zt.g?(z(Ye,Ye.u+Zt.g),bt[ft]=Zt.value,Ye=0):(z(Ye,Ye.u+Zt.g-256),e(256<=Zt.value),Ye=Zt.value),Ye==0&&(Ze=!0)}else Ye=ve(ze.G[0],ze.H[0],fe);if(fe.h)break;if(Ze||256>Ye){if(!Ze)if(ze.nd)w[Le]=(ze.qb|Ye<<8)>>>0;else{if(se(fe),Ze=ve(ze.G[1],ze.H[1],fe),se(fe),bt=ve(ze.G[2],ze.H[2],fe),ft=ve(ze.G[3],ze.H[3],fe),fe.h)break;w[Le]=(ft<<24|Ze<<16|Ye<<8|bt)>>>0}if(Ze=!1,++Le,++ae>=k&&(ae=0,++re,J!=null&&re<=W&&!(re%16)&&J(v,re),Te!=null))for(;ce<Le;)Ye=w[ce++],Te.X[(506832829*Ye&4294967295)>>>Te.Mb]=Ye}else if(280>Ye){if(Ye=Ba(Ye-256,fe),bt=ve(ze.G[4],ze.H[4],fe),se(fe),bt=de(k,bt=Ba(bt,fe)),fe.h)break;if(Le-T<bt||H-Le<Ye)break e;for(ft=0;ft<Ye;++ft)w[Le+ft]=w[Le+ft-bt];for(Le+=Ye,ae+=Ye;ae>=k;)ae-=k,++re,J!=null&&re<=W&&!(re%16)&&J(v,re);if(e(Le<=H),ae&Ie&&(ze=Be(be,ae,re)),Te!=null)for(;ce<Le;)Ye=w[ce++],Te.X[(506832829*Ye&4294967295)>>>Te.Mb]=Ye}else{if(!(Ye<Ce))break e;for(Ze=Ye-280,e(Te!=null);ce<Le;)Ye=w[ce++],Te.X[(506832829*Ye&4294967295)>>>Te.Mb]=Ye;Ye=Le,e(!(Ze>>>(bt=Te).Xa)),w[Ye]=bt.X[Ze],Ze=!0}Ze||e(fe.h==ie(fe))}if(v.Pb&&fe.h&&Le<H)e(v.m.h),v.a=5,v.m=v.wd,v.$=v.xd,0<v.s.ua&&We(v.s.vb,v.s.Wa);else{if(fe.h)break e;J!=null&&J(v,re>W?W:re),v.a=0,v.$=Le-T}return 1}return v.a=3,0}function St(v){e(v!=null),v.vc=null,v.yc=null,v.Ya=null;var w=v.Wa;w!=null&&(w.X=null),v.vb=null,e(v!=null)}function Ht(){var v=new pt;return v==null?null:(v.a=0,v.xb=nh,Hn("Predictor","VP8LPredictors"),Hn("Predictor","VP8LPredictors_C"),Hn("PredictorAdd","VP8LPredictorsAdd"),Hn("PredictorAdd","VP8LPredictorsAdd_C"),Hl=an,po=kt,Vl=gr,Gl=fn,al=Dt,Fs=Tt,il=mn,B.VP8LMapColor32b=Br,B.VP8LMapColor8b=Cr,v)}function dt(v,w,T,k,H){var W=1,J=[v],re=[w],ae=k.m,fe=k.s,be=null,Le=0;e:for(;;){if(T)for(;W&&U(ae,1);){var ce=J,Se=re,Ce=k,Fe=1,Te=Ce.m,Ie=Ce.gc[Ce.ab],ze=U(Te,2);if(Ce.Oc&1<<ze)W=0;else{switch(Ce.Oc|=1<<ze,Ie.hc=ze,Ie.Ea=ce[0],Ie.nc=Se[0],Ie.K=[null],++Ce.ab,e(4>=Ce.ab),ze){case 0:case 1:Ie.b=U(Te,3)+2,Fe=dt(Ve(Ie.Ea,Ie.b),Ve(Ie.nc,Ie.b),0,Ce,Ie.K),Ie.K=Ie.K[0];break;case 3:var Ze,Ye=U(Te,8)+1,bt=16<Ye?0:4<Ye?1:2<Ye?2:3;if(ce[0]=Ve(Ie.Ea,bt),Ie.b=bt,Ze=Fe=dt(Ye,1,0,Ce,Ie.K)){var ft,Zt=Ye,mt=Ie,xn=1<<(8>>mt.b),hr=s(xn);if(hr==null)Ze=0;else{var on=mt.K[0],ht=mt.w;for(hr[0]=mt.K[0][0],ft=1;ft<1*Zt;++ft)hr[ft]=gt(on[ht+ft],hr[ft-1]);for(;ft<4*xn;++ft)hr[ft]=0;mt.K[0]=null,mt.K[0]=hr,Ze=1}}Fe=Ze;break;case 2:break;default:e(0)}W=Fe}}if(J=J[0],re=re[0],W&&U(ae,1)&&!(W=1<=(Le=U(ae,4))&&11>=Le)){k.a=3;break e}var nt;if(nt=W)t:{var wr,$t,dn,Vn=k,Zr=J,_a=re,ar=Le,$r=T,Pa=Vn.m,zr=Vn.s,yn=[null],Dn=1,xr=0,Un=Ti[ar];n:for(;;){if($r&&U(Pa,1)){var Qr=U(Pa,3)+2,Sr=Ve(Zr,Qr),Pn=Ve(_a,Qr),Mr=Sr*Pn;if(!dt(Sr,Pn,0,Vn,yn))break n;for(yn=yn[0],zr.xc=Qr,wr=0;wr<Mr;++wr){var Gn=yn[wr]>>8&65535;yn[wr]=Gn,Gn>=Dn&&(Dn=Gn+1)}}if(Pa.h)break n;for($t=0;5>$t;++$t){var qr=ul[$t];!$t&&0<ar&&(qr+=1<<ar),xr<qr&&(xr=qr)}var Hr=l(Dn*Un,K),er=Dn,On=l(er,he);if(On==null)var Ma=null;else e(65536>=er),Ma=On;var jr=s(xr);if(Ma==null||jr==null||Hr==null){Vn.a=1;break n}var Rt=Hr;for(wr=dn=0;wr<Dn;++wr){var Pt=Ma[wr],Mn=Pt.G,ti=Pt.H,Ri=0,Va=1,Vr=0;for($t=0;5>$t;++$t){qr=ul[$t],Mn[$t]=Rt,ti[$t]=dn,!$t&&0<ar&&(qr+=1<<ar);a:{var _o,Eo=qr,Uc=Vn,ir=jr,ah=Rt,ih=dn,Bc=0,$s=Uc.m,Jg=U($s,1);if(a(ir,0,0,Eo),Jg){var sh=U($s,1)+1,oh=U($s,1),$c=U($s,oh==0?1:8);ir[$c]=1,sh==2&&(ir[$c=U($s,8)]=1);var ca=1}else{var Or=s(19),Yu=U($s,4)+4;if(19<Yu){Uc.a=3;var Ao=0;break a}for(_o=0;_o<Yu;++_o)Or[Vu[_o]]=U($s,3);var eu=void 0,hl=void 0,ms=Uc,zc=Or,tu=Eo,qc=ir,Hc=0,zs=ms.m,lh=8,uh=l(128,K);r:for(;$(uh,0,7,zc,19);){if(U(zs,1)){var Wd=2+2*U(zs,3);if((eu=2+U(zs,Wd))>tu)break r}else eu=tu;for(hl=0;hl<tu&&eu--;){se(zs);var ch=uh[0+(127&Z(zs))];z(zs,zs.u+ch.g);var No=ch.value;if(16>No)qc[hl++]=No,No!=0&&(lh=No);else{var Yd=No==16,Kd=No-16,Jd=Jl[Kd],fh=U(zs,Ni[Kd])+Jd;if(hl+fh>tu)break r;for(var Xd=Yd?lh:0;0<fh--;)qc[hl++]=Xd}}Hc=1;break r}Hc||(ms.a=3),ca=Hc}(ca=ca&&!$s.h)&&(Bc=$(ah,ih,8,ir,Eo)),ca&&Bc!=0?Ao=Bc:(Uc.a=3,Ao=0)}if(Ao==0)break n;if(Va&&kc[$t]==1&&(Va=Rt[dn].g==0),Ri+=Rt[dn].g,dn+=Ao,3>=$t){var dl,Vc=jr[0];for(dl=1;dl<qr;++dl)jr[dl]>Vc&&(Vc=jr[dl]);Vr+=Vc}}if(Pt.nd=Va,Pt.Qb=0,Va&&(Pt.qb=(Mn[3][ti[3]+0].value<<24|Mn[1][ti[1]+0].value<<16|Mn[2][ti[2]+0].value)>>>0,Ri==0&&256>Mn[0][ti[0]+0].value&&(Pt.Qb=1,Pt.qb+=Mn[0][ti[0]+0].value<<8)),Pt.jc=!Pt.Qb&&6>Vr,Pt.jc){var Ku,gs=Pt;for(Ku=0;Ku<el;++Ku){var qs=Ku,Hs=gs.pd[qs],Gc=gs.G[0][gs.H[0]+qs];256<=Gc.value?(Hs.g=Gc.g+256,Hs.value=Gc.value):(Hs.g=0,Hs.value=0,qs>>=Ee(Gc,8,Hs),qs>>=Ee(gs.G[1][gs.H[1]+qs],16,Hs),qs>>=Ee(gs.G[2][gs.H[2]+qs],0,Hs),Ee(gs.G[3][gs.H[3]+qs],24,Hs))}}}zr.vc=yn,zr.Wb=Dn,zr.Ya=Ma,zr.yc=Hr,nt=1;break t}nt=0}if(!(W=nt)){k.a=3;break e}if(0<Le){if(fe.ua=1<<Le,!ne(fe.Wa,Le)){k.a=1,W=0;break e}}else fe.ua=0;var Wc=k,pl=J,Zd=re,nu=Wc.s,ru=nu.xc;if(Wc.c=pl,Wc.i=Zd,nu.md=Ve(pl,ru),nu.wc=ru==0?-1:(1<<ru)-1,T){k.xb=yo;break e}if((be=s(J*re))==null){k.a=1,W=0;break e}W=(W=st(k,be,0,J,re,re,null))&&!ae.h;break e}return W?(H!=null?H[0]=be:(e(be==null),e(T)),k.$=0,T||St(fe)):St(fe),W}function Yt(v,w){var T=v.c*v.i,k=T+w+16*w;return e(v.c<=w),v.V=s(k),v.V==null?(v.Ta=null,v.Ua=0,v.a=1,0):(v.Ta=v.V,v.Ua=v.Ba+T+w,1)}function bn(v,w){var T=v.C,k=w-T,H=v.V,W=v.Ba+v.c*T;for(e(w<=v.l.o);0<k;){var J=16<k?16:k,re=v.l.ma,ae=v.l.width,fe=ae*J,be=re.ca,Le=re.tb+ae*T,ce=v.Ta,Se=v.Ua;Je(v,J,H,W),pi(ce,Se,be,Le,fe),ct(re,T,T+J,be,Le,ae),k-=J,H+=J*v.c,T+=J}e(T==w),v.C=v.Ma=w}function Bn(){this.ub=this.yd=this.td=this.Rb=0}function _n(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function En(){this.Fb=this.Bb=this.Cb=0,this.Zb=s(4),this.Lb=s(4)}function lr(){this.Yb=(function(){var v=[];return(function w(T,k,H){for(var W=H[k],J=0;J<W&&(T.push(H.length>k+1?[]:0),!(H.length<k+1));J++)w(T[J],k+1,H)})(v,0,[3,11]),v})()}function wn(){this.jb=s(3),this.Wc=u([4,8],lr),this.Xc=u([4,17],lr)}function zi(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new s(4),this.od=new s(4)}function Nr(){this.ld=this.La=this.dd=this.tc=0}function oa(){this.Na=this.la=0}function la(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function Ca(){this.ad=s(384),this.Za=0,this.Ob=s(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function Ns(){this.uc=this.M=this.Nb=0,this.wa=Array(new Nr),this.Y=0,this.ya=Array(new Ca),this.aa=0,this.l=new Qa}function Za(){this.y=s(16),this.f=s(8),this.ea=s(8)}function Cs(){this.cb=this.a=0,this.sc="",this.m=new O,this.Od=new Bn,this.Kc=new _n,this.ed=new zi,this.Qa=new En,this.Ic=this.$c=this.Aa=0,this.D=new Ns,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=l(8,O),this.ia=0,this.pb=l(4,la),this.Pa=new wn,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new Za),this.Hd=0,this.rb=Array(new oa),this.sb=0,this.wa=Array(new Nr),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new Ca),this.L=this.aa=0,this.gd=u([4,2],Nr),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function ua(v,w){return 0>v?0:v>w?w:v}function Qa(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Kt(){var v=new Cs;return v!=null&&(v.a=0,v.sc="OK",v.cb=0,v.Xb=0,mi||(mi=qi)),v}function Jt(v,w,T){return v.a==0&&(v.a=w,v.sc=T,v.cb=0),0}function Ta(v,w,T){return 3<=T&&v[w+0]==157&&v[w+1]==1&&v[w+2]==42}function Fr(v,w){if(v==null)return 0;if(v.a=0,v.sc="OK",w==null)return Jt(v,2,"null VP8Io passed to VP8GetHeaders()");var T=w.data,k=w.w,H=w.ha;if(4>H)return Jt(v,7,"Truncated header.");var W=T[k+0]|T[k+1]<<8|T[k+2]<<16,J=v.Od;if(J.Rb=!(1&W),J.td=W>>1&7,J.yd=W>>4&1,J.ub=W>>5,3<J.td)return Jt(v,3,"Incorrect keyframe parameters.");if(!J.yd)return Jt(v,4,"Frame not displayable.");k+=3,H-=3;var re=v.Kc;if(J.Rb){if(7>H)return Jt(v,7,"cannot parse picture header");if(!Ta(T,k,H))return Jt(v,3,"Bad code word");re.c=16383&(T[k+4]<<8|T[k+3]),re.Td=T[k+4]>>6,re.i=16383&(T[k+6]<<8|T[k+5]),re.Ud=T[k+6]>>6,k+=7,H-=7,v.za=re.c+15>>4,v.Ub=re.i+15>>4,w.width=re.c,w.height=re.i,w.Da=0,w.j=0,w.v=0,w.va=w.width,w.o=w.height,w.da=0,w.ib=w.width,w.hb=w.height,w.U=w.width,w.T=w.height,a((W=v.Pa).jb,0,255,W.jb.length),e((W=v.Qa)!=null),W.Cb=0,W.Bb=0,W.Fb=1,a(W.Zb,0,0,W.Zb.length),a(W.Lb,0,0,W.Lb)}if(J.ub>H)return Jt(v,7,"bad partition length");te(W=v.m,T,k,J.ub),k+=J.ub,H-=J.ub,J.Rb&&(re.Ld=xe(W),re.Kd=xe(W)),re=v.Qa;var ae,fe=v.Pa;if(e(W!=null),e(re!=null),re.Cb=xe(W),re.Cb){if(re.Bb=xe(W),xe(W)){for(re.Fb=xe(W),ae=0;4>ae;++ae)re.Zb[ae]=xe(W)?le(W,7):0;for(ae=0;4>ae;++ae)re.Lb[ae]=xe(W)?le(W,6):0}if(re.Bb)for(ae=0;3>ae;++ae)fe.jb[ae]=xe(W)?oe(W,8):255}else re.Bb=0;if(W.Ka)return Jt(v,3,"cannot parse segment header");if((re=v.ed).zd=xe(W),re.Tb=oe(W,6),re.wb=oe(W,3),re.Pc=xe(W),re.Pc&&xe(W)){for(fe=0;4>fe;++fe)xe(W)&&(re.vd[fe]=le(W,6));for(fe=0;4>fe;++fe)xe(W)&&(re.od[fe]=le(W,6))}if(v.L=re.Tb==0?0:re.zd?1:2,W.Ka)return Jt(v,3,"cannot parse filter header");var be=H;if(H=ae=k,k=ae+be,re=be,v.Xb=(1<<oe(v.m,2))-1,be<3*(fe=v.Xb))T=7;else{for(ae+=3*fe,re-=3*fe,be=0;be<fe;++be){var Le=T[H+0]|T[H+1]<<8|T[H+2]<<16;Le>re&&(Le=re),te(v.Jc[+be],T,ae,Le),ae+=Le,re-=Le,H+=3}te(v.Jc[+fe],T,ae,re),T=ae<k?0:5}if(T!=0)return Jt(v,T,"cannot parse partitions");for(T=oe(ae=v.m,7),H=xe(ae)?le(ae,4):0,k=xe(ae)?le(ae,4):0,re=xe(ae)?le(ae,4):0,fe=xe(ae)?le(ae,4):0,ae=xe(ae)?le(ae,4):0,be=v.Qa,Le=0;4>Le;++Le){if(be.Cb){var ce=be.Zb[Le];be.Fb||(ce+=T)}else{if(0<Le){v.pb[Le]=v.pb[0];continue}ce=T}var Se=v.pb[Le];Se.Sc[0]=Li[ua(ce+H,127)],Se.Sc[1]=ji[ua(ce+0,127)],Se.Eb[0]=2*Li[ua(ce+k,127)],Se.Eb[1]=101581*ji[ua(ce+re,127)]>>16,8>Se.Eb[1]&&(Se.Eb[1]=8),Se.Qc[0]=Li[ua(ce+fe,117)],Se.Qc[1]=ji[ua(ce+ae,127)],Se.lc=ce+ae}if(!J.Rb)return Jt(v,4,"Not a key frame.");for(xe(W),J=v.Pa,T=0;4>T;++T){for(H=0;8>H;++H)for(k=0;3>k;++k)for(re=0;11>re;++re)fe=Re(W,fr[T][H][k][re])?oe(W,8):Vd[T][H][k][re],J.Wc[T][H].Yb[k][re]=fe;for(H=0;17>H;++H)J.Xc[T][H]=J.Wc[T][Nn[H]]}return v.kc=xe(W),v.kc&&(v.Bd=oe(W,8)),v.cb=1}function qi(v,w,T,k,H,W,J){var re=w[H].Yb[T];for(T=0;16>H;++H){if(!Re(v,re[T+0]))return H;for(;!Re(v,re[T+1]);)if(re=w[++H].Yb[0],T=0,H==16)return 16;var ae=w[H+1].Yb;if(Re(v,re[T+2])){var fe=v,be=0;if(Re(fe,(ce=re)[(Le=T)+3]))if(Re(fe,ce[Le+6])){for(re=0,Le=2*(be=Re(fe,ce[Le+8]))+(ce=Re(fe,ce[Le+9+be])),be=0,ce=Hd[Le];ce[re];++re)be+=be+Re(fe,ce[re]);be+=3+(8<<Le)}else Re(fe,ce[Le+7])?(be=7+2*Re(fe,165),be+=Re(fe,145)):be=5+Re(fe,159);else be=Re(fe,ce[Le+4])?3+Re(fe,ce[Le+5]):2;re=ae[2]}else be=1,re=ae[1];ae=J+th[H],0>(fe=v).b&&ge(fe);var Le,ce=fe.b,Se=(Le=fe.Ca>>1)-(fe.I>>ce)>>31;--fe.b,fe.Ca+=Se,fe.Ca|=1,fe.I-=(Le+1&Se)<<ce,W[ae]=((be^Se)-Se)*k[(0<H)+0]}return 16}function us(v){var w=v.rb[v.sb-1];w.la=0,w.Na=0,a(v.zc,0,0,v.zc.length),v.ja=0}function hn(v,w,T,k,H){H=v[w+T+32*k]+(H>>3),v[w+T+32*k]=-256&H?0>H?0:255:H}function ei(v,w,T,k,H,W){hn(v,w,0,T,k+H),hn(v,w,1,T,k+W),hn(v,w,2,T,k-W),hn(v,w,3,T,k-H)}function vr(v){return(20091*v>>16)+v}function Dr(v,w,T,k){var H,W=0,J=s(16);for(H=0;4>H;++H){var re=v[w+0]+v[w+8],ae=v[w+0]-v[w+8],fe=(35468*v[w+4]>>16)-vr(v[w+12]),be=vr(v[w+4])+(35468*v[w+12]>>16);J[W+0]=re+be,J[W+1]=ae+fe,J[W+2]=ae-fe,J[W+3]=re-be,W+=4,w++}for(H=W=0;4>H;++H)re=(v=J[W+0]+4)+J[W+8],ae=v-J[W+8],fe=(35468*J[W+4]>>16)-vr(J[W+12]),hn(T,k,0,0,re+(be=vr(J[W+4])+(35468*J[W+12]>>16))),hn(T,k,1,0,ae+fe),hn(T,k,2,0,ae-fe),hn(T,k,3,0,re-be),W++,k+=32}function Lu(v,w,T,k){var H=v[w+0]+4,W=35468*v[w+4]>>16,J=vr(v[w+4]),re=35468*v[w+1]>>16;ei(T,k,0,H+J,v=vr(v[w+1]),re),ei(T,k,1,H+W,v,re),ei(T,k,2,H-W,v,re),ei(T,k,3,H-J,v,re)}function ju(v,w,T,k,H){Dr(v,w,T,k),H&&Dr(v,w+16,T,k+4)}function ao(v,w,T,k){Xi(v,w+0,T,k,1),Xi(v,w+32,T,k+128,1)}function wc(v,w,T,k){var H;for(v=v[w+0]+4,H=0;4>H;++H)for(w=0;4>w;++w)hn(T,k,w,H,v)}function Hi(v,w,T,k){v[w+0]&&ya(v,w+0,T,k),v[w+16]&&ya(v,w+16,T,k+4),v[w+32]&&ya(v,w+32,T,k+128),v[w+48]&&ya(v,w+48,T,k+128+4)}function Ts(v,w,T,k){var H,W=s(16);for(H=0;4>H;++H){var J=v[w+0+H]+v[w+12+H],re=v[w+4+H]+v[w+8+H],ae=v[w+4+H]-v[w+8+H],fe=v[w+0+H]-v[w+12+H];W[0+H]=J+re,W[8+H]=J-re,W[4+H]=fe+ae,W[12+H]=fe-ae}for(H=0;4>H;++H)J=(v=W[0+4*H]+3)+W[3+4*H],re=W[1+4*H]+W[2+4*H],ae=W[1+4*H]-W[2+4*H],fe=v-W[3+4*H],T[k+0]=J+re>>3,T[k+16]=fe+ae>>3,T[k+32]=J-re>>3,T[k+48]=fe-ae>>3,k+=64}function Ul(v,w,T){var k,H=w-32,W=ka,J=255-v[H-1];for(k=0;k<T;++k){var re,ae=W,fe=J+v[w-1];for(re=0;re<T;++re)v[w+re]=ae[fe+v[H+re]];w+=32}}function Ho(v,w){Ul(v,w,4)}function Bl(v,w){Ul(v,w,8)}function Ou(v,w){Ul(v,w,16)}function Jf(v,w){var T;for(T=0;16>T;++T)r(v,w+32*T,v,w-32,16)}function Xf(v,w){var T;for(T=16;0<T;--T)a(v,w,v[w-1],16),w+=32}function Vi(v,w,T){var k;for(k=0;16>k;++k)a(w,T+32*k,v,16)}function wi(v,w){var T,k=16;for(T=0;16>T;++T)k+=v[w-1+32*T]+v[w+T-32];Vi(k>>5,v,w)}function cs(v,w){var T,k=8;for(T=0;16>T;++T)k+=v[w-1+32*T];Vi(k>>4,v,w)}function Ru(v,w){var T,k=8;for(T=0;16>T;++T)k+=v[w+T-32];Vi(k>>4,v,w)}function xi(v,w){Vi(128,v,w)}function Ft(v,w,T){return v+2*w+T+2>>2}function xc(v,w){var T,k=w-32;for(k=new Uint8Array([Ft(v[k-1],v[k+0],v[k+1]),Ft(v[k+0],v[k+1],v[k+2]),Ft(v[k+1],v[k+2],v[k+3]),Ft(v[k+2],v[k+3],v[k+4])]),T=0;4>T;++T)r(v,w+32*T,k,0,k.length)}function ku(v,w){var T=v[w-1],k=v[w-1+32],H=v[w-1+64],W=v[w-1+96];De(v,w+0,16843009*Ft(v[w-1-32],T,k)),De(v,w+32,16843009*Ft(T,k,H)),De(v,w+64,16843009*Ft(k,H,W)),De(v,w+96,16843009*Ft(H,W,W))}function Sc(v,w){var T,k=4;for(T=0;4>T;++T)k+=v[w+T-32]+v[w-1+32*T];for(k>>=3,T=0;4>T;++T)a(v,w+32*T,k,4)}function Vo(v,w){var T=v[w-1+0],k=v[w-1+32],H=v[w-1+64],W=v[w-1-32],J=v[w+0-32],re=v[w+1-32],ae=v[w+2-32],fe=v[w+3-32];v[w+0+96]=Ft(k,H,v[w-1+96]),v[w+1+96]=v[w+0+64]=Ft(T,k,H),v[w+2+96]=v[w+1+64]=v[w+0+32]=Ft(W,T,k),v[w+3+96]=v[w+2+64]=v[w+1+32]=v[w+0+0]=Ft(J,W,T),v[w+3+64]=v[w+2+32]=v[w+1+0]=Ft(re,J,W),v[w+3+32]=v[w+2+0]=Ft(ae,re,J),v[w+3+0]=Ft(fe,ae,re)}function Gi(v,w){var T=v[w+1-32],k=v[w+2-32],H=v[w+3-32],W=v[w+4-32],J=v[w+5-32],re=v[w+6-32],ae=v[w+7-32];v[w+0+0]=Ft(v[w+0-32],T,k),v[w+1+0]=v[w+0+32]=Ft(T,k,H),v[w+2+0]=v[w+1+32]=v[w+0+64]=Ft(k,H,W),v[w+3+0]=v[w+2+32]=v[w+1+64]=v[w+0+96]=Ft(H,W,J),v[w+3+32]=v[w+2+64]=v[w+1+96]=Ft(W,J,re),v[w+3+64]=v[w+2+96]=Ft(J,re,ae),v[w+3+96]=Ft(re,ae,ae)}function Wi(v,w){var T=v[w-1+0],k=v[w-1+32],H=v[w-1+64],W=v[w-1-32],J=v[w+0-32],re=v[w+1-32],ae=v[w+2-32],fe=v[w+3-32];v[w+0+0]=v[w+1+64]=W+J+1>>1,v[w+1+0]=v[w+2+64]=J+re+1>>1,v[w+2+0]=v[w+3+64]=re+ae+1>>1,v[w+3+0]=ae+fe+1>>1,v[w+0+96]=Ft(H,k,T),v[w+0+64]=Ft(k,T,W),v[w+0+32]=v[w+1+96]=Ft(T,W,J),v[w+1+32]=v[w+2+96]=Ft(W,J,re),v[w+2+32]=v[w+3+96]=Ft(J,re,ae),v[w+3+32]=Ft(re,ae,fe)}function fi(v,w){var T=v[w+0-32],k=v[w+1-32],H=v[w+2-32],W=v[w+3-32],J=v[w+4-32],re=v[w+5-32],ae=v[w+6-32],fe=v[w+7-32];v[w+0+0]=T+k+1>>1,v[w+1+0]=v[w+0+64]=k+H+1>>1,v[w+2+0]=v[w+1+64]=H+W+1>>1,v[w+3+0]=v[w+2+64]=W+J+1>>1,v[w+0+32]=Ft(T,k,H),v[w+1+32]=v[w+0+96]=Ft(k,H,W),v[w+2+32]=v[w+1+96]=Ft(H,W,J),v[w+3+32]=v[w+2+96]=Ft(W,J,re),v[w+3+64]=Ft(J,re,ae),v[w+3+96]=Ft(re,ae,fe)}function fs(v,w){var T=v[w-1+0],k=v[w-1+32],H=v[w-1+64],W=v[w-1+96];v[w+0+0]=T+k+1>>1,v[w+2+0]=v[w+0+32]=k+H+1>>1,v[w+2+32]=v[w+0+64]=H+W+1>>1,v[w+1+0]=Ft(T,k,H),v[w+3+0]=v[w+1+32]=Ft(k,H,W),v[w+3+32]=v[w+1+64]=Ft(H,W,W),v[w+3+64]=v[w+2+64]=v[w+0+96]=v[w+1+96]=v[w+2+96]=v[w+3+96]=W}function Du(v,w){var T=v[w-1+0],k=v[w-1+32],H=v[w-1+64],W=v[w-1+96],J=v[w-1-32],re=v[w+0-32],ae=v[w+1-32],fe=v[w+2-32];v[w+0+0]=v[w+2+32]=T+J+1>>1,v[w+0+32]=v[w+2+64]=k+T+1>>1,v[w+0+64]=v[w+2+96]=H+k+1>>1,v[w+0+96]=W+H+1>>1,v[w+3+0]=Ft(re,ae,fe),v[w+2+0]=Ft(J,re,ae),v[w+1+0]=v[w+3+32]=Ft(T,J,re),v[w+1+32]=v[w+3+64]=Ft(k,T,J),v[w+1+64]=v[w+3+96]=Ft(H,k,T),v[w+1+96]=Ft(W,H,k)}function Ls(v,w){var T;for(T=0;8>T;++T)r(v,w+32*T,v,w-32,8)}function $l(v,w){var T;for(T=0;8>T;++T)a(v,w,v[w-1],8),w+=32}function hi(v,w,T){var k;for(k=0;8>k;++k)a(w,T+32*k,v,8)}function zl(v,w){var T,k=8;for(T=0;8>T;++T)k+=v[w+T-32]+v[w-1+32*T];hi(k>>4,v,w)}function Go(v,w){var T,k=4;for(T=0;8>T;++T)k+=v[w+T-32];hi(k>>3,v,w)}function La(v,w){var T,k=4;for(T=0;8>T;++T)k+=v[w-1+32*T];hi(k>>3,v,w)}function Yi(v,w){hi(128,v,w)}function Ki(v,w,T){var k=v[w-T],H=v[w+0],W=3*(H-k)+Us[1020+v[w-2*T]-v[w+T]],J=zu[112+(W+4>>3)];v[w-T]=ka[255+k+zu[112+(W+3>>3)]],v[w+0]=ka[255+H-J]}function js(v,w,T,k){var H=v[w+0],W=v[w+T];return ba[255+v[w-2*T]-v[w-T]]>k||ba[255+W-H]>k}function Wo(v,w,T,k){return 4*ba[255+v[w-T]-v[w+0]]+ba[255+v[w-2*T]-v[w+T]]<=k}function Yo(v,w,T,k,H){var W=v[w-3*T],J=v[w-2*T],re=v[w-T],ae=v[w+0],fe=v[w+T],be=v[w+2*T],Le=v[w+3*T];return 4*ba[255+re-ae]+ba[255+J-fe]>k?0:ba[255+v[w-4*T]-W]<=H&&ba[255+W-J]<=H&&ba[255+J-re]<=H&&ba[255+Le-be]<=H&&ba[255+be-fe]<=H&&ba[255+fe-ae]<=H}function io(v,w,T,k){var H=2*k+1;for(k=0;16>k;++k)Wo(v,w+k,T,H)&&Ki(v,w+k,T)}function Os(v,w,T,k){var H=2*k+1;for(k=0;16>k;++k)Wo(v,w+k*T,1,H)&&Ki(v,w+k*T,1)}function Rs(v,w,T,k){var H;for(H=3;0<H;--H)io(v,w+=4*T,T,k)}function Pu(v,w,T,k){var H;for(H=3;0<H;--H)Os(v,w+=4,T,k)}function ks(v,w,T,k,H,W,J,re){for(W=2*W+1;0<H--;){if(Yo(v,w,T,W,J))if(js(v,w,T,re))Ki(v,w,T);else{var ae=v,fe=w,be=T,Le=ae[fe-2*be],ce=ae[fe-be],Se=ae[fe+0],Ce=ae[fe+be],Fe=ae[fe+2*be],Te=27*(ze=Us[1020+3*(Se-ce)+Us[1020+Le-Ce]])+63>>7,Ie=18*ze+63>>7,ze=9*ze+63>>7;ae[fe-3*be]=ka[255+ae[fe-3*be]+ze],ae[fe-2*be]=ka[255+Le+Ie],ae[fe-be]=ka[255+ce+Te],ae[fe+0]=ka[255+Se-Te],ae[fe+be]=ka[255+Ce-Ie],ae[fe+2*be]=ka[255+Fe-ze]}w+=k}}function Ds(v,w,T,k,H,W,J,re){for(W=2*W+1;0<H--;){if(Yo(v,w,T,W,J))if(js(v,w,T,re))Ki(v,w,T);else{var ae=v,fe=w,be=T,Le=ae[fe-be],ce=ae[fe+0],Se=ae[fe+be],Ce=zu[112+(4+(Fe=3*(ce-Le))>>3)],Fe=zu[112+(Fe+3>>3)],Te=Ce+1>>1;ae[fe-2*be]=ka[255+ae[fe-2*be]+Te],ae[fe-be]=ka[255+Le+Fe],ae[fe+0]=ka[255+ce-Ce],ae[fe+be]=ka[255+Se-Te]}w+=k}}function _c(v,w,T,k,H,W){ks(v,w,T,1,16,k,H,W)}function ql(v,w,T,k,H,W){ks(v,w,1,T,16,k,H,W)}function Ec(v,w,T,k,H,W){var J;for(J=3;0<J;--J)Ds(v,w+=4*T,T,1,16,k,H,W)}function Ko(v,w,T,k,H,W){var J;for(J=3;0<J;--J)Ds(v,w+=4,1,T,16,k,H,W)}function Ac(v,w,T,k,H,W,J,re){ks(v,w,H,1,8,W,J,re),ks(T,k,H,1,8,W,J,re)}function C(v,w,T,k,H,W,J,re){ks(v,w,1,H,8,W,J,re),ks(T,k,1,H,8,W,J,re)}function q(v,w,T,k,H,W,J,re){Ds(v,w+4*H,H,1,8,W,J,re),Ds(T,k+4*H,H,1,8,W,J,re)}function ue(v,w,T,k,H,W,J,re){Ds(v,w+4,1,H,8,W,J,re),Ds(T,k+4,1,H,8,W,J,re)}function ye(){this.ba=new nn,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new Sn,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function _e(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function Ue(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function Xe(){this.ua=0,this.Wa=new it,this.vb=new it,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new he,this.yc=new K}function pt(){this.xb=this.a=0,this.l=new Qa,this.ca=new nn,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new V,this.Pb=0,this.wd=new V,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new Xe,this.ab=0,this.gc=l(4,Ue),this.Oc=0}function vt(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Qa,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function Xt(v,w,T,k,H,W,J){for(v=v==null?0:v[w+0],w=0;w<J;++w)H[W+w]=v+T[k+w]&255,v=H[W+w]}function sn(v,w,T,k,H,W,J){var re;if(v==null)Xt(null,null,T,k,H,W,J);else for(re=0;re<J;++re)H[W+re]=v[w+re]+T[k+re]&255}function An(v,w,T,k,H,W,J){if(v==null)Xt(null,null,T,k,H,W,J);else{var re,ae=v[w+0],fe=ae,be=ae;for(re=0;re<J;++re)fe=be+(ae=v[w+re])-fe,be=T[k+re]+(-256&fe?0>fe?0:255:fe)&255,fe=ae,H[W+re]=be}}function Ur(v,w,T,k){var H=w.width,W=w.o;if(e(v!=null&&w!=null),0>T||0>=k||T+k>W)return null;if(!v.Cc){if(v.ga==null){var J;if(v.ga=new vt,(J=v.ga==null)||(J=w.width*w.o,e(v.Gb.length==0),v.Gb=s(J),v.Uc=0,v.Gb==null?J=0:(v.mb=v.Gb,v.nb=v.Uc,v.rc=null,J=1),J=!J),!J){J=v.ga;var re=v.Fa,ae=v.P,fe=v.qc,be=v.mb,Le=v.nb,ce=ae+1,Se=fe-1,Ce=J.l;if(e(re!=null&&be!=null&&w!=null),Bs[0]=null,Bs[1]=Xt,Bs[2]=sn,Bs[3]=An,J.ca=be,J.tb=Le,J.c=w.width,J.i=w.height,e(0<J.c&&0<J.i),1>=fe)w=0;else if(J.$a=3&re[ae+0],J.Z=re[ae+0]>>2&3,J.Lc=re[ae+0]>>4&3,ae=re[ae+0]>>6&3,0>J.$a||1<J.$a||4<=J.Z||1<J.Lc||ae)w=0;else if(Ce.put=At,Ce.ac=ma,Ce.bc=yi,Ce.ma=J,Ce.width=w.width,Ce.height=w.height,Ce.Da=w.Da,Ce.v=w.v,Ce.va=w.va,Ce.j=w.j,Ce.o=w.o,J.$a)e:{e(J.$a==1),w=Ht();t:for(;;){if(w==null){w=0;break e}if(e(J!=null),J.mc=w,w.c=J.c,w.i=J.i,w.l=J.l,w.l.ma=J,w.l.width=J.c,w.l.height=J.i,w.a=0,pe(w.m,re,ce,Se),!dt(J.c,J.i,1,w,null)||(w.ab==1&&w.gc[0].hc==3&&et(w.s)?(J.ic=1,re=w.c*w.i,w.Ta=null,w.Ua=0,w.V=s(re),w.Ba=0,w.V==null?(w.a=1,w=0):w=1):(J.ic=0,w=Yt(w,J.c)),!w))break t;w=1;break e}J.mc=null,w=0}else w=Se>=J.c*J.i;J=!w}if(J)return null;v.ga.Lc!=1?v.Ga=0:k=W-T}e(v.ga!=null),e(T+k<=W);e:{if(w=(re=v.ga).c,W=re.l.o,re.$a==0){if(ce=v.rc,Se=v.Vc,Ce=v.Fa,ae=v.P+1+T*w,fe=v.mb,be=v.nb+T*w,e(ae<=v.P+v.qc),re.Z!=0)for(e(Bs[re.Z]!=null),J=0;J<k;++J)Bs[re.Z](ce,Se,Ce,ae,fe,be,w),ce=fe,Se=be,be+=w,ae+=w;else for(J=0;J<k;++J)r(fe,be,Ce,ae,w),ce=fe,Se=be,be+=w,ae+=w;v.rc=ce,v.Vc=Se}else{if(e(re.mc!=null),w=T+k,e((J=re.mc)!=null),e(w<=J.i),J.C>=w)w=1;else if(re.ic||br(),re.ic){re=J.V,ce=J.Ba,Se=J.c;var Fe=J.i,Te=(Ce=1,ae=J.$/Se,fe=J.$%Se,be=J.m,Le=J.s,J.$),Ie=Se*Fe,ze=Se*w,Ze=Le.wc,Ye=Te<ze?Be(Le,fe,ae):null;e(Te<=Ie),e(w<=Fe),e(et(Le));t:for(;;){for(;!be.h&&Te<ze;){if(fe&Ze||(Ye=Be(Le,fe,ae)),e(Ye!=null),se(be),256>(Fe=ve(Ye.G[0],Ye.H[0],be)))re[ce+Te]=Fe,++Te,++fe>=Se&&(fe=0,++ae<=w&&!(ae%16)&&Qe(J,ae));else{if(!(280>Fe)){Ce=0;break t}Fe=Ba(Fe-256,be);var bt,ft=ve(Ye.G[4],Ye.H[4],be);if(se(be),!(Te>=(ft=de(Se,ft=Ba(ft,be)))&&Ie-Te>=Fe)){Ce=0;break t}for(bt=0;bt<Fe;++bt)re[ce+Te+bt]=re[ce+Te+bt-ft];for(Te+=Fe,fe+=Fe;fe>=Se;)fe-=Se,++ae<=w&&!(ae%16)&&Qe(J,ae);Te<ze&&fe&Ze&&(Ye=Be(Le,fe,ae))}e(be.h==ie(be))}Qe(J,ae>w?w:ae);break t}!Ce||be.h&&Te<Ie?(Ce=0,J.a=be.h?5:3):J.$=Te,w=Ce}else w=st(J,J.V,J.Ba,J.c,J.i,w,bn);if(!w){k=0;break e}}T+k>=W&&(v.Cc=1),k=1}if(!k)return null;if(v.Cc&&((k=v.ga)!=null&&(k.mc=null),v.ga=null,0<v.Ga))return alert("todo:WebPDequantizeLevels"),null}return v.nb+T*H}function Qn(v,w,T,k,H,W){for(;0<H--;){var J,re=v,ae=w+(T?1:0),fe=v,be=w+(T?0:3);for(J=0;J<k;++J){var Le=fe[be+4*J];Le!=255&&(Le*=32897,re[ae+4*J+0]=re[ae+4*J+0]*Le>>23,re[ae+4*J+1]=re[ae+4*J+1]*Le>>23,re[ae+4*J+2]=re[ae+4*J+2]*Le>>23)}w+=W}}function Jn(v,w,T,k,H){for(;0<k--;){var W;for(W=0;W<T;++W){var J=v[w+2*W+0],re=15&(fe=v[w+2*W+1]),ae=4369*re,fe=(240&fe|fe>>4)*ae>>16;v[w+2*W+0]=(240&J|J>>4)*ae>>16&240|(15&J|J<<4)*ae>>16>>4&15,v[w+2*W+1]=240&fe|re}w+=H}}function ur(v,w,T,k,H,W,J,re){var ae,fe,be=255;for(fe=0;fe<H;++fe){for(ae=0;ae<k;++ae){var Le=v[w+ae];W[J+4*ae]=Le,be&=Le}w+=T,J+=re}return be!=255}function yr(v,w,T,k,H){var W;for(W=0;W<H;++W)T[k+W]=v[w+W]>>8}function br(){ol=Qn,Ei=Jn,Uu=ur,pi=yr}function ja(v,w,T){B[v]=function(k,H,W,J,re,ae,fe,be,Le,ce,Se,Ce,Fe,Te,Ie,ze,Ze){var Ye,bt=Ze-1>>1,ft=re[ae+0]|fe[be+0]<<16,Zt=Le[ce+0]|Se[Ce+0]<<16;e(k!=null);var mt=3*ft+Zt+131074>>2;for(w(k[H+0],255&mt,mt>>16,Fe,Te),W!=null&&(mt=3*Zt+ft+131074>>2,w(W[J+0],255&mt,mt>>16,Ie,ze)),Ye=1;Ye<=bt;++Ye){var xn=re[ae+Ye]|fe[be+Ye]<<16,hr=Le[ce+Ye]|Se[Ce+Ye]<<16,on=ft+xn+Zt+hr+524296,ht=on+2*(xn+Zt)>>3;mt=ht+ft>>1,ft=(on=on+2*(ft+hr)>>3)+xn>>1,w(k[H+2*Ye-1],255&mt,mt>>16,Fe,Te+(2*Ye-1)*T),w(k[H+2*Ye-0],255&ft,ft>>16,Fe,Te+(2*Ye-0)*T),W!=null&&(mt=on+Zt>>1,ft=ht+hr>>1,w(W[J+2*Ye-1],255&mt,mt>>16,Ie,ze+(2*Ye-1)*T),w(W[J+2*Ye+0],255&ft,ft>>16,Ie,ze+(2*Ye+0)*T)),ft=xn,Zt=hr}1&Ze||(mt=3*ft+Zt+131074>>2,w(k[H+Ze-1],255&mt,mt>>16,Fe,Te+(Ze-1)*T),W!=null&&(mt=3*Zt+ft+131074>>2,w(W[J+Ze-1],255&mt,mt>>16,Ie,ze+(Ze-1)*T)))}}function Ps(){xa[Lc]=cl,xa[Da]=Xl,xa[jc]=rh,xa[Ai]=Pc,xa[qu]=bo,xa[Yl]=ps,xa[go]=wo,xa[Hu]=Xl,xa[Oc]=Pc,xa[Kl]=bo,xa[Rc]=ps}function Mu(v){return v&-16384?0>v?0:255:v>>Mc}function Ms(v,w){return Mu((19077*v>>8)+(26149*w>>8)-14234)}function Ji(v,w,T){return Mu((19077*v>>8)-(6419*w>>8)-(13320*T>>8)+8708)}function so(v,w){return Mu((19077*v>>8)+(33050*w>>8)-17685)}function oo(v,w,T,k,H){k[H+0]=Ms(v,T),k[H+1]=Ji(v,w,T),k[H+2]=so(v,w)}function Jo(v,w,T,k,H){k[H+0]=so(v,w),k[H+1]=Ji(v,w,T),k[H+2]=Ms(v,T)}function Xo(v,w,T,k,H){var W=Ji(v,w,T);w=W<<3&224|so(v,w)>>3,k[H+0]=248&Ms(v,T)|W>>5,k[H+1]=w}function ga(v,w,T,k,H){var W=240&so(v,w)|15;k[H+0]=240&Ms(v,T)|Ji(v,w,T)>>4,k[H+1]=W}function lo(v,w,T,k,H){k[H+0]=255,oo(v,w,T,k,H+1)}function Si(v,w,T,k,H){Jo(v,w,T,k,H),k[H+3]=255}function Iu(v,w,T,k,H){oo(v,w,T,k,H),k[H+3]=255}function hs(v,w,T){B[v]=function(k,H,W,J,re,ae,fe,be,Le){for(var ce=be+(-2&Le)*T;be!=ce;)w(k[H+0],W[J+0],re[ae+0],fe,be),w(k[H+1],W[J+0],re[ae+0],fe,be+T),H+=2,++J,++ae,be+=2*T;1&Le&&w(k[H+0],W[J+0],re[ae+0],fe,be)}}function $a(v,w,T){return T==0?v==0?w==0?6:5:w==0?4:0:T}function Fu(v,w,T,k,H){switch(v>>>30){case 3:Xi(w,T,k,H,0);break;case 2:_i(w,T,k,H);break;case 1:ya(w,T,k,H)}}function Zo(v,w){var T,k,H=w.M,W=w.Nb,J=v.oc,re=v.pc+40,ae=v.oc,fe=v.pc+584,be=v.oc,Le=v.pc+600;for(T=0;16>T;++T)J[re+32*T-1]=129;for(T=0;8>T;++T)ae[fe+32*T-1]=129,be[Le+32*T-1]=129;for(0<H?J[re-1-32]=ae[fe-1-32]=be[Le-1-32]=129:(a(J,re-32-1,127,21),a(ae,fe-32-1,127,9),a(be,Le-32-1,127,9)),k=0;k<v.za;++k){var ce=w.ya[w.aa+k];if(0<k){for(T=-1;16>T;++T)r(J,re+32*T-4,J,re+32*T+12,4);for(T=-1;8>T;++T)r(ae,fe+32*T-4,ae,fe+32*T+4,4),r(be,Le+32*T-4,be,Le+32*T+4,4)}var Se=v.Gd,Ce=v.Hd+k,Fe=ce.ad,Te=ce.Hc;if(0<H&&(r(J,re-32,Se[Ce].y,0,16),r(ae,fe-32,Se[Ce].f,0,8),r(be,Le-32,Se[Ce].ea,0,8)),ce.Za){var Ie=J,ze=re-32+16;for(0<H&&(k>=v.za-1?a(Ie,ze,Se[Ce].y[15],4):r(Ie,ze,Se[Ce+1].y,0,4)),T=0;4>T;T++)Ie[ze+128+T]=Ie[ze+256+T]=Ie[ze+384+T]=Ie[ze+0+T];for(T=0;16>T;++T,Te<<=2)Ie=J,ze=re+Pr[T],Lr[ce.Ob[T]](Ie,ze),Fu(Te,Fe,16*+T,Ie,ze)}else if(Ie=$a(k,H,ce.Ob[0]),Ha[Ie](J,re),Te!=0)for(T=0;16>T;++T,Te<<=2)Fu(Te,Fe,16*+T,J,re+Pr[T]);for(T=ce.Gc,Ie=$a(k,H,ce.Dd),Zi[Ie](ae,fe),Zi[Ie](be,Le),Te=Fe,Ie=ae,ze=fe,255&(ce=0|T)&&(170&ce?mo(Te,256,Ie,ze):Ra(Te,256,Ie,ze)),ce=be,Te=Le,255&(T>>=8)&&(170&T?mo(Fe,320,ce,Te):Ra(Fe,320,ce,Te)),H<v.Ub-1&&(r(Se[Ce].y,0,J,re+480,16),r(Se[Ce].f,0,ae,fe+224,8),r(Se[Ce].ea,0,be,Le+224,8)),T=8*W*v.B,Se=v.sa,Ce=v.ta+16*k+16*W*v.R,Fe=v.qa,ce=v.ra+8*k+T,Te=v.Ha,Ie=v.Ia+8*k+T,T=0;16>T;++T)r(Se,Ce+T*v.R,J,re+32*T,16);for(T=0;8>T;++T)r(Fe,ce+T*v.B,ae,fe+32*T,8),r(Te,Ie+T*v.B,be,Le+32*T,8)}}function uo(v,w,T,k,H,W,J,re,ae){var fe=[0],be=[0],Le=0,ce=ae!=null?ae.kd:0,Se=ae??new _e;if(v==null||12>T)return 7;Se.data=v,Se.w=w,Se.ha=T,w=[w],T=[T],Se.gb=[Se.gb];e:{var Ce=w,Fe=T,Te=Se.gb;if(e(v!=null),e(Fe!=null),e(Te!=null),Te[0]=0,12<=Fe[0]&&!n(v,Ce[0],"RIFF")){if(n(v,Ce[0]+8,"WEBP")){Te=3;break e}var Ie=Ke(v,Ce[0]+4);if(12>Ie||4294967286<Ie){Te=3;break e}if(ce&&Ie>Fe[0]-8){Te=7;break e}Te[0]=Ie,Ce[0]+=12,Fe[0]-=12}Te=0}if(Te!=0)return Te;for(Ie=0<Se.gb[0],T=T[0];;){e:{var ze=v;Fe=w,Te=T;var Ze=fe,Ye=be,bt=Ce=[0];if((mt=Le=[Le])[0]=0,8>Te[0])Te=7;else{if(!n(ze,Fe[0],"VP8X")){if(Ke(ze,Fe[0]+4)!=10){Te=3;break e}if(18>Te[0]){Te=7;break e}var ft=Ke(ze,Fe[0]+8),Zt=1+Pe(ze,Fe[0]+12);if(2147483648<=Zt*(ze=1+Pe(ze,Fe[0]+15))){Te=3;break e}bt!=null&&(bt[0]=ft),Ze!=null&&(Ze[0]=Zt),Ye!=null&&(Ye[0]=ze),Fe[0]+=18,Te[0]-=18,mt[0]=1}Te=0}}if(Le=Le[0],Ce=Ce[0],Te!=0)return Te;if(Fe=!!(2&Ce),!Ie&&Le)return 3;if(W!=null&&(W[0]=!!(16&Ce)),J!=null&&(J[0]=Fe),re!=null&&(re[0]=0),J=fe[0],Ce=be[0],Le&&Fe&&ae==null){Te=0;break}if(4>T){Te=7;break}if(Ie&&Le||!Ie&&!Le&&!n(v,w[0],"ALPH")){T=[T],Se.na=[Se.na],Se.P=[Se.P],Se.Sa=[Se.Sa];e:{ft=v,Te=w,Ie=T;var mt=Se.gb;Ze=Se.na,Ye=Se.P,bt=Se.Sa,Zt=22,e(ft!=null),e(Ie!=null),ze=Te[0];var xn=Ie[0];for(e(Ze!=null),e(bt!=null),Ze[0]=null,Ye[0]=null,bt[0]=0;;){if(Te[0]=ze,Ie[0]=xn,8>xn){Te=7;break e}var hr=Ke(ft,ze+4);if(4294967286<hr){Te=3;break e}var on=8+hr+1&-2;if(Zt+=on,0<mt&&Zt>mt){Te=3;break e}if(!n(ft,ze,"VP8 ")||!n(ft,ze,"VP8L")){Te=0;break e}if(xn[0]<on){Te=7;break e}n(ft,ze,"ALPH")||(Ze[0]=ft,Ye[0]=ze+8,bt[0]=hr),ze+=on,xn-=on}}if(T=T[0],Se.na=Se.na[0],Se.P=Se.P[0],Se.Sa=Se.Sa[0],Te!=0)break}T=[T],Se.Ja=[Se.Ja],Se.xa=[Se.xa];e:if(mt=v,Te=w,Ie=T,Ze=Se.gb[0],Ye=Se.Ja,bt=Se.xa,ft=Te[0],ze=!n(mt,ft,"VP8 "),Zt=!n(mt,ft,"VP8L"),e(mt!=null),e(Ie!=null),e(Ye!=null),e(bt!=null),8>Ie[0])Te=7;else{if(ze||Zt){if(mt=Ke(mt,ft+4),12<=Ze&&mt>Ze-12){Te=3;break e}if(ce&&mt>Ie[0]-8){Te=7;break e}Ye[0]=mt,Te[0]+=8,Ie[0]-=8,bt[0]=Zt}else bt[0]=5<=Ie[0]&&mt[ft+0]==47&&!(mt[ft+4]>>5),Ye[0]=Ie[0];Te=0}if(T=T[0],Se.Ja=Se.Ja[0],Se.xa=Se.xa[0],w=w[0],Te!=0)break;if(4294967286<Se.Ja)return 3;if(re==null||Fe||(re[0]=Se.xa?2:1),J=[J],Ce=[Ce],Se.xa){if(5>T){Te=7;break}re=J,ce=Ce,Fe=W,v==null||5>T?v=0:5<=T&&v[w+0]==47&&!(v[w+4]>>5)?(Ie=[0],mt=[0],Ze=[0],pe(Ye=new V,v,w,T),bi(Ye,Ie,mt,Ze)?(re!=null&&(re[0]=Ie[0]),ce!=null&&(ce[0]=mt[0]),Fe!=null&&(Fe[0]=Ze[0]),v=1):v=0):v=0}else{if(10>T){Te=7;break}re=Ce,v==null||10>T||!Ta(v,w+3,T-3)?v=0:(ce=v[w+0]|v[w+1]<<8|v[w+2]<<16,Fe=16383&(v[w+7]<<8|v[w+6]),v=16383&(v[w+9]<<8|v[w+8]),1&ce||3<(ce>>1&7)||!(ce>>4&1)||ce>>5>=Se.Ja||!Fe||!v?v=0:(J&&(J[0]=Fe),re&&(re[0]=v),v=1))}if(!v||(J=J[0],Ce=Ce[0],Le&&(fe[0]!=J||be[0]!=Ce)))return 3;ae!=null&&(ae[0]=Se,ae.offset=w-ae.w,e(4294967286>w-ae.w),e(ae.offset==ae.ha-T));break}return Te==0||Te==7&&Le&&ae==null?(W!=null&&(W[0]|=Se.na!=null&&0<Se.na.length),k!=null&&(k[0]=J),H!=null&&(H[0]=Ce),0):Te}function Oa(v,w,T){var k=w.width,H=w.height,W=0,J=0,re=k,ae=H;if(w.Da=v!=null&&0<v.Da,w.Da&&(re=v.cd,ae=v.bd,W=v.v,J=v.j,11>T||(W&=-2,J&=-2),0>W||0>J||0>=re||0>=ae||W+re>k||J+ae>H))return 0;if(w.v=W,w.j=J,w.va=W+re,w.o=J+ae,w.U=re,w.T=ae,w.da=v!=null&&0<v.da,w.da){if(!tt(re,ae,T=[v.ib],W=[v.hb]))return 0;w.ib=T[0],w.hb=W[0]}return w.ob=v!=null&&v.ob,w.Kb=v==null||!v.Sd,w.da&&(w.ob=w.ib<3*k/4&&w.hb<3*H/4,w.Kb=0),1}function Qo(v){if(v==null)return 2;if(11>v.S){var w=v.f.RGBA;w.fb+=(v.height-1)*w.A,w.A=-w.A}else w=v.f.kb,v=v.height,w.O+=(v-1)*w.fa,w.fa=-w.fa,w.N+=(v-1>>1)*w.Ab,w.Ab=-w.Ab,w.W+=(v-1>>1)*w.Db,w.Db=-w.Db,w.F!=null&&(w.J+=(v-1)*w.lb,w.lb=-w.lb);return 0}function co(v,w,T,k){if(k==null||0>=v||0>=w)return 2;if(T!=null){if(T.Da){var H=T.cd,W=T.bd,J=-2&T.v,re=-2&T.j;if(0>J||0>re||0>=H||0>=W||J+H>v||re+W>w)return 2;v=H,w=W}if(T.da){if(!tt(v,w,H=[T.ib],W=[T.hb]))return 2;v=H[0],w=W[0]}}k.width=v,k.height=w;e:{var ae=k.width,fe=k.height;if(v=k.S,0>=ae||0>=fe||!(v>=Lc&&13>v))v=2;else{if(0>=k.Rd&&k.sd==null){J=W=H=w=0;var be=(re=ae*Fc[v])*fe;if(11>v||(W=(fe+1)/2*(w=(ae+1)/2),v==12&&(J=(H=ae)*fe)),(fe=s(be+2*W+J))==null){v=1;break e}k.sd=fe,11>v?((ae=k.f.RGBA).eb=fe,ae.fb=0,ae.A=re,ae.size=be):((ae=k.f.kb).y=fe,ae.O=0,ae.fa=re,ae.Fd=be,ae.f=fe,ae.N=0+be,ae.Ab=w,ae.Cd=W,ae.ea=fe,ae.W=0+be+W,ae.Db=w,ae.Ed=W,v==12&&(ae.F=fe,ae.J=0+be+2*W),ae.Tc=J,ae.lb=H)}if(w=1,H=k.S,W=k.width,J=k.height,H>=Lc&&13>H)if(11>H)v=k.f.RGBA,w&=(re=Math.abs(v.A))*(J-1)+W<=v.size,w&=re>=W*Fc[H],w&=v.eb!=null;else{v=k.f.kb,re=(W+1)/2,be=(J+1)/2,ae=Math.abs(v.fa),fe=Math.abs(v.Ab);var Le=Math.abs(v.Db),ce=Math.abs(v.lb),Se=ce*(J-1)+W;w&=ae*(J-1)+W<=v.Fd,w&=fe*(be-1)+re<=v.Cd,w=(w&=Le*(be-1)+re<=v.Ed)&ae>=W&fe>=re&Le>=re,w&=v.y!=null,w&=v.f!=null,w&=v.ea!=null,H==12&&(w&=ce>=W,w&=Se<=v.Tc,w&=v.F!=null)}else w=0;v=w?0:2}}return v!=0||T!=null&&T.fd&&(v=Qo(k)),v}var el=64,fo=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],tl=24,va=32,za=8,nl=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];ut("Predictor0","PredictorAdd0"),B.Predictor0=function(){return 4278190080},B.Predictor1=function(v){return v},B.Predictor2=function(v,w,T){return w[T+0]},B.Predictor3=function(v,w,T){return w[T+1]},B.Predictor4=function(v,w,T){return w[T-1]},B.Predictor5=function(v,w,T){return Ct(Ct(v,w[T+1]),w[T+0])},B.Predictor6=function(v,w,T){return Ct(v,w[T-1])},B.Predictor7=function(v,w,T){return Ct(v,w[T+0])},B.Predictor8=function(v,w,T){return Ct(w[T-1],w[T+0])},B.Predictor9=function(v,w,T){return Ct(w[T+0],w[T+1])},B.Predictor10=function(v,w,T){return Ct(Ct(v,w[T-1]),Ct(w[T+0],w[T+1]))},B.Predictor11=function(v,w,T){var k=w[T+0];return 0>=Bt(k>>24&255,v>>24&255,(w=w[T-1])>>24&255)+Bt(k>>16&255,v>>16&255,w>>16&255)+Bt(k>>8&255,v>>8&255,w>>8&255)+Bt(255&k,255&v,255&w)?k:v},B.Predictor12=function(v,w,T){var k=w[T+0];return(en((v>>24&255)+(k>>24&255)-((w=w[T-1])>>24&255))<<24|en((v>>16&255)+(k>>16&255)-(w>>16&255))<<16|en((v>>8&255)+(k>>8&255)-(w>>8&255))<<8|en((255&v)+(255&k)-(255&w)))>>>0},B.Predictor13=function(v,w,T){var k=w[T-1];return(tn((v=Ct(v,w[T+0]))>>24&255,k>>24&255)<<24|tn(v>>16&255,k>>16&255)<<16|tn(v>>8&255,k>>8&255)<<8|tn(255&v,255&k))>>>0};var Is=B.PredictorAdd0;B.PredictorAdd1=pn,ut("Predictor2","PredictorAdd2"),ut("Predictor3","PredictorAdd3"),ut("Predictor4","PredictorAdd4"),ut("Predictor5","PredictorAdd5"),ut("Predictor6","PredictorAdd6"),ut("Predictor7","PredictorAdd7"),ut("Predictor8","PredictorAdd8"),ut("Predictor9","PredictorAdd9"),ut("Predictor10","PredictorAdd10"),ut("Predictor11","PredictorAdd11"),ut("Predictor12","PredictorAdd12"),ut("Predictor13","PredictorAdd13");var ho=B.PredictorAdd2;Et("ColorIndexInverseTransform","MapARGB","32b",function(v){return v>>8&255},function(v){return v}),Et("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",function(v){return v},function(v){return v>>8&255});var Hl,rl=B.ColorIndexInverseTransform,Br=B.MapARGB,Zf=B.VP8LColorIndexInverseTransformAlpha,Cr=B.MapAlpha,qa=B.VP8LPredictorsAdd=[];qa.length=16,(B.VP8LPredictors=[]).length=16,(B.VP8LPredictorsAdd_C=[]).length=16,(B.VP8LPredictors_C=[]).length=16;var po,Vl,Gl,al,Fs,il,di,Xi,_i,mo,ya,Ra,Fn,Xn,Tr,cr,ds,Wl,sl,Nc,zd,qd,Qf,eh,ol,Ei,Uu,pi,ll=s(511),Cc=s(2041),Bu=s(225),$u=s(767),Tc=0,Us=Cc,zu=Bu,ka=$u,ba=ll,Lc=0,Da=1,jc=2,Ai=3,qu=4,Yl=5,go=6,Hu=7,Oc=8,Kl=9,Rc=10,Ni=[2,3,7],Jl=[3,3,11],ul=[280,256,256,256,40],kc=[0,1,1,1,0],Vu=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],Ci=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Ti=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],vo=8,Li=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],ji=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],mi=null,Hd=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],th=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],Dc=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],Vd=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],wa=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],fr=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],Nn=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],Ha=[],Lr=[],Zi=[],yo=1,nh=2,Bs=[],xa=[];ja("UpsampleRgbLinePair",oo,3),ja("UpsampleBgrLinePair",Jo,3),ja("UpsampleRgbaLinePair",Iu,4),ja("UpsampleBgraLinePair",Si,4),ja("UpsampleArgbLinePair",lo,4),ja("UpsampleRgba4444LinePair",ga,2),ja("UpsampleRgb565LinePair",Xo,2);var cl=B.UpsampleRgbLinePair,rh=B.UpsampleBgrLinePair,Xl=B.UpsampleRgbaLinePair,Pc=B.UpsampleBgraLinePair,bo=B.UpsampleArgbLinePair,ps=B.UpsampleRgba4444LinePair,wo=B.UpsampleRgb565LinePair,Oi=16,Zl=1<<Oi-1,fl=-227,xo=482,Mc=6,So=0,Sa=s(256),Ic=s(256),Gd=s(256),Wg=s(256),Yg=s(xo-fl),Kg=s(xo-fl);hs("YuvToRgbRow",oo,3),hs("YuvToBgrRow",Jo,3),hs("YuvToRgbaRow",Iu,4),hs("YuvToBgraRow",Si,4),hs("YuvToArgbRow",lo,4),hs("YuvToRgba4444Row",ga,2),hs("YuvToRgb565Row",Xo,2);var Pr=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Ql=[0,2,8],Gu=[8,7,6,4,4,2,2,2,1,1,1,1],Wu=1;this.WebPDecodeRGBA=function(v,w,T,k,H){var W=Da,J=new ye,re=new nn;J.ba=re,re.S=W,re.width=[re.width],re.height=[re.height];var ae=re.width,fe=re.height,be=new _t;if(be==null||v==null)var Le=2;else e(be!=null),Le=uo(v,w,T,be.width,be.height,be.Pd,be.Qd,be.format,null);if(Le!=0?ae=0:(ae!=null&&(ae[0]=be.width[0]),fe!=null&&(fe[0]=be.height[0]),ae=1),ae){re.width=re.width[0],re.height=re.height[0],k!=null&&(k[0]=re.width),H!=null&&(H[0]=re.height);e:{if(k=new Qa,(H=new _e).data=v,H.w=w,H.ha=T,H.kd=1,w=[0],e(H!=null),((v=uo(H.data,H.w,H.ha,null,null,null,w,null,H))==0||v==7)&&w[0]&&(v=4),(w=v)==0){if(e(J!=null),k.data=H.data,k.w=H.w+H.offset,k.ha=H.ha-H.offset,k.put=At,k.ac=ma,k.bc=yi,k.ma=J,H.xa){if((v=Ht())==null){J=1;break e}if((function(ce,Se){var Ce=[0],Fe=[0],Te=[0];t:for(;;){if(ce==null)return 0;if(Se==null)return ce.a=2,0;if(ce.l=Se,ce.a=0,pe(ce.m,Se.data,Se.w,Se.ha),!bi(ce.m,Ce,Fe,Te)){ce.a=3;break t}if(ce.xb=nh,Se.width=Ce[0],Se.height=Fe[0],!dt(Ce[0],Fe[0],1,ce,null))break t;return 1}return e(ce.a!=0),0})(v,k)){if(k=(w=co(k.width,k.height,J.Oa,J.ba))==0){t:{k=v;n:for(;;){if(k==null){k=0;break t}if(e(k.s.yc!=null),e(k.s.Ya!=null),e(0<k.s.Wb),e((T=k.l)!=null),e((H=T.ma)!=null),k.xb!=0){if(k.ca=H.ba,k.tb=H.tb,e(k.ca!=null),!Oa(H.Oa,T,Ai)){k.a=2;break n}if(!Yt(k,T.width)||T.da)break n;if((T.da||Ut(k.ca.S))&&br(),11>k.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),k.ca.f.kb.F!=null&&br()),k.Pb&&0<k.s.ua&&k.s.vb.X==null&&!ne(k.s.vb,k.s.Wa.Xa)){k.a=1;break n}k.xb=0}if(!st(k,k.V,k.Ba,k.c,k.i,T.o,at))break n;H.Dc=k.Ma,k=1;break t}e(k.a!=0),k=0}k=!k}k&&(w=v.a)}else w=v.a}else{if((v=new Kt)==null){J=1;break e}if(v.Fa=H.na,v.P=H.P,v.qc=H.Sa,Fr(v,k)){if((w=co(k.width,k.height,J.Oa,J.ba))==0){if(v.Aa=0,T=J.Oa,e((H=v)!=null),T!=null){if(0<(ae=0>(ae=T.Md)?0:100<ae?255:255*ae/100)){for(fe=be=0;4>fe;++fe)12>(Le=H.pb[fe]).lc&&(Le.ia=ae*Gu[0>Le.lc?0:Le.lc]>>3),be|=Le.ia;be&&(alert("todo:VP8InitRandom"),H.ia=1)}H.Ga=T.Id,100<H.Ga?H.Ga=100:0>H.Ga&&(H.Ga=0)}(function(ce,Se){if(ce==null)return 0;if(Se==null)return Jt(ce,2,"NULL VP8Io parameter in VP8Decode().");if(!ce.cb&&!Fr(ce,Se))return 0;if(e(ce.cb),Se.ac==null||Se.ac(Se)){Se.ob&&(ce.L=0);var Ce=Ql[ce.L];if(ce.L==2?(ce.yb=0,ce.zb=0):(ce.yb=Se.v-Ce>>4,ce.zb=Se.j-Ce>>4,0>ce.yb&&(ce.yb=0),0>ce.zb&&(ce.zb=0)),ce.Va=Se.o+15+Ce>>4,ce.Hb=Se.va+15+Ce>>4,ce.Hb>ce.za&&(ce.Hb=ce.za),ce.Va>ce.Ub&&(ce.Va=ce.Ub),0<ce.L){var Fe=ce.ed;for(Ce=0;4>Ce;++Ce){var Te;if(ce.Qa.Cb){var Ie=ce.Qa.Lb[Ce];ce.Qa.Fb||(Ie+=Fe.Tb)}else Ie=Fe.Tb;for(Te=0;1>=Te;++Te){var ze=ce.gd[Ce][Te],Ze=Ie;if(Fe.Pc&&(Ze+=Fe.vd[0],Te&&(Ze+=Fe.od[0])),0<(Ze=0>Ze?0:63<Ze?63:Ze)){var Ye=Ze;0<Fe.wb&&(Ye=4<Fe.wb?Ye>>2:Ye>>1)>9-Fe.wb&&(Ye=9-Fe.wb),1>Ye&&(Ye=1),ze.dd=Ye,ze.tc=2*Ze+Ye,ze.ld=40<=Ze?2:15<=Ze?1:0}else ze.tc=0;ze.La=Te}}}Ce=0}else Jt(ce,6,"Frame setup failed"),Ce=ce.a;if(Ce=Ce==0){if(Ce){ce.$c=0,0<ce.Aa||(ce.Ic=Wu);t:{Ce=ce.Ic,Fe=4*(Ye=ce.za);var bt=32*Ye,ft=Ye+1,Zt=0<ce.L?Ye*(0<ce.Aa?2:1):0,mt=(ce.Aa==2?2:1)*Ye;if((ze=Fe+832+(Te=3*(16*Ce+Ql[ce.L])/2*bt)+(Ie=ce.Fa!=null&&0<ce.Fa.length?ce.Kc.c*ce.Kc.i:0))!=ze)Ce=0;else{if(ze>ce.Vb){if(ce.Vb=0,ce.Ec=s(ze),ce.Fc=0,ce.Ec==null){Ce=Jt(ce,1,"no memory during frame initialization.");break t}ce.Vb=ze}ze=ce.Ec,Ze=ce.Fc,ce.Ac=ze,ce.Bc=Ze,Ze+=Fe,ce.Gd=l(bt,Za),ce.Hd=0,ce.rb=l(ft+1,oa),ce.sb=1,ce.wa=Zt?l(Zt,Nr):null,ce.Y=0,ce.D.Nb=0,ce.D.wa=ce.wa,ce.D.Y=ce.Y,0<ce.Aa&&(ce.D.Y+=Ye),e(!0),ce.oc=ze,ce.pc=Ze,Ze+=832,ce.ya=l(mt,Ca),ce.aa=0,ce.D.ya=ce.ya,ce.D.aa=ce.aa,ce.Aa==2&&(ce.D.aa+=Ye),ce.R=16*Ye,ce.B=8*Ye,Ye=(bt=Ql[ce.L])*ce.R,bt=bt/2*ce.B,ce.sa=ze,ce.ta=Ze+Ye,ce.qa=ce.sa,ce.ra=ce.ta+16*Ce*ce.R+bt,ce.Ha=ce.qa,ce.Ia=ce.ra+8*Ce*ce.B+bt,ce.$c=0,Ze+=Te,ce.mb=Ie?ze:null,ce.nb=Ie?Ze:null,e(Ze+Ie<=ce.Fc+ce.Vb),us(ce),a(ce.Ac,ce.Bc,0,Fe),Ce=1}}if(Ce){if(Se.ka=0,Se.y=ce.sa,Se.O=ce.ta,Se.f=ce.qa,Se.N=ce.ra,Se.ea=ce.Ha,Se.Vd=ce.Ia,Se.fa=ce.R,Se.Rc=ce.B,Se.F=null,Se.J=0,!Tc){for(Ce=-255;255>=Ce;++Ce)ll[255+Ce]=0>Ce?-Ce:Ce;for(Ce=-1020;1020>=Ce;++Ce)Cc[1020+Ce]=-128>Ce?-128:127<Ce?127:Ce;for(Ce=-112;112>=Ce;++Ce)Bu[112+Ce]=-16>Ce?-16:15<Ce?15:Ce;for(Ce=-255;510>=Ce;++Ce)$u[255+Ce]=0>Ce?0:255<Ce?255:Ce;Tc=1}di=Ts,Xi=ju,mo=ao,ya=wc,Ra=Hi,_i=Lu,Fn=_c,Xn=ql,Tr=Ac,cr=C,ds=Ec,Wl=Ko,sl=q,Nc=ue,zd=io,qd=Os,Qf=Rs,eh=Pu,Lr[0]=Sc,Lr[1]=Ho,Lr[2]=xc,Lr[3]=ku,Lr[4]=Vo,Lr[5]=Wi,Lr[6]=Gi,Lr[7]=fi,Lr[8]=Du,Lr[9]=fs,Ha[0]=wi,Ha[1]=Ou,Ha[2]=Jf,Ha[3]=Xf,Ha[4]=cs,Ha[5]=Ru,Ha[6]=xi,Zi[0]=zl,Zi[1]=Bl,Zi[2]=Ls,Zi[3]=$l,Zi[4]=La,Zi[5]=Go,Zi[6]=Yi,Ce=1}else Ce=0}Ce&&(Ce=(function(xn,hr){for(xn.M=0;xn.M<xn.Va;++xn.M){var on,ht=xn.Jc[xn.M&xn.Xb],nt=xn.m,wr=xn;for(on=0;on<wr.za;++on){var $t=nt,dn=wr,Vn=dn.Ac,Zr=dn.Bc+4*on,_a=dn.zc,ar=dn.ya[dn.aa+on];if(dn.Qa.Bb?ar.$b=Re($t,dn.Pa.jb[0])?2+Re($t,dn.Pa.jb[2]):Re($t,dn.Pa.jb[1]):ar.$b=0,dn.kc&&(ar.Ad=Re($t,dn.Bd)),ar.Za=!Re($t,145)+0,ar.Za){var $r=ar.Ob,Pa=0;for(dn=0;4>dn;++dn){var zr,yn=_a[0+dn];for(zr=0;4>zr;++zr){yn=wa[Vn[Zr+zr]][yn];for(var Dn=Dc[Re($t,yn[0])];0<Dn;)Dn=Dc[2*Dn+Re($t,yn[Dn])];yn=-Dn,Vn[Zr+zr]=yn}r($r,Pa,Vn,Zr,4),Pa+=4,_a[0+dn]=yn}}else yn=Re($t,156)?Re($t,128)?1:3:Re($t,163)?2:0,ar.Ob[0]=yn,a(Vn,Zr,yn,4),a(_a,0,yn,4);ar.Dd=Re($t,142)?Re($t,114)?Re($t,183)?1:3:2:0}if(wr.m.Ka)return Jt(xn,7,"Premature end-of-partition0 encountered.");for(;xn.ja<xn.za;++xn.ja){if(wr=ht,$t=(nt=xn).rb[nt.sb-1],Vn=nt.rb[nt.sb+nt.ja],on=nt.ya[nt.aa+nt.ja],Zr=nt.kc?on.Ad:0)$t.la=Vn.la=0,on.Za||($t.Na=Vn.Na=0),on.Hc=0,on.Gc=0,on.ia=0;else{var xr,Un;if($t=Vn,Vn=wr,Zr=nt.Pa.Xc,_a=nt.ya[nt.aa+nt.ja],ar=nt.pb[_a.$b],dn=_a.ad,$r=0,Pa=nt.rb[nt.sb-1],yn=zr=0,a(dn,$r,0,384),_a.Za)var Qr=0,Sr=Zr[3];else{Dn=s(16);var Pn=$t.Na+Pa.Na;if(Pn=mi(Vn,Zr[1],Pn,ar.Eb,0,Dn,0),$t.Na=Pa.Na=(0<Pn)+0,1<Pn)di(Dn,0,dn,$r);else{var Mr=Dn[0]+3>>3;for(Dn=0;256>Dn;Dn+=16)dn[$r+Dn]=Mr}Qr=1,Sr=Zr[0]}var Gn=15&$t.la,qr=15&Pa.la;for(Dn=0;4>Dn;++Dn){var Hr=1&qr;for(Mr=Un=0;4>Mr;++Mr)Gn=Gn>>1|(Hr=(Pn=mi(Vn,Sr,Pn=Hr+(1&Gn),ar.Sc,Qr,dn,$r))>Qr)<<7,Un=Un<<2|(3<Pn?3:1<Pn?2:dn[$r+0]!=0),$r+=16;Gn>>=4,qr=qr>>1|Hr<<7,zr=(zr<<8|Un)>>>0}for(Sr=Gn,Qr=qr>>4,xr=0;4>xr;xr+=2){for(Un=0,Gn=$t.la>>4+xr,qr=Pa.la>>4+xr,Dn=0;2>Dn;++Dn){for(Hr=1&qr,Mr=0;2>Mr;++Mr)Pn=Hr+(1&Gn),Gn=Gn>>1|(Hr=0<(Pn=mi(Vn,Zr[2],Pn,ar.Qc,0,dn,$r)))<<3,Un=Un<<2|(3<Pn?3:1<Pn?2:dn[$r+0]!=0),$r+=16;Gn>>=2,qr=qr>>1|Hr<<5}yn|=Un<<4*xr,Sr|=Gn<<4<<xr,Qr|=(240&qr)<<xr}$t.la=Sr,Pa.la=Qr,_a.Hc=zr,_a.Gc=yn,_a.ia=43690&yn?0:ar.ia,Zr=!(zr|yn)}if(0<nt.L&&(nt.wa[nt.Y+nt.ja]=nt.gd[on.$b][on.Za],nt.wa[nt.Y+nt.ja].La|=!Zr),wr.Ka)return Jt(xn,7,"Premature end-of-file encountered.")}if(us(xn),nt=hr,wr=1,on=(ht=xn).D,$t=0<ht.L&&ht.M>=ht.zb&&ht.M<=ht.Va,ht.Aa==0)t:{if(on.M=ht.M,on.uc=$t,Zo(ht,on),wr=1,on=(Un=ht.D).Nb,$t=(yn=Ql[ht.L])*ht.R,Vn=yn/2*ht.B,Dn=16*on*ht.R,Mr=8*on*ht.B,Zr=ht.sa,_a=ht.ta-$t+Dn,ar=ht.qa,dn=ht.ra-Vn+Mr,$r=ht.Ha,Pa=ht.Ia-Vn+Mr,qr=(Gn=Un.M)==0,zr=Gn>=ht.Va-1,ht.Aa==2&&Zo(ht,Un),Un.uc)for(Hr=(Pn=ht).D.M,e(Pn.D.uc),Un=Pn.yb;Un<Pn.Hb;++Un){Qr=Un,Sr=Hr;var er=(On=(Vr=Pn).D).Nb;xr=Vr.R;var On=On.wa[On.Y+Qr],Ma=Vr.sa,jr=Vr.ta+16*er*xr+16*Qr,Rt=On.dd,Pt=On.tc;if(Pt!=0)if(e(3<=Pt),Vr.L==1)0<Qr&&qd(Ma,jr,xr,Pt+4),On.La&&eh(Ma,jr,xr,Pt),0<Sr&&zd(Ma,jr,xr,Pt+4),On.La&&Qf(Ma,jr,xr,Pt);else{var Mn=Vr.B,ti=Vr.qa,Ri=Vr.ra+8*er*Mn+8*Qr,Va=Vr.Ha,Vr=Vr.Ia+8*er*Mn+8*Qr;er=On.ld,0<Qr&&(Xn(Ma,jr,xr,Pt+4,Rt,er),cr(ti,Ri,Va,Vr,Mn,Pt+4,Rt,er)),On.La&&(Wl(Ma,jr,xr,Pt,Rt,er),Nc(ti,Ri,Va,Vr,Mn,Pt,Rt,er)),0<Sr&&(Fn(Ma,jr,xr,Pt+4,Rt,er),Tr(ti,Ri,Va,Vr,Mn,Pt+4,Rt,er)),On.La&&(ds(Ma,jr,xr,Pt,Rt,er),sl(ti,Ri,Va,Vr,Mn,Pt,Rt,er))}}if(ht.ia&&alert("todo:DitherRow"),nt.put!=null){if(Un=16*Gn,Gn=16*(Gn+1),qr?(nt.y=ht.sa,nt.O=ht.ta+Dn,nt.f=ht.qa,nt.N=ht.ra+Mr,nt.ea=ht.Ha,nt.W=ht.Ia+Mr):(Un-=yn,nt.y=Zr,nt.O=_a,nt.f=ar,nt.N=dn,nt.ea=$r,nt.W=Pa),zr||(Gn-=yn),Gn>nt.o&&(Gn=nt.o),nt.F=null,nt.J=null,ht.Fa!=null&&0<ht.Fa.length&&Un<Gn&&(nt.J=Ur(ht,nt,Un,Gn-Un),nt.F=ht.mb,nt.F==null&&nt.F.length==0)){wr=Jt(ht,3,"Could not decode alpha data.");break t}Un<nt.j&&(yn=nt.j-Un,Un=nt.j,e(!(1&yn)),nt.O+=ht.R*yn,nt.N+=ht.B*(yn>>1),nt.W+=ht.B*(yn>>1),nt.F!=null&&(nt.J+=nt.width*yn)),Un<Gn&&(nt.O+=nt.v,nt.N+=nt.v>>1,nt.W+=nt.v>>1,nt.F!=null&&(nt.J+=nt.v),nt.ka=Un-nt.j,nt.U=nt.va-nt.v,nt.T=Gn-Un,wr=nt.put(nt))}on+1!=ht.Ic||zr||(r(ht.sa,ht.ta-$t,Zr,_a+16*ht.R,$t),r(ht.qa,ht.ra-Vn,ar,dn+8*ht.B,Vn),r(ht.Ha,ht.Ia-Vn,$r,Pa+8*ht.B,Vn))}if(!wr)return Jt(xn,6,"Output aborted.")}return 1})(ce,Se)),Se.bc!=null&&Se.bc(Se),Ce&=1}return Ce?(ce.cb=0,Ce):0})(v,k)||(w=v.a)}}else w=v.a}w==0&&J.Oa!=null&&J.Oa.fd&&(w=Qo(J.ba))}J=w}W=J!=0?null:11>W?re.f.RGBA.eb:re.f.kb.y}else W=null;return W};var Fc=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function h(B,X){for(var F="",$=0;$<4;$++)F+=String.fromCharCode(B[X++]);return F}function d(B,X){return B[X+0]|B[X+1]<<8}function m(B,X){return(B[X+0]|B[X+1]<<8|B[X+2]<<16)>>>0}function y(B,X){return(B[X+0]|B[X+1]<<8|B[X+2]<<16|B[X+3]<<24)>>>0}new c;var g=[0],x=[0],_=[],N=new c,A=t,j=(function(B,X){var F={},$=0,K=!1,Y=0,he=0;if(F.frames=[],!(function(O,V){for(var Z=0;Z<4;Z++)if(O[V+Z]!="RIFF".charCodeAt(Z))return!0;return!1})(B,X)){for(y(B,X+=4),X+=8;X<B.length;){var te=h(B,X),oe=y(B,X+=4);X+=4;var le=oe+(1&oe);switch(te){case"VP8 ":case"VP8L":F.frames[$]===void 0&&(F.frames[$]={}),(U=F.frames[$]).src_off=K?he:X-8,U.src_size=Y+oe+8,$++,K&&(K=!1,Y=0,he=0);break;case"VP8X":(U=F.header={}).feature_flags=B[X];var pe=X+4;U.canvas_width=1+m(B,pe),pe+=3,U.canvas_height=1+m(B,pe),pe+=3;break;case"ALPH":K=!0,Y=le+8,he=X-8;break;case"ANIM":(U=F.header).bgcolor=y(B,X),pe=X+4,U.loop_count=d(B,pe),pe+=2;break;case"ANMF":var Ne,U;(U=F.frames[$]={}).offset_x=2*m(B,X),X+=3,U.offset_y=2*m(B,X),X+=3,U.width=1+m(B,X),X+=3,U.height=1+m(B,X),X+=3,U.duration=m(B,X),X+=3,Ne=B[X++],U.dispose=1&Ne,U.blend=Ne>>1&1}te!="ANMF"&&(X+=le)}return F}})(A,0);j.response=A,j.rgbaoutput=!0,j.dataurl=!1;var L=j.header?j.header:null,R=j.frames?j.frames:null;if(L){L.loop_counter=L.loop_count,g=[L.canvas_height],x=[L.canvas_width];for(var I=0;I<R.length&&R[I].blend!=0;I++);}var ee=R[0],G=N.WebPDecodeRGBA(A,ee.src_off,ee.src_size,x,g);ee.rgba=G,ee.imgwidth=x[0],ee.imgheight=g[0];for(var P=0;P<x[0]*g[0]*4;P++)_[P]=G[P];return this.width=x,this.height=g,this.data=_,this}/** ====================================================================
|
|
1107
|
+
* @license
|
|
1108
|
+
* jsPDF XMP metadata plugin
|
|
1109
|
+
* Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
|
|
1110
|
+
*
|
|
1111
|
+
* Permission is hereby granted, free of charge, to any person obtaining
|
|
1112
|
+
* a copy of this software and associated documentation files (the
|
|
1113
|
+
* "Software"), to deal in the Software without restriction, including
|
|
1114
|
+
* without limitation the rights to use, copy, modify, merge, publish,
|
|
1115
|
+
* distribute, sublicense, and/or sell copies of the Software, and to
|
|
1116
|
+
* permit persons to whom the Software is furnished to do so, subject to
|
|
1117
|
+
* the following conditions:
|
|
1118
|
+
*
|
|
1119
|
+
* The above copyright notice and this permission notice shall be
|
|
1120
|
+
* included in all copies or substantial portions of the Software.
|
|
1121
|
+
*
|
|
1122
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
1123
|
+
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
1124
|
+
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
1125
|
+
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
1126
|
+
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
1127
|
+
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
1128
|
+
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1129
|
+
* ====================================================================
|
|
1130
|
+
*/function mz(){var t,e=this.internal.__metadata__.metadata,n=unescape(encodeURIComponent(e));t=this.internal.__metadata__.rawXml?n:'<x:xmpmeta xmlns:x="adobe:ns:meta/"><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceUri+'"><jspdf:metadata>'+n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")+"</jspdf:metadata></rdf:Description></rdf:RDF></x:xmpmeta>",this.internal.__metadata__.metadataObjectNumber=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+t.length+" >>"),this.internal.write("stream"),this.internal.write(t),this.internal.write("endstream"),this.internal.write("endobj")}function gz(){this.internal.__metadata__.metadataObjectNumber&&this.internal.write("/Metadata "+this.internal.__metadata__.metadataObjectNumber+" 0 R")}(function(t){var e,n,r,a,s,l,u,c,h,d=function(O){return O=O||{},this.isStrokeTransparent=O.isStrokeTransparent||!1,this.strokeOpacity=O.strokeOpacity||1,this.strokeStyle=O.strokeStyle||"#000000",this.fillStyle=O.fillStyle||"#000000",this.isFillTransparent=O.isFillTransparent||!1,this.fillOpacity=O.fillOpacity||1,this.font=O.font||"10px sans-serif",this.textBaseline=O.textBaseline||"alphabetic",this.textAlign=O.textAlign||"left",this.lineWidth=O.lineWidth||1,this.lineJoin=O.lineJoin||"miter",this.lineCap=O.lineCap||"butt",this.path=O.path||[],this.transform=O.transform!==void 0?O.transform.clone():new c,this.globalCompositeOperation=O.globalCompositeOperation||"normal",this.globalAlpha=O.globalAlpha||1,this.clip_path=O.clip_path||[],this.currentPoint=O.currentPoint||new l,this.miterLimit=O.miterLimit||10,this.lastPoint=O.lastPoint||new l,this.lineDashOffset=O.lineDashOffset||0,this.lineDash=O.lineDash||[],this.margin=O.margin||[0,0,0,0],this.prevPageLastElemOffset=O.prevPageLastElemOffset||0,this.ignoreClearRect=typeof O.ignoreClearRect!="boolean"||O.ignoreClearRect,this};t.events.push(["initialized",function(){this.context2d=new m(this),e=this.internal.f2,n=this.internal.getCoordinateString,r=this.internal.getVerticalCoordinateString,a=this.internal.getHorizontalCoordinate,s=this.internal.getVerticalCoordinate,l=this.internal.Point,u=this.internal.Rectangle,c=this.internal.Matrix,h=new d}]);var m=function(O){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var V=O;Object.defineProperty(this,"pdf",{get:function(){return V}});var Z=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return Z},set:function(ne){Z=!!ne}});var ie=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return ie},set:function(ne){ie=!!ne}});var z=0;Object.defineProperty(this,"posX",{get:function(){return z},set:function(ne){isNaN(ne)||(z=ne)}});var se=0;Object.defineProperty(this,"posY",{get:function(){return se},set:function(ne){isNaN(ne)||(se=ne)}}),Object.defineProperty(this,"margin",{get:function(){return h.margin},set:function(ne){var We;typeof ne=="number"?We=[ne,ne,ne,ne]:((We=new Array(4))[0]=ne[0],We[1]=ne.length>=2?ne[1]:We[0],We[2]=ne.length>=3?ne[2]:We[0],We[3]=ne.length>=4?ne[3]:We[1]),h.margin=We}});var ge=!1;Object.defineProperty(this,"autoPaging",{get:function(){return ge},set:function(ne){ge=ne}});var xe=0;Object.defineProperty(this,"lastBreak",{get:function(){return xe},set:function(ne){xe=ne}});var Re=[];Object.defineProperty(this,"pageBreaks",{get:function(){return Re},set:function(ne){Re=ne}}),Object.defineProperty(this,"ctx",{get:function(){return h},set:function(ne){ne instanceof d&&(h=ne)}}),Object.defineProperty(this,"path",{get:function(){return h.path},set:function(ne){h.path=ne}});var De=[];Object.defineProperty(this,"ctxStack",{get:function(){return De},set:function(ne){De=ne}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(ne){var We;We=y(ne),this.ctx.fillStyle=We.style,this.ctx.isFillTransparent=We.a===0,this.ctx.fillOpacity=We.a,this.pdf.setFillColor(We.r,We.g,We.b,{a:We.a}),this.pdf.setTextColor(We.r,We.g,We.b,{a:We.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(ne){var We=y(ne);this.ctx.strokeStyle=We.style,this.ctx.isStrokeTransparent=We.a===0,this.ctx.strokeOpacity=We.a,We.a===0?this.pdf.setDrawColor(255,255,255):(We.a,this.pdf.setDrawColor(We.r,We.g,We.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(ne){["butt","round","square"].indexOf(ne)!==-1&&(this.ctx.lineCap=ne,this.pdf.setLineCap(ne))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(ne){isNaN(ne)||(this.ctx.lineWidth=ne,this.pdf.setLineWidth(ne))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(ne){["bevel","round","miter"].indexOf(ne)!==-1&&(this.ctx.lineJoin=ne,this.pdf.setLineJoin(ne))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(ne){isNaN(ne)||(this.ctx.miterLimit=ne,this.pdf.setMiterLimit(ne))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(ne){this.ctx.textBaseline=ne}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(ne){["right","end","center","left","start"].indexOf(ne)!==-1&&(this.ctx.textAlign=ne)}});var qe=null,Pe=null,Ke=null;Object.defineProperty(this,"fontFaces",{get:function(){return Ke},set:function(ne){qe=null,Pe=null,Ke=ne}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(ne){var We;if(this.ctx.font=ne,(We=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z0-9]+?)\s*$/i.exec(ne))!==null){var it=We[1];We[2];var tt=We[3],Ve=We[4];We[5];var gt=We[6],ut=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Ve)[2];Ve=Math.floor(ut==="px"?parseFloat(Ve)*this.pdf.internal.scaleFactor:ut==="em"?parseFloat(Ve)*this.pdf.getFontSize():parseFloat(Ve)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(Ve);var Ot=(function(Et){var gr,fn,Dt=[],Tt=Et.trim();if(Tt==="")return mv;if(Tt in C_)return[C_[Tt]];for(;Tt!=="";){switch(fn=null,gr=(Tt=L_(Tt)).charAt(0)){case'"':case"'":fn=uz(Tt.substring(1),gr);break;default:fn=cz(Tt)}if(fn===null||(Dt.push(fn[0]),(Tt=L_(fn[1]))!==""&&Tt.charAt(0)!==","))return mv;Tt=Tt.replace(/^,/,"")}return Dt})(gt);if(this.fontFaces){var Ct=(function(Et,gr){var fn=Et.getFontList(),Dt=JSON.stringify(fn);if(qe===null||Pe!==Dt){var Tt=(function(mn){var Lt=[];return Object.keys(mn).forEach(function(Hn){mn[Hn].forEach(function(Ut){var qt=null;switch(Ut){case"bold":qt={family:Hn,weight:"bold"};break;case"italic":qt={family:Hn,style:"italic"};break;case"bolditalic":qt={family:Hn,weight:"bold",style:"italic"};break;case"":case"normal":qt={family:Hn}}qt!==null&&(qt.ref={name:Hn,style:Ut},Lt.push(qt))})}),Lt})(fn);qe=(function(mn){for(var Lt={},Hn=0;Hn<mn.length;++Hn){var Ut=pv(mn[Hn]),qt=Ut.family,kn=Ut.stretch,nn=Ut.style,_t=Ut.weight;Lt[qt]=Lt[qt]||{},Lt[qt][kn]=Lt[qt][kn]||{},Lt[qt][kn][nn]=Lt[qt][kn][nn]||{},Lt[qt][kn][nn][_t]=Ut}return Lt})(Tt.concat(gr)),Pe=Dt}return qe})(this.pdf,this.fontFaces),en=Ot.map(function(Et){return{family:Et,stretch:"normal",weight:tt,style:it}}),tn=(function(Et,gr,fn){for(var Dt=(fn=fn||{}).defaultFontFamily||"times",Tt=Object.assign({},lz,fn.genericFontFamilies||{}),mn=null,Lt=null,Hn=0;Hn<gr.length;++Hn)if(Tt[(mn=pv(gr[Hn])).family]&&(mn.family=Tt[mn.family]),Et.hasOwnProperty(mn.family)){Lt=Et[mn.family];break}if(!(Lt=Lt||Et[Dt]))throw new Error("Could not find a font-family for the rule '"+T_(mn)+"' and default family '"+Dt+"'.");if(Lt=(function(Ut,qt){if(qt[Ut])return qt[Ut];var kn=Ey[Ut],nn=kn<=Ey.normal?-1:1,_t=N_(qt,PA,kn,nn);if(!_t)throw new Error("Could not find a matching font-stretch value for "+Ut);return _t})(mn.stretch,Lt),Lt=(function(Ut,qt){if(qt[Ut])return qt[Ut];for(var kn=DA[Ut],nn=0;nn<kn.length;++nn)if(qt[kn[nn]])return qt[kn[nn]];throw new Error("Could not find a matching font-style for "+Ut)})(mn.style,Lt),!(Lt=(function(Ut,qt){if(qt[Ut])return qt[Ut];if(Ut===400&&qt[500])return qt[500];if(Ut===500&&qt[400])return qt[400];var kn=oz[Ut],nn=N_(qt,MA,kn,Ut<400?-1:1);if(!nn)throw new Error("Could not find a matching font-weight for value "+Ut);return nn})(mn.weight,Lt)))throw new Error("Failed to resolve a font for the rule '"+T_(mn)+"'.");return Lt})(Ct,en);this.pdf.setFont(tn.ref.name,tn.ref.style)}else{var Bt="";(tt==="bold"||parseInt(tt,10)>=700||it==="bold")&&(Bt="bold"),it==="italic"&&(Bt+="italic"),Bt.length===0&&(Bt="normal");for(var pn="",an={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},lt=0;lt<Ot.length;lt++){if(this.pdf.internal.getFont(Ot[lt],Bt,{noFallback:!0,disableWarning:!0})!==void 0){pn=Ot[lt];break}if(Bt==="bolditalic"&&this.pdf.internal.getFont(Ot[lt],"bold",{noFallback:!0,disableWarning:!0})!==void 0)pn=Ot[lt],Bt="bold";else if(this.pdf.internal.getFont(Ot[lt],"normal",{noFallback:!0,disableWarning:!0})!==void 0){pn=Ot[lt],Bt="normal";break}}if(pn===""){for(var kt=0;kt<Ot.length;kt++)if(an[Ot[kt]]){pn=an[Ot[kt]];break}}pn=pn===""?"Times":pn,this.pdf.setFont(pn,Bt)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(ne){this.ctx.globalCompositeOperation=ne}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(ne){this.ctx.globalAlpha=ne}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(ne){this.ctx.lineDashOffset=ne,U.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(ne){this.ctx.lineDash=ne,U.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(ne){this.ctx.ignoreClearRect=!!ne}})};m.prototype.setLineDash=function(O){this.lineDash=O},m.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},m.prototype.fill=function(){R.call(this,"fill",!1)},m.prototype.stroke=function(){R.call(this,"stroke",!1)},m.prototype.beginPath=function(){this.path=[{type:"begin"}]},m.prototype.moveTo=function(O,V){if(isNaN(O)||isNaN(V))throw pr.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var Z=this.ctx.transform.applyToPoint(new l(O,V));this.path.push({type:"mt",x:Z.x,y:Z.y}),this.ctx.lastPoint=new l(O,V)},m.prototype.closePath=function(){var O=new l(0,0),V=0;for(V=this.path.length-1;V!==-1;V--)if(this.path[V].type==="begin"&&In(this.path[V+1])==="object"&&typeof this.path[V+1].x=="number"){O=new l(this.path[V+1].x,this.path[V+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new l(O.x,O.y)},m.prototype.lineTo=function(O,V){if(isNaN(O)||isNaN(V))throw pr.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var Z=this.ctx.transform.applyToPoint(new l(O,V));this.path.push({type:"lt",x:Z.x,y:Z.y}),this.ctx.lastPoint=new l(Z.x,Z.y)},m.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),R.call(this,null,!0)},m.prototype.quadraticCurveTo=function(O,V,Z,ie){if(isNaN(Z)||isNaN(ie)||isNaN(O)||isNaN(V))throw pr.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var z=this.ctx.transform.applyToPoint(new l(Z,ie)),se=this.ctx.transform.applyToPoint(new l(O,V));this.path.push({type:"qct",x1:se.x,y1:se.y,x:z.x,y:z.y}),this.ctx.lastPoint=new l(z.x,z.y)},m.prototype.bezierCurveTo=function(O,V,Z,ie,z,se){if(isNaN(z)||isNaN(se)||isNaN(O)||isNaN(V)||isNaN(Z)||isNaN(ie))throw pr.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var ge=this.ctx.transform.applyToPoint(new l(z,se)),xe=this.ctx.transform.applyToPoint(new l(O,V)),Re=this.ctx.transform.applyToPoint(new l(Z,ie));this.path.push({type:"bct",x1:xe.x,y1:xe.y,x2:Re.x,y2:Re.y,x:ge.x,y:ge.y}),this.ctx.lastPoint=new l(ge.x,ge.y)},m.prototype.arc=function(O,V,Z,ie,z,se){if(isNaN(O)||isNaN(V)||isNaN(Z)||isNaN(ie)||isNaN(z))throw pr.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(se=!!se,!this.ctx.transform.isIdentity){var ge=this.ctx.transform.applyToPoint(new l(O,V));O=ge.x,V=ge.y;var xe=this.ctx.transform.applyToPoint(new l(0,Z)),Re=this.ctx.transform.applyToPoint(new l(0,0));Z=Math.sqrt(Math.pow(xe.x-Re.x,2)+Math.pow(xe.y-Re.y,2))}Math.abs(z-ie)>=2*Math.PI&&(ie=0,z=2*Math.PI),this.path.push({type:"arc",x:O,y:V,radius:Z,startAngle:ie,endAngle:z,counterclockwise:se})},m.prototype.arcTo=function(O,V,Z,ie,z){throw new Error("arcTo not implemented.")},m.prototype.rect=function(O,V,Z,ie){if(isNaN(O)||isNaN(V)||isNaN(Z)||isNaN(ie))throw pr.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(O,V),this.lineTo(O+Z,V),this.lineTo(O+Z,V+ie),this.lineTo(O,V+ie),this.lineTo(O,V),this.lineTo(O+Z,V),this.lineTo(O,V)},m.prototype.fillRect=function(O,V,Z,ie){if(isNaN(O)||isNaN(V)||isNaN(Z)||isNaN(ie))throw pr.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!g.call(this)){var z={};this.lineCap!=="butt"&&(z.lineCap=this.lineCap,this.lineCap="butt"),this.lineJoin!=="miter"&&(z.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(O,V,Z,ie),this.fill(),z.hasOwnProperty("lineCap")&&(this.lineCap=z.lineCap),z.hasOwnProperty("lineJoin")&&(this.lineJoin=z.lineJoin)}},m.prototype.strokeRect=function(O,V,Z,ie){if(isNaN(O)||isNaN(V)||isNaN(Z)||isNaN(ie))throw pr.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");x.call(this)||(this.beginPath(),this.rect(O,V,Z,ie),this.stroke())},m.prototype.clearRect=function(O,V,Z,ie){if(isNaN(O)||isNaN(V)||isNaN(Z)||isNaN(ie))throw pr.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(O,V,Z,ie))},m.prototype.save=function(O){O=typeof O!="boolean"||O;for(var V=this.pdf.internal.getCurrentPageInfo().pageNumber,Z=0;Z<this.pdf.internal.getNumberOfPages();Z++)this.pdf.setPage(Z+1),this.pdf.internal.out("q");if(this.pdf.setPage(V),O){this.ctx.fontSize=this.pdf.internal.getFontSize();var ie=new d(this.ctx);this.ctxStack.push(this.ctx),this.ctx=ie}},m.prototype.restore=function(O){O=typeof O!="boolean"||O;for(var V=this.pdf.internal.getCurrentPageInfo().pageNumber,Z=0;Z<this.pdf.internal.getNumberOfPages();Z++)this.pdf.setPage(Z+1),this.pdf.internal.out("Q");this.pdf.setPage(V),O&&this.ctxStack.length!==0&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},m.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var y=function(O){var V,Z,ie,z;if(O.isCanvasGradient===!0&&(O=O.getColor()),!O)return{r:0,g:0,b:0,a:0,style:O};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(O))V=0,Z=0,ie=0,z=0;else{var se=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(O);if(se!==null)V=parseInt(se[1]),Z=parseInt(se[2]),ie=parseInt(se[3]),z=1;else if((se=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(O))!==null)V=parseInt(se[1]),Z=parseInt(se[2]),ie=parseInt(se[3]),z=parseFloat(se[4]);else{if(z=1,typeof O=="string"&&O.charAt(0)!=="#"){var ge=new CA(O);O=ge.ok?ge.toHex():"#000000"}O.length===4?(V=O.substring(1,2),V+=V,Z=O.substring(2,3),Z+=Z,ie=O.substring(3,4),ie+=ie):(V=O.substring(1,3),Z=O.substring(3,5),ie=O.substring(5,7)),V=parseInt(V,16),Z=parseInt(Z,16),ie=parseInt(ie,16)}}return{r:V,g:Z,b:ie,a:z,style:O}},g=function(){return this.ctx.isFillTransparent||this.globalAlpha==0},x=function(){return!!(this.ctx.isStrokeTransparent||this.globalAlpha==0)};m.prototype.fillText=function(O,V,Z,ie){if(isNaN(V)||isNaN(Z)||typeof O!="string")throw pr.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(ie=isNaN(ie)?void 0:ie,!g.call(this)){var z=le(this.ctx.transform.rotation),se=this.ctx.transform.scaleX;$.call(this,{text:O,x:V,y:Z,scale:se,angle:z,align:this.textAlign,maxWidth:ie})}},m.prototype.strokeText=function(O,V,Z,ie){if(isNaN(V)||isNaN(Z)||typeof O!="string")throw pr.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!x.call(this)){ie=isNaN(ie)?void 0:ie;var z=le(this.ctx.transform.rotation),se=this.ctx.transform.scaleX;$.call(this,{text:O,x:V,y:Z,scale:se,renderingMode:"stroke",angle:z,align:this.textAlign,maxWidth:ie})}},m.prototype.measureText=function(O){if(typeof O!="string")throw pr.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var V=this.pdf,Z=this.pdf.internal.scaleFactor,ie=V.internal.getFontSize(),z=V.getStringUnitWidth(O)*ie/V.internal.scaleFactor;return new function(se){var ge=(se=se||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return ge}}),this}({width:z*=Math.round(96*Z/72*1e4)/1e4})},m.prototype.scale=function(O,V){if(isNaN(O)||isNaN(V))throw pr.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var Z=new c(O,0,0,V,0,0);this.ctx.transform=this.ctx.transform.multiply(Z)},m.prototype.rotate=function(O){if(isNaN(O))throw pr.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var V=new c(Math.cos(O),Math.sin(O),-Math.sin(O),Math.cos(O),0,0);this.ctx.transform=this.ctx.transform.multiply(V)},m.prototype.translate=function(O,V){if(isNaN(O)||isNaN(V))throw pr.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var Z=new c(1,0,0,1,O,V);this.ctx.transform=this.ctx.transform.multiply(Z)},m.prototype.transform=function(O,V,Z,ie,z,se){if(isNaN(O)||isNaN(V)||isNaN(Z)||isNaN(ie)||isNaN(z)||isNaN(se))throw pr.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var ge=new c(O,V,Z,ie,z,se);this.ctx.transform=this.ctx.transform.multiply(ge)},m.prototype.setTransform=function(O,V,Z,ie,z,se){O=isNaN(O)?1:O,V=isNaN(V)?0:V,Z=isNaN(Z)?0:Z,ie=isNaN(ie)?1:ie,z=isNaN(z)?0:z,se=isNaN(se)?0:se,this.ctx.transform=new c(O,V,Z,ie,z,se)};var _=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};m.prototype.drawImage=function(O,V,Z,ie,z,se,ge,xe,Re){var De=this.pdf.getImageProperties(O),qe=1,Pe=1,Ke=1,ne=1;ie!==void 0&&xe!==void 0&&(Ke=xe/ie,ne=Re/z,qe=De.width/ie*xe/ie,Pe=De.height/z*Re/z),se===void 0&&(se=V,ge=Z,V=0,Z=0),ie!==void 0&&xe===void 0&&(xe=ie,Re=z),ie===void 0&&xe===void 0&&(xe=De.width,Re=De.height);var We=this.ctx.transform.decompose(),it=le(We.rotate.shx),tt=new c,Ve=(tt=(tt=(tt=tt.multiply(We.translate)).multiply(We.skew)).multiply(We.scale)).applyToRectangle(new u(se-V*Ke,ge-Z*ne,ie*qe,z*Pe));if(this.autoPaging){for(var gt,ut=N.call(this,Ve),Ot=[],Ct=0;Ct<ut.length;Ct+=1)Ot.indexOf(ut[Ct])===-1&&Ot.push(ut[Ct]);L(Ot);for(var en=Ot[0],tn=Ot[Ot.length-1],Bt=en;Bt<tn+1;Bt++){this.pdf.setPage(Bt);var pn=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],an=Bt===1?this.posY+this.margin[0]:this.margin[0],lt=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],kt=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Et=Bt===1?0:lt+(Bt-2)*kt;if(this.ctx.clip_path.length!==0){var gr=this.path;gt=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=j(gt,this.posX+this.margin[3],-Et+an+this.ctx.prevPageLastElemOffset),I.call(this,"fill",!0),this.path=gr}var fn=JSON.parse(JSON.stringify(Ve));fn=j([fn],this.posX+this.margin[3],-Et+an+this.ctx.prevPageLastElemOffset)[0];var Dt=(Bt>en||Bt<tn)&&_.call(this);Dt&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],pn,kt,null).clip().discardPath()),this.pdf.addImage(O,"JPEG",fn.x,fn.y,fn.w,fn.h,null,null,it),Dt&&this.pdf.restoreGraphicsState()}}else this.pdf.addImage(O,"JPEG",Ve.x,Ve.y,Ve.w,Ve.h,null,null,it)};var N=function(O,V,Z){var ie=[];V=V||this.pdf.internal.pageSize.width,Z=Z||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var z=this.posY+this.ctx.prevPageLastElemOffset;switch(O.type){default:case"mt":case"lt":ie.push(Math.floor((O.y+z)/Z)+1);break;case"arc":ie.push(Math.floor((O.y+z-O.radius)/Z)+1),ie.push(Math.floor((O.y+z+O.radius)/Z)+1);break;case"qct":var se=pe(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x,O.y);ie.push(Math.floor((se.y+z)/Z)+1),ie.push(Math.floor((se.y+se.h+z)/Z)+1);break;case"bct":var ge=Ne(this.ctx.lastPoint.x,this.ctx.lastPoint.y,O.x1,O.y1,O.x2,O.y2,O.x,O.y);ie.push(Math.floor((ge.y+z)/Z)+1),ie.push(Math.floor((ge.y+ge.h+z)/Z)+1);break;case"rect":ie.push(Math.floor((O.y+z)/Z)+1),ie.push(Math.floor((O.y+O.h+z)/Z)+1)}for(var xe=0;xe<ie.length;xe+=1)for(;this.pdf.internal.getNumberOfPages()<ie[xe];)A.call(this);return ie},A=function(){var O=this.fillStyle,V=this.strokeStyle,Z=this.font,ie=this.lineCap,z=this.lineWidth,se=this.lineJoin;this.pdf.addPage(),this.fillStyle=O,this.strokeStyle=V,this.font=Z,this.lineCap=ie,this.lineWidth=z,this.lineJoin=se},j=function(O,V,Z){for(var ie=0;ie<O.length;ie++)switch(O[ie].type){case"bct":O[ie].x2+=V,O[ie].y2+=Z;case"qct":O[ie].x1+=V,O[ie].y1+=Z;default:O[ie].x+=V,O[ie].y+=Z}return O},L=function(O){return O.sort(function(V,Z){return V-Z})},R=function(O,V){var Z=this.fillStyle,ie=this.strokeStyle,z=this.lineCap,se=this.lineWidth,ge=Math.abs(se*this.ctx.transform.scaleX),xe=this.lineJoin;if(this.autoPaging){for(var Re,De,qe=JSON.parse(JSON.stringify(this.path)),Pe=JSON.parse(JSON.stringify(this.path)),Ke=[],ne=0;ne<Pe.length;ne++)if(Pe[ne].x!==void 0)for(var We=N.call(this,Pe[ne]),it=0;it<We.length;it+=1)Ke.indexOf(We[it])===-1&&Ke.push(We[it]);for(var tt=0;tt<Ke.length;tt++)for(;this.pdf.internal.getNumberOfPages()<Ke[tt];)A.call(this);L(Ke);for(var Ve=Ke[0],gt=Ke[Ke.length-1],ut=Ve;ut<gt+1;ut++){this.pdf.setPage(ut),this.fillStyle=Z,this.strokeStyle=ie,this.lineCap=z,this.lineWidth=ge,this.lineJoin=xe;var Ot=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],Ct=ut===1?this.posY+this.margin[0]:this.margin[0],en=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],tn=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],Bt=ut===1?0:en+(ut-2)*tn;if(this.ctx.clip_path.length!==0){var pn=this.path;Re=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=j(Re,this.posX+this.margin[3],-Bt+Ct+this.ctx.prevPageLastElemOffset),I.call(this,O,!0),this.path=pn}if(De=JSON.parse(JSON.stringify(qe)),this.path=j(De,this.posX+this.margin[3],-Bt+Ct+this.ctx.prevPageLastElemOffset),V===!1||ut===0){var an=(ut>Ve||ut<gt)&&_.call(this);an&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Ot,tn,null).clip().discardPath()),I.call(this,O,V),an&&this.pdf.restoreGraphicsState()}this.lineWidth=se}this.path=qe}else this.lineWidth=ge,I.call(this,O,V),this.lineWidth=se},I=function(O,V){if((O!=="stroke"||V||!x.call(this))&&(O==="stroke"||V||!g.call(this))){for(var Z,ie,z=[],se=this.path,ge=0;ge<se.length;ge++){var xe=se[ge];switch(xe.type){case"begin":z.push({begin:!0});break;case"close":z.push({close:!0});break;case"mt":z.push({start:xe,deltas:[],abs:[]});break;case"lt":var Re=z.length;if(se[ge-1]&&!isNaN(se[ge-1].x)&&(Z=[xe.x-se[ge-1].x,xe.y-se[ge-1].y],Re>0)){for(;Re>=0;Re--)if(z[Re-1].close!==!0&&z[Re-1].begin!==!0){z[Re-1].deltas.push(Z),z[Re-1].abs.push(xe);break}}break;case"bct":Z=[xe.x1-se[ge-1].x,xe.y1-se[ge-1].y,xe.x2-se[ge-1].x,xe.y2-se[ge-1].y,xe.x-se[ge-1].x,xe.y-se[ge-1].y],z[z.length-1].deltas.push(Z);break;case"qct":var De=se[ge-1].x+2/3*(xe.x1-se[ge-1].x),qe=se[ge-1].y+2/3*(xe.y1-se[ge-1].y),Pe=xe.x+2/3*(xe.x1-xe.x),Ke=xe.y+2/3*(xe.y1-xe.y),ne=xe.x,We=xe.y;Z=[De-se[ge-1].x,qe-se[ge-1].y,Pe-se[ge-1].x,Ke-se[ge-1].y,ne-se[ge-1].x,We-se[ge-1].y],z[z.length-1].deltas.push(Z);break;case"arc":z.push({deltas:[],abs:[],arc:!0}),Array.isArray(z[z.length-1].abs)&&z[z.length-1].abs.push(xe)}}ie=V?null:O==="stroke"?"stroke":"fill";for(var it=!1,tt=0;tt<z.length;tt++)if(z[tt].arc)for(var Ve=z[tt].abs,gt=0;gt<Ve.length;gt++){var ut=Ve[gt];ut.type==="arc"?P.call(this,ut.x,ut.y,ut.radius,ut.startAngle,ut.endAngle,ut.counterclockwise,void 0,V,!it):K.call(this,ut.x,ut.y),it=!0}else if(z[tt].close===!0)this.pdf.internal.out("h"),it=!1;else if(z[tt].begin!==!0){var Ot=z[tt].start.x,Ct=z[tt].start.y;Y.call(this,z[tt].deltas,Ot,Ct),it=!0}ie&&B.call(this,ie),V&&X.call(this)}},ee=function(O){var V=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,Z=V*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return O-Z;case"top":return O+V-Z;case"hanging":return O+V-2*Z;case"middle":return O+V/2-Z;default:return O}},G=function(O){return O+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};m.prototype.createLinearGradient=function(){var O=function(){};return O.colorStops=[],O.addColorStop=function(V,Z){this.colorStops.push([V,Z])},O.getColor=function(){return this.colorStops.length===0?"#000000":this.colorStops[0][1]},O.isCanvasGradient=!0,O},m.prototype.createPattern=function(){return this.createLinearGradient()},m.prototype.createRadialGradient=function(){return this.createLinearGradient()};var P=function(O,V,Z,ie,z,se,ge,xe,Re){for(var De=te.call(this,Z,ie,z,se),qe=0;qe<De.length;qe++){var Pe=De[qe];qe===0&&(Re?F.call(this,Pe.x1+O,Pe.y1+V):K.call(this,Pe.x1+O,Pe.y1+V)),he.call(this,O,V,Pe.x2,Pe.y2,Pe.x3,Pe.y3,Pe.x4,Pe.y4)}xe?X.call(this):B.call(this,ge)},B=function(O){switch(O){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},X=function(){this.pdf.clip(),this.pdf.discardPath()},F=function(O,V){this.pdf.internal.out(n(O)+" "+r(V)+" m")},$=function(O){var V;switch(O.align){case"right":case"end":V="right";break;case"center":V="center";break;default:V="left"}var Z,ie,z,se=this.pdf.getTextDimensions(O.text),ge=ee.call(this,O.y),xe=G.call(this,ge)-se.h,Re=this.ctx.transform.applyToPoint(new l(O.x,ge));if(this.autoPaging){var De=this.ctx.transform.decompose(),qe=new c;qe=(qe=(qe=qe.multiply(De.translate)).multiply(De.skew)).multiply(De.scale);for(var Pe=this.ctx.transform.applyToRectangle(new u(O.x,ge,se.w,se.h)),Ke=qe.applyToRectangle(new u(O.x,xe,se.w,se.h)),ne=N.call(this,Ke),We=[],it=0;it<ne.length;it+=1)We.indexOf(ne[it])===-1&&We.push(ne[it]);L(We);for(var tt=We[0],Ve=We[We.length-1],gt=tt;gt<Ve+1;gt++){this.pdf.setPage(gt);var ut=gt===1?this.posY+this.margin[0]:this.margin[0],Ot=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],Ct=this.pdf.internal.pageSize.height-this.margin[2],en=Ct-this.margin[0],tn=this.pdf.internal.pageSize.width-this.margin[1],Bt=tn-this.margin[3],pn=gt===1?0:Ot+(gt-2)*en;if(this.ctx.clip_path.length!==0){var an=this.path;Z=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=j(Z,this.posX+this.margin[3],-1*pn+ut),I.call(this,"fill",!0),this.path=an}var lt=j([JSON.parse(JSON.stringify(Ke))],this.posX+this.margin[3],-pn+ut+this.ctx.prevPageLastElemOffset)[0];O.scale>=.01&&(ie=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ie*O.scale),z=this.lineWidth,this.lineWidth=z*O.scale);var kt=this.autoPaging!=="text";if(kt||lt.y+lt.h<=Ct){if(kt||lt.y>=ut&<.x<=tn){var Et=kt?O.text:this.pdf.splitTextToSize(O.text,O.maxWidth||tn-lt.x)[0],gr=j([JSON.parse(JSON.stringify(Pe))],this.posX+this.margin[3],-pn+ut+this.ctx.prevPageLastElemOffset)[0],fn=kt&&(gt>tt||gt<Ve)&&_.call(this);fn&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],Bt,en,null).clip().discardPath()),this.pdf.text(Et,gr.x,gr.y,{angle:O.angle,align:V,renderingMode:O.renderingMode}),fn&&this.pdf.restoreGraphicsState()}}else lt.y<Ct&&(this.ctx.prevPageLastElemOffset+=Ct-lt.y);O.scale>=.01&&(this.pdf.setFontSize(ie),this.lineWidth=z)}}else O.scale>=.01&&(ie=this.pdf.internal.getFontSize(),this.pdf.setFontSize(ie*O.scale),z=this.lineWidth,this.lineWidth=z*O.scale),this.pdf.text(O.text,Re.x+this.posX,Re.y+this.posY,{angle:O.angle,align:V,renderingMode:O.renderingMode,maxWidth:O.maxWidth}),O.scale>=.01&&(this.pdf.setFontSize(ie),this.lineWidth=z)},K=function(O,V,Z,ie){Z=Z||0,ie=ie||0,this.pdf.internal.out(n(O+Z)+" "+r(V+ie)+" l")},Y=function(O,V,Z){return this.pdf.lines(O,V,Z,null,null)},he=function(O,V,Z,ie,z,se,ge,xe){this.pdf.internal.out([e(a(Z+O)),e(s(ie+V)),e(a(z+O)),e(s(se+V)),e(a(ge+O)),e(s(xe+V)),"c"].join(" "))},te=function(O,V,Z,ie){for(var z=2*Math.PI,se=Math.PI/2;V>Z;)V-=z;var ge=Math.abs(Z-V);ge<z&&ie&&(ge=z-ge);for(var xe=[],Re=ie?-1:1,De=V;ge>1e-5;){var qe=De+Re*Math.min(ge,se);xe.push(oe.call(this,O,De,qe)),ge-=Math.abs(qe-De),De=qe}return xe},oe=function(O,V,Z){var ie=(Z-V)/2,z=O*Math.cos(ie),se=O*Math.sin(ie),ge=z,xe=-se,Re=ge*ge+xe*xe,De=Re+ge*z+xe*se,qe=4/3*(Math.sqrt(2*Re*De)-De)/(ge*se-xe*z),Pe=ge-qe*xe,Ke=xe+qe*ge,ne=Pe,We=-Ke,it=ie+V,tt=Math.cos(it),Ve=Math.sin(it);return{x1:O*Math.cos(V),y1:O*Math.sin(V),x2:Pe*tt-Ke*Ve,y2:Pe*Ve+Ke*tt,x3:ne*tt-We*Ve,y3:ne*Ve+We*tt,x4:O*Math.cos(Z),y4:O*Math.sin(Z)}},le=function(O){return 180*O/Math.PI},pe=function(O,V,Z,ie,z,se){var ge=O+.5*(Z-O),xe=V+.5*(ie-V),Re=z+.5*(Z-z),De=se+.5*(ie-se),qe=Math.min(O,z,ge,Re),Pe=Math.max(O,z,ge,Re),Ke=Math.min(V,se,xe,De),ne=Math.max(V,se,xe,De);return new u(qe,Ke,Pe-qe,ne-Ke)},Ne=function(O,V,Z,ie,z,se,ge,xe){var Re,De,qe,Pe,Ke,ne,We,it,tt,Ve,gt,ut,Ot,Ct,en=Z-O,tn=ie-V,Bt=z-Z,pn=se-ie,an=ge-z,lt=xe-se;for(De=0;De<41;De++)tt=(We=(qe=O+(Re=De/40)*en)+Re*((Ke=Z+Re*Bt)-qe))+Re*(Ke+Re*(z+Re*an-Ke)-We),Ve=(it=(Pe=V+Re*tn)+Re*((ne=ie+Re*pn)-Pe))+Re*(ne+Re*(se+Re*lt-ne)-it),De==0?(gt=tt,ut=Ve,Ot=tt,Ct=Ve):(gt=Math.min(gt,tt),ut=Math.min(ut,Ve),Ot=Math.max(Ot,tt),Ct=Math.max(Ct,Ve));return new u(Math.round(gt),Math.round(ut),Math.round(Ot-gt),Math.round(Ct-ut))},U=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var O,V,Z=(O=this.ctx.lineDash,V=this.ctx.lineDashOffset,JSON.stringify({lineDash:O,lineDashOffset:V}));this.prevLineDash!==Z&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=Z)}}})(jt.API),(function(t){var e=function(l){var u,c,h,d,m,y,g,x,_,N;for(c=[],h=0,d=(l+=u="\0\0\0\0".slice(l.length%4||4)).length;d>h;h+=4)(m=(l.charCodeAt(h)<<24)+(l.charCodeAt(h+1)<<16)+(l.charCodeAt(h+2)<<8)+l.charCodeAt(h+3))!==0?(y=(m=((m=((m=((m=(m-(N=m%85))/85)-(_=m%85))/85)-(x=m%85))/85)-(g=m%85))/85)%85,c.push(y+33,g+33,x+33,_+33,N+33)):c.push(122);return(function(A,j){for(var L=j;L>0;L--)A.pop()})(c,u.length),String.fromCharCode.apply(String,c)+"~>"},n=function(l){var u,c,h,d,m,y=String,g="length",x=255,_="charCodeAt",N="slice",A="replace";for(l[N](-2),l=l[N](0,-2)[A](/\s/g,"")[A]("z","!!!!!"),h=[],d=0,m=(l+=u="uuuuu"[N](l[g]%5||5))[g];m>d;d+=5)c=52200625*(l[_](d)-33)+614125*(l[_](d+1)-33)+7225*(l[_](d+2)-33)+85*(l[_](d+3)-33)+(l[_](d+4)-33),h.push(x&c>>24,x&c>>16,x&c>>8,x&c);return(function(j,L){for(var R=L;R>0;R--)j.pop()})(h,u[g]),y.fromCharCode.apply(y,h)},r=function(l){return l.split("").map(function(u){return("0"+u.charCodeAt().toString(16)).slice(-2)}).join("")+">"},a=function(l){var u=new RegExp(/^([0-9A-Fa-f]{2})+$/);if((l=l.replace(/\s/g,"")).indexOf(">")!==-1&&(l=l.substr(0,l.indexOf(">"))),l.length%2&&(l+="0"),u.test(l)===!1)return"";for(var c="",h=0;h<l.length;h+=2)c+=String.fromCharCode("0x"+(l[h]+l[h+1]));return c},s=function(l){for(var u=new Uint8Array(l.length),c=l.length;c--;)u[c]=l.charCodeAt(c);return(u=vy(u)).reduce(function(h,d){return h+String.fromCharCode(d)},"")};t.processDataByFilters=function(l,u){var c=0,h=l||"",d=[];for(typeof(u=u||[])=="string"&&(u=[u]),c=0;c<u.length;c+=1)switch(u[c]){case"ASCII85Decode":case"/ASCII85Decode":h=n(h),d.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":h=e(h),d.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":h=a(h),d.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":h=r(h),d.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":h=s(h),d.push("/FlateDecode");break;default:throw new Error('The filter: "'+u[c]+'" is not implemented')}return{data:h,reverseChain:d.reverse().join(" ")}}})(jt.API),(function(t){t.loadFile=function(e,n,r){return(function(a,s,l){s=s!==!1,l=typeof l=="function"?l:function(){};var u=void 0;try{u=(function(c,h,d){var m=new XMLHttpRequest,y=0,g=function(x){var _=x.length,N=[],A=String.fromCharCode;for(y=0;y<_;y+=1)N.push(A(255&x.charCodeAt(y)));return N.join("")};if(m.open("GET",c,!h),m.overrideMimeType("text/plain; charset=x-user-defined"),h===!1&&(m.onload=function(){m.status===200?d(g(this.responseText)):d(void 0)}),m.send(null),h&&m.status===200)return g(m.responseText)})(a,s,l)}catch{}return u})(e,n,r)},t.allowFsRead=void 0,t.loadImageFile=t.loadFile})(jt.API),(function(t){function e(){return(Qt.html2canvas?Promise.resolve(Qt.html2canvas):J1(()=>import("./html2canvas.esm-QH1iLAAe.js"),[])).catch(function(u){return Promise.reject(new Error("Could not load html2canvas: "+u))}).then(function(u){return u.default?u.default:u})}function n(){return(Qt.DOMPurify?Promise.resolve(Qt.DOMPurify):J1(()=>import("./purify.es-CPrKKeqe.js"),[])).catch(function(u){return Promise.reject(new Error("Could not load dompurify: "+u))}).then(function(u){return u.default?u.default:u})}var r=function(u){var c=In(u);return c==="undefined"?"undefined":c==="string"||u instanceof String?"string":c==="number"||u instanceof Number?"number":c==="function"||u instanceof Function?"function":u&&u.constructor===Array?"array":u&&u.nodeType===1?"element":c==="object"?"object":"unknown"},a=function(u,c){var h=document.createElement(u);for(var d in c.className&&(h.className=c.className),c.innerHTML&&c.dompurify&&(h.innerHTML=c.dompurify.sanitize(c.innerHTML)),c.style)h.style[d]=c.style[d];return h},s=function u(c,h){for(var d=c.nodeType===3?document.createTextNode(c.nodeValue):c.cloneNode(!1),m=c.firstChild;m;m=m.nextSibling)h!==!0&&m.nodeType===1&&m.nodeName==="SCRIPT"||d.appendChild(u(m,h));return c.nodeType===1&&(c.nodeName==="CANVAS"?(d.width=c.width,d.height=c.height,d.getContext("2d").drawImage(c,0,0)):c.nodeName!=="TEXTAREA"&&c.nodeName!=="SELECT"||(d.value=c.value),d.addEventListener("load",function(){d.scrollTop=c.scrollTop,d.scrollLeft=c.scrollLeft},!0)),d},l=function u(c){var h=Object.assign(u.convert(Promise.resolve()),JSON.parse(JSON.stringify(u.template))),d=u.convert(Promise.resolve(),h);return(d=d.setProgress(1,u,1,[u])).set(c)};(l.prototype=Object.create(Promise.prototype)).constructor=l,l.convert=function(u,c){return u.__proto__=c||l.prototype,u},l.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},l.prototype.from=function(u,c){return this.then(function(){switch(c=c||(function(h){switch(r(h)){case"string":return"string";case"element":return h.nodeName.toLowerCase()==="canvas"?"canvas":"element";default:return"unknown"}})(u),c){case"string":return this.then(n).then(function(h){return this.set({src:a("div",{innerHTML:u,dompurify:h})})});case"element":return this.set({src:u});case"canvas":return this.set({canvas:u});case"img":return this.set({img:u});default:return this.error("Unknown source type.")}})},l.prototype.to=function(u){switch(u){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},l.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then(function(){var u={position:"relative",display:"inline-block",width:(typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},c=s(this.prop.src,this.opt.html2canvas.javascriptEnabled);c.tagName==="BODY"&&(u.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=a("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=a("div",{className:"html2pdf__container",style:u}),this.prop.container.appendChild(c),this.prop.container.firstChild.appendChild(a("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"})},l.prototype.toCanvas=function(){var u=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(u).then(e).then(function(c){var h=Object.assign({},this.opt.html2canvas);return delete h.onrendered,c(this.prop.container,h)}).then(function(c){(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},l.prototype.toContext2d=function(){var u=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(u).then(e).then(function(c){var h=this.opt.jsPDF,d=this.opt.fontFaces,m=typeof this.opt.width!="number"||isNaN(this.opt.width)||typeof this.opt.windowWidth!="number"||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,y=Object.assign({async:!0,allowTaint:!0,scale:m,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete y.onrendered,h.context2d.autoPaging=this.opt.autoPaging===void 0||this.opt.autoPaging,h.context2d.posX=this.opt.x,h.context2d.posY=this.opt.y,h.context2d.margin=this.opt.margin,h.context2d.fontFaces=d,d)for(var g=0;g<d.length;++g){var x=d[g],_=x.src.find(function(N){return N.format==="truetype"});_&&h.addFont(_.url,x.ref.name,x.ref.style)}return y.windowHeight=y.windowHeight||0,y.windowHeight=y.windowHeight==0?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):y.windowHeight,h.context2d.save(!0),c(this.prop.container,y)}).then(function(c){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(c),this.prop.canvas=c,document.body.removeChild(this.prop.overlay)})},l.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then(function(){var u=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=u})},l.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then(function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF})},l.prototype.output=function(u,c,h){return(h=h||"pdf").toLowerCase()==="img"||h.toLowerCase()==="image"?this.outputImg(u,c):this.outputPdf(u,c)},l.prototype.outputPdf=function(u,c){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){return this.prop.pdf.output(u,c)})},l.prototype.outputImg=function(u){return this.thenList([function(){return this.prop.img||this.toImg()}]).then(function(){switch(u){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+u+'" is not supported.'}})},l.prototype.save=function(u){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(u?{filename:u}:null).then(function(){this.prop.pdf.save(this.opt.filename)})},l.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then(function(){this.prop.callback(this.prop.pdf)})},l.prototype.set=function(u){if(r(u)!=="object")return this;var c=Object.keys(u||{}).map(function(h){if(h in l.template.prop)return function(){this.prop[h]=u[h]};switch(h){case"margin":return this.setMargin.bind(this,u.margin);case"jsPDF":return function(){return this.opt.jsPDF=u.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,u.pageSize);default:return function(){this.opt[h]=u[h]}}},this);return this.then(function(){return this.thenList(c)})},l.prototype.get=function(u,c){return this.then(function(){var h=u in l.template.prop?this.prop[u]:this.opt[u];return c?c(h):h})},l.prototype.setMargin=function(u){return this.then(function(){switch(r(u)){case"number":u=[u,u,u,u];case"array":if(u.length===2&&(u=[u[0],u[1],u[0],u[1]]),u.length===4)break;default:return this.error("Invalid margin array.")}this.opt.margin=u}).then(this.setPageSize)},l.prototype.setPageSize=function(u){function c(h,d){return Math.floor(h*d/72*96)}return this.then(function(){(u=u||jt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(u.inner={width:u.width-this.opt.margin[1]-this.opt.margin[3],height:u.height-this.opt.margin[0]-this.opt.margin[2]},u.inner.px={width:c(u.inner.width,u.k),height:c(u.inner.height,u.k)},u.inner.ratio=u.inner.height/u.inner.width),this.prop.pageSize=u})},l.prototype.setProgress=function(u,c,h,d){return u!=null&&(this.progress.val=u),c!=null&&(this.progress.state=c),h!=null&&(this.progress.n=h),d!=null&&(this.progress.stack=d),this.progress.ratio=this.progress.val/this.progress.state,this},l.prototype.updateProgress=function(u,c,h,d){return this.setProgress(u?this.progress.val+u:null,c||null,h?this.progress.n+h:null,d?this.progress.stack.concat(d):null)},l.prototype.then=function(u,c){var h=this;return this.thenCore(u,c,function(d,m){return h.updateProgress(null,null,1,[d]),Promise.prototype.then.call(this,function(y){return h.updateProgress(null,d),y}).then(d,m).then(function(y){return h.updateProgress(1),y})})},l.prototype.thenCore=function(u,c,h){h=h||Promise.prototype.then;var d=this;u&&(u=u.bind(d)),c&&(c=c.bind(d));var m=Promise.toString().indexOf("[native code]")!==-1&&Promise.name==="Promise"?d:l.convert(Object.assign({},d),Promise.prototype),y=h.call(m,u,c);return l.convert(y,d.__proto__)},l.prototype.thenExternal=function(u,c){return Promise.prototype.then.call(this,u,c)},l.prototype.thenList=function(u){var c=this;return u.forEach(function(h){c=c.thenCore(h)}),c},l.prototype.catch=function(u){u&&(u=u.bind(this));var c=Promise.prototype.catch.call(this,u);return l.convert(c,this)},l.prototype.catchExternal=function(u){return Promise.prototype.catch.call(this,u)},l.prototype.error=function(u){return this.then(function(){throw new Error(u)})},l.prototype.using=l.prototype.set,l.prototype.saveAs=l.prototype.save,l.prototype.export=l.prototype.output,l.prototype.run=l.prototype.then,jt.getPageSize=function(u,c,h){if(In(u)==="object"){var d=u;u=d.orientation,c=d.unit||c,h=d.format||h}c=c||"mm",h=h||"a4",u=(""+(u||"P")).toLowerCase();var m,y=(""+h).toLowerCase(),g={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(c){case"pt":m=1;break;case"mm":m=72/25.4;break;case"cm":m=72/2.54;break;case"in":m=72;break;case"px":m=.75;break;case"pc":case"em":m=12;break;case"ex":m=6;break;default:throw"Invalid unit: "+c}var x,_=0,N=0;if(g.hasOwnProperty(y))_=g[y][1]/m,N=g[y][0]/m;else try{_=h[1],N=h[0]}catch{throw new Error("Invalid format: "+h)}if(u==="p"||u==="portrait")u="p",N>_&&(x=N,N=_,_=x);else{if(u!=="l"&&u!=="landscape")throw"Invalid orientation: "+u;u="l",_>N&&(x=N,N=_,_=x)}return{width:N,height:_,unit:c,k:m,orientation:u}},t.html=function(u,c){(c=c||{}).callback=c.callback||function(){},c.html2canvas=c.html2canvas||{},c.html2canvas.canvas=c.html2canvas.canvas||this.canvas,c.jsPDF=c.jsPDF||this,c.fontFaces=c.fontFaces?c.fontFaces.map(pv):null;var h=new l(c);return c.worker?h:h.from(u).doCallback()}})(jt.API),jt.API.addJS=function(t){var e,n,r=(function(a){for(var s="",l=0;l<a.length;l++){var u=a[l];if(u==="("||u===")"){for(var c=0,h=l-1;h>=0&&a[h]==="\\";h--)c++;s+=c%2==0?"\\"+u:u}else s+=u}return s})(t);return this.internal.events.subscribe("postPutResources",function(){e=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(e+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),n=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+r+")"),this.internal.out(">>"),this.internal.out("endobj")}),this.internal.events.subscribe("putCatalog",function(){e!==void 0&&n!==void 0&&this.internal.out("/Names <</JavaScript "+e+" 0 R>>")}),this},(function(t){var e;t.events.push(["postPutResources",function(){var n=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var a=n.outline.render().split(/\r\n/),s=0;s<a.length;s++){var l=a[s],u=r.exec(l);if(u!=null){var c=u[1];n.internal.newObjectDeferredBegin(c,!1)}n.internal.write(l)}if(this.outline.createNamedDestinations){var h=this.internal.pages.length,d=[];for(s=0;s<h;s++){var m=n.internal.newObject();d.push(m);var y=n.internal.getPageInfo(s+1);n.internal.write("<< /D["+y.objId+" 0 R /XYZ null null null]>> endobj")}var g=n.internal.newObject();for(n.internal.write("<< /Names [ "),s=0;s<d.length;s++)n.internal.write("(page_"+(s+1)+")"+d[s]+" 0 R");n.internal.write(" ] >>","endobj"),e=n.internal.newObject(),n.internal.write("<< /Dests "+g+" 0 R"),n.internal.write(">>","endobj")}}]),t.events.push(["putCatalog",function(){var n=this;n.outline.root.children.length>0&&(n.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&n.internal.write("/Names "+e+" 0 R"))}]),t.events.push(["initialized",function(){var n=this;n.outline={createNamedDestinations:!1,root:{children:[]}},n.outline.add=function(r,a,s){var l={title:a,options:s,children:[]};return r==null&&(r=this.root),r.children.push(l),l},n.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=n,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},n.outline.genIds_r=function(r){r.id=n.internal.newObjectDeferred();for(var a=0;a<r.children.length;a++)this.genIds_r(r.children[a])},n.outline.renderRoot=function(r){this.objStart(r),this.line("/Type /Outlines"),r.children.length>0&&(this.line("/First "+this.makeRef(r.children[0])),this.line("/Last "+this.makeRef(r.children[r.children.length-1]))),this.line("/Count "+this.count_r({count:0},r)),this.objEnd()},n.outline.renderItems=function(r){for(var a=this.ctx.pdf.internal.getVerticalCoordinateString,s=0;s<r.children.length;s++){var l=r.children[s];this.objStart(l),this.line("/Title "+this.makeString(l.title)),this.line("/Parent "+this.makeRef(r)),s>0&&this.line("/Prev "+this.makeRef(r.children[s-1])),s<r.children.length-1&&this.line("/Next "+this.makeRef(r.children[s+1])),l.children.length>0&&(this.line("/First "+this.makeRef(l.children[0])),this.line("/Last "+this.makeRef(l.children[l.children.length-1])));var u=this.count=this.count_r({count:0},l);if(u>0&&this.line("/Count "+u),l.options&&l.options.pageNumber){var c=n.internal.getPageInfo(l.options.pageNumber);this.line("/Dest ["+c.objId+" 0 R /XYZ 0 "+a(0)+" 0]")}this.objEnd()}for(var h=0;h<r.children.length;h++)this.renderItems(r.children[h])},n.outline.line=function(r){this.ctx.val+=r+`\r
|
|
1131
|
+
`},n.outline.makeRef=function(r){return r.id+" 0 R"},n.outline.makeString=function(r){return"("+n.internal.pdfEscape(r)+")"},n.outline.objStart=function(r){this.ctx.val+=`\r
|
|
1132
|
+
`+r.id+` 0 obj\r
|
|
1133
|
+
<<\r
|
|
1134
|
+
`},n.outline.objEnd=function(){this.ctx.val+=`>> \r
|
|
1135
|
+
endobj\r
|
|
1136
|
+
`},n.outline.count_r=function(r,a){for(var s=0;s<a.children.length;s++)r.count++,this.count_r(r,a.children[s]);return r.count}}])})(jt.API),(function(t){var e=[192,193,194,195,196,197,198,199];t.processJPEG=function(n,r,a,s,l,u){var c,h=this.decode.DCT_DECODE,d=null;if(typeof n=="string"||this.__addimage__.isArrayBuffer(n)||this.__addimage__.isArrayBufferView(n)){switch(n=l||n,n=this.__addimage__.isArrayBuffer(n)?new Uint8Array(n):n,c=(function(m){for(var y,g=256*m.charCodeAt(4)+m.charCodeAt(5),x=m.length,_={width:0,height:0,numcomponents:1},N=4;N<x;N+=2){if(N+=g,e.indexOf(m.charCodeAt(N+1))!==-1){y=256*m.charCodeAt(N+5)+m.charCodeAt(N+6),_={width:256*m.charCodeAt(N+7)+m.charCodeAt(N+8),height:y,numcomponents:m.charCodeAt(N+9)};break}g=256*m.charCodeAt(N+2)+m.charCodeAt(N+3)}return _})(n=this.__addimage__.isArrayBufferView(n)?this.__addimage__.arrayBufferToBinaryString(n):n),c.numcomponents){case 1:u=this.color_spaces.DEVICE_GRAY;break;case 4:u=this.color_spaces.DEVICE_CMYK;break;case 3:u=this.color_spaces.DEVICE_RGB}d={data:n,width:c.width,height:c.height,colorSpace:u,bitsPerComponent:8,filter:h,index:r,alias:a}}return d}})(jt.API),jt.API.processPNG=function(t,e,n,r){if(this.__addimage__.isArrayBuffer(t)&&(t=new Uint8Array(t)),this.__addimage__.isArrayBufferView(t)){var a,s=W$(t,{checkCrc:!0}),l=s.width,u=s.height,c=s.channels,h=s.palette,d=s.depth;a=h&&c===1?(function(P){for(var B=P.width,X=P.height,F=P.data,$=P.palette,K=P.depth,Y=!1,he=[],te=[],oe=void 0,le=!1,pe=0,Ne=0;Ne<$.length;Ne++){var U=Qs($[Ne],4),O=U[0],V=U[1],Z=U[2],ie=U[3];he.push(O,V,Z),ie!=null&&(ie===0?(pe++,te.length<1&&te.push(Ne)):ie<255&&(le=!0))}if(le||pe>1){Y=!0,te=void 0;var z=B*X;oe=new Uint8Array(z);for(var se=new DataView(F.buffer),ge=0;ge<z;ge++){var xe=gv(se,ge,K),Re=Qs($[xe],4)[3];oe[ge]=Re}}else pe===0&&(te=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:Y?8:void 0,colorBytes:F,alphaBytes:oe,needSMask:Y,palette:he,mask:te}})(s):c===2||c===4?(function(P){for(var B=P.data,X=P.width,F=P.height,$=P.channels,K=P.depth,Y=$===2?"DeviceGray":"DeviceRGB",he=$-1,te=X*F,oe=he,le=te*oe,pe=1*te,Ne=Math.ceil(le*K/8),U=Math.ceil(pe*K/8),O=new Uint8Array(Ne),V=new Uint8Array(U),Z=new DataView(B.buffer),ie=new DataView(O.buffer),z=new DataView(V.buffer),se=!1,ge=0;ge<te;ge++){for(var xe=ge*$,Re=0;Re<oe;Re++)F_(ie,gv(Z,xe+Re,K),ge*oe+Re,K);var De=gv(Z,xe+oe,K);De<(1<<K)-1&&(se=!0),F_(z,De,1*ge,K)}return{colorSpace:Y,colorsPerPixel:he,sMaskBitsPerComponent:se?K:void 0,colorBytes:O,alphaBytes:V,needSMask:se}})(s):(function(P){var B=P.data,X=P.channels===1?"DeviceGray":"DeviceRGB";return{colorSpace:X,colorsPerPixel:X==="DeviceGray"?1:3,colorBytes:B instanceof Uint16Array?(function(F){for(var $=F.length,K=new Uint8Array(2*$),Y=new DataView(K.buffer,K.byteOffset,K.byteLength),he=0;he<$;he++)Y.setUint16(2*he,F[he],!1);return K})(B):B,needSMask:!1}})(s);var m,y,g,x=a,_=x.colorSpace,N=x.colorsPerPixel,A=x.sMaskBitsPerComponent,j=x.colorBytes,L=x.alphaBytes,R=x.needSMask,I=x.palette,ee=x.mask,G=null;return r!==jt.API.image_compression.NONE&&typeof vy=="function"?(G=(function(P){var B;switch(P){case jt.API.image_compression.FAST:B=11;break;case jt.API.image_compression.MEDIUM:B=13;break;case jt.API.image_compression.SLOW:B=14;break;default:B=12}return B})(r),m=this.decode.FLATE_DECODE,y="/Predictor ".concat(G," /Colors ").concat(N," /BitsPerComponent ").concat(d," /Columns ").concat(l),t=k_(j,Math.ceil(l*N*d/8),N,d,r),R&&(g=k_(L,Math.ceil(l*A/8),1,A,r))):(m=void 0,y=void 0,t=j,R&&(g=L)),(this.__addimage__.isArrayBuffer(t)||this.__addimage__.isArrayBufferView(t))&&(t=this.__addimage__.arrayBufferToBinaryString(t)),(g&&this.__addimage__.isArrayBuffer(g)||this.__addimage__.isArrayBufferView(g))&&(g=this.__addimage__.arrayBufferToBinaryString(g)),{alias:n,data:t,index:e,filter:m,decodeParameters:y,transparency:ee,palette:I,sMask:g,predictor:G,width:l,height:u,bitsPerComponent:d,sMaskBitsPerComponent:A,colorSpace:_}}},(function(t){t.processGIF89A=function(e,n,r,a){var s=new pz(e),l=s.width,u=s.height,c=[];s.decodeAndBlitFrameRGBA(0,c);var h={data:c,width:l,height:u},d=new vv(100).encode(h,100);return t.processJPEG.call(this,d,n,r,a)},t.processGIF87A=t.processGIF89A})(jt.API),Ys.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.bitPP===16&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var t=this.colors===0?1<<this.bitPP:this.colors;this.palette=new Array(t);for(var e=0;e<t;e++){var n=this.datav.getUint8(this.pos++,!0),r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0);this.palette[e]={red:a,green:r,blue:n,quad:s}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},Ys.prototype.parseBGR=function(){this.pos=this.offset;var t="bit"+this.bitPP,e=this.width*this.height*4;if(e>536870912)throw new Error("Image dimensions exceed 512MB, which is too large.");this.data=new Uint8Array(e);try{this[t]()}catch(n){pr.log("bit decode error:"+n)}},Ys.prototype.bit1=function(){var t,e=Math.ceil(this.width/8),n=e%4;for(t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,a=0;a<e;a++)for(var s=this.datav.getUint8(this.pos++,!0),l=r*this.width*4+8*a*4,u=0;u<8&&8*a+u<this.width;u++){var c=this.palette[s>>7-u&1];this.data[l+4*u]=c.blue,this.data[l+4*u+1]=c.green,this.data[l+4*u+2]=c.red,this.data[l+4*u+3]=255}n!==0&&(this.pos+=4-n)}},Ys.prototype.bit4=function(){for(var t=Math.ceil(this.width/2),e=t%4,n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,a=0;a<t;a++){var s=this.datav.getUint8(this.pos++,!0),l=r*this.width*4+2*a*4,u=s>>4,c=15&s,h=this.palette[u];if(this.data[l]=h.blue,this.data[l+1]=h.green,this.data[l+2]=h.red,this.data[l+3]=255,2*a+1>=this.width)break;h=this.palette[c],this.data[l+4]=h.blue,this.data[l+4+1]=h.green,this.data[l+4+2]=h.red,this.data[l+4+3]=255}e!==0&&(this.pos+=4-e)}},Ys.prototype.bit8=function(){for(var t=this.width%4,e=this.height-1;e>=0;e--){for(var n=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var a=this.datav.getUint8(this.pos++,!0),s=n*this.width*4+4*r;if(a<this.palette.length){var l=this.palette[a];this.data[s]=l.red,this.data[s+1]=l.green,this.data[s+2]=l.blue,this.data[s+3]=255}else this.data[s]=255,this.data[s+1]=255,this.data[s+2]=255,this.data[s+3]=255}t!==0&&(this.pos+=4-t)}},Ys.prototype.bit15=function(){for(var t=this.width%3,e=parseInt("11111",2),n=this.height-1;n>=0;n--){for(var r=this.bottom_up?n:this.height-1-n,a=0;a<this.width;a++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var l=(s&e)/e*255|0,u=(s>>5&e)/e*255|0,c=(s>>10&e)/e*255|0,h=s>>15?255:0,d=r*this.width*4+4*a;this.data[d]=c,this.data[d+1]=u,this.data[d+2]=l,this.data[d+3]=h}this.pos+=t}},Ys.prototype.bit16=function(){for(var t=this.width%3,e=parseInt("11111",2),n=parseInt("111111",2),r=this.height-1;r>=0;r--){for(var a=this.bottom_up?r:this.height-1-r,s=0;s<this.width;s++){var l=this.datav.getUint16(this.pos,!0);this.pos+=2;var u=(l&e)/e*255|0,c=(l>>5&n)/n*255|0,h=(l>>11)/e*255|0,d=a*this.width*4+4*s;this.data[d]=h,this.data[d+1]=c,this.data[d+2]=u,this.data[d+3]=255}this.pos+=t}},Ys.prototype.bit24=function(){for(var t=this.height-1;t>=0;t--){for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),l=e*this.width*4+4*n;this.data[l]=s,this.data[l+1]=a,this.data[l+2]=r,this.data[l+3]=255}this.pos+=this.width%4}},Ys.prototype.bit32=function(){for(var t=this.height-1;t>=0;t--)for(var e=this.bottom_up?t:this.height-1-t,n=0;n<this.width;n++){var r=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),l=this.datav.getUint8(this.pos++,!0),u=e*this.width*4+4*n;this.data[u]=s,this.data[u+1]=a,this.data[u+2]=r,this.data[u+3]=l}},Ys.prototype.getData=function(){return this.data},(function(t){t.processBMP=function(e,n,r,a){var s=new Ys(e,!1),l=s.width,u=s.height,c={data:s.getData(),width:l,height:u},h=new vv(100).encode(c,100);return t.processJPEG.call(this,h,n,r,a)}})(jt.API),B_.prototype.getData=function(){return this.data},(function(t){t.processWEBP=function(e,n,r,a){var s=new B_(e),l=s.width,u=s.height,c={data:s.getData(),width:l,height:u},h=new vv(100).encode(c,100);return t.processJPEG.call(this,h,n,r,a)}})(jt.API),jt.API.processRGBA=function(t,e,n){for(var r=t.data,a=r.length,s=new Uint8Array(a/4*3),l=new Uint8Array(a/4),u=0,c=0,h=0;h<a;h+=4){var d=r[h],m=r[h+1],y=r[h+2],g=r[h+3];s[u++]=d,s[u++]=m,s[u++]=y,l[c++]=g}var x=this.__addimage__.arrayBufferToBinaryString(s);return{alpha:this.__addimage__.arrayBufferToBinaryString(l),data:x,index:e,alias:n,colorSpace:"DeviceRGB",bitsPerComponent:8,width:t.width,height:t.height}},jt.API.setLanguage=function(t){return this.internal.languageSettings===void 0&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),{af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[t]!==void 0&&(this.internal.languageSettings.languageCode=t,this.internal.languageSettings.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")}),this.internal.languageSettings.isSubscribed=!0)),this},vf=jt.API,gm=vf.getCharWidthsArray=function(t,e){var n,r,a=(e=e||{}).font||this.internal.getFont(),s=e.fontSize||this.internal.getFontSize(),l=e.charSpace||this.internal.getCharSpace(),u=e.widths?e.widths:a.metadata.Unicode.widths,c=u.fof?u.fof:1,h=e.kerning?e.kerning:a.metadata.Unicode.kerning,d=h.fof?h.fof:1,m=e.doKerning!==!1,y=0,g=t.length,x=0,_=u[0]||c,N=[];for(n=0;n<g;n++)r=t.charCodeAt(n),typeof a.metadata.widthOfString=="function"?N.push((a.metadata.widthOfGlyph(a.metadata.characterToGlyph(r))+l*(1e3/s)||0)/1e3):(y=m&&In(h[r])==="object"&&!isNaN(parseInt(h[r][x],10))?h[r][x]/d:0,N.push((u[r]||_)/c+y)),x=r;return N},j_=vf.getStringUnitWidth=function(t,e){var n=(e=e||{}).fontSize||this.internal.getFontSize(),r=e.font||this.internal.getFont(),a=e.charSpace||this.internal.getCharSpace();return vf.processArabic&&(t=vf.processArabic(t)),typeof r.metadata.widthOfString=="function"?r.metadata.widthOfString(t,n,a)/n:gm.apply(this,arguments).reduce(function(s,l){return s+l},0)},O_=function(t,e,n,r){for(var a=[],s=0,l=t.length,u=0;s!==l&&u+e[s]<n;)u+=e[s],s++;a.push(t.slice(0,s));var c=s;for(u=0;s!==l;)u+e[s]>r&&(a.push(t.slice(c,s)),u=0,c=s),u+=e[s],s++;return c!==s&&a.push(t.slice(c,s)),a},R_=function(t,e,n){n||(n={});var r,a,s,l,u,c,h,d=[],m=[d],y=n.textIndent||0,g=0,x=0,_=t.split(" "),N=gm.apply(this,[" ",n])[0];if(c=n.lineIndent===-1?_[0].length+2:n.lineIndent||0){var A=Array(c).join(" "),j=[];_.map(function(R){(R=R.split(/\s*\n/)).length>1?j=j.concat(R.map(function(I,ee){return(ee&&I.length?`
|
|
1137
|
+
`:"")+I})):j.push(R[0])}),_=j,c=j_.apply(this,[A,n])}for(s=0,l=_.length;s<l;s++){var L=0;if(r=_[s],c&&r[0]==`
|
|
1138
|
+
`&&(r=r.substr(1),L=1),y+g+(x=(a=gm.apply(this,[r,n])).reduce(function(R,I){return R+I},0))>e||L){if(x>e){for(u=O_.apply(this,[r,a,e-(y+g),e]),d.push(u.shift()),d=[u.pop()];u.length;)m.push([u.shift()]);x=a.slice(r.length-(d[0]?d[0].length:0)).reduce(function(R,I){return R+I},0)}else d=[r];m.push(d),y=x+c,g=N}else d.push(r),y+=g+x,g=N}return h=c?function(R,I){return(I?A:"")+R.join(" ")}:function(R){return R.join(" ")},m.map(h)},vf.splitTextToSize=function(t,e,n){var r,a=(n=n||{}).fontSize||this.internal.getFontSize(),s=(function(d){if(d.widths&&d.kerning)return{widths:d.widths,kerning:d.kerning};var m=this.internal.getFont(d.fontName,d.fontStyle),y="Unicode";return m.metadata[y]?{widths:m.metadata[y].widths||{0:1},kerning:m.metadata[y].kerning||{}}:{font:m.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}).call(this,n);r=Array.isArray(t)?t:String(t).split(/\r?\n/);var l=1*this.internal.scaleFactor*e/a;s.textIndent=n.textIndent?1*n.textIndent*this.internal.scaleFactor/a:0,s.lineIndent=n.lineIndent;var u,c,h=[];for(u=0,c=r.length;u<c;u++)h=h.concat(R_.apply(this,[r[u],l,s]));return h},(function(t){t.__fontmetrics__=t.__fontmetrics__||{};for(var e="0123456789abcdef",n="klmnopqrstuvwxyz",r={},a={},s=0;s<16;s++)r[n[s]]=e[s],a[e[s]]=n[s];var l=function(y){return"0x"+parseInt(y,10).toString(16)},u=t.__fontmetrics__.compress=function(y){var g,x,_,N,A=["{"];for(var j in y){if(g=y[j],isNaN(parseInt(j,10))?x="'"+j+"'":(j=parseInt(j,10),x=(x=l(j).slice(2)).slice(0,-1)+a[x.slice(-1)]),typeof g=="number")g<0?(_=l(g).slice(3),N="-"):(_=l(g).slice(2),N=""),_=N+_.slice(0,-1)+a[_.slice(-1)];else{if(In(g)!=="object")throw new Error("Don't know what to do with value type "+In(g)+".");_=u(g)}A.push(x+_)}return A.push("}"),A.join("")},c=t.__fontmetrics__.uncompress=function(y){if(typeof y!="string")throw new Error("Invalid argument passed to uncompress.");for(var g,x,_,N,A={},j=1,L=A,R=[],I="",ee="",G=y.length-1,P=1;P<G;P+=1)(N=y[P])=="'"?g?(_=g.join(""),g=void 0):g=[]:g?g.push(N):N=="{"?(R.push([L,_]),L={},_=void 0):N=="}"?((x=R.pop())[0][x[1]]=L,_=void 0,L=x[0]):N=="-"?j=-1:_===void 0?r.hasOwnProperty(N)?(I+=r[N],_=parseInt(I,16)*j,j=1,I=""):I+=N:r.hasOwnProperty(N)?(ee+=r[N],L[_]=parseInt(ee,16)*j,j=1,_=void 0,ee=""):ee+=N;return A},h={codePages:["WinAnsiEncoding"],WinAnsiEncoding:c("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},d={Unicode:{Courier:h,"Courier-Bold":h,"Courier-BoldOblique":h,"Courier-Oblique":h,Helvetica:h,"Helvetica-Bold":h,"Helvetica-BoldOblique":h,"Helvetica-Oblique":h,"Times-Roman":h,"Times-Bold":h,"Times-BoldItalic":h,"Times-Italic":h}},m={Unicode:{"Courier-Oblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":c("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":c("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:c("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":c("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:c("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":c("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":c("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":c("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":c("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};t.events.push(["addFont",function(y){var g=y.font,x=m.Unicode[g.postScriptName];x&&(g.metadata.Unicode={},g.metadata.Unicode.widths=x.widths,g.metadata.Unicode.kerning=x.kerning);var _=d.Unicode[g.postScriptName];_&&(g.metadata.Unicode.encoding=_,g.encoding=_.codePages[0])}])})(jt.API),(function(t){var e=function(n){for(var r=n.length,a=new Uint8Array(r),s=0;s<r;s++)a[s]=n.charCodeAt(s);return a};t.API.events.push(["addFont",function(n){var r=void 0,a=n.font,s=n.instance;if(!a.isStandardFont){if(s===void 0)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");if(typeof(r=s.existsFileInVFS(a.postScriptName)===!1?s.loadFile(a.postScriptName):s.getFileFromVFS(a.postScriptName))!="string")throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+a.postScriptName+"').");(function(l,u){u=/^\x00\x01\x00\x00/.test(u)?e(u):e(Lm(u)),l.metadata=t.API.TTFFont.open(u),l.metadata.Unicode=l.metadata.Unicode||{encoding:{},kerning:{},widths:[]},l.metadata.glyIdsUsed=[0]})(a,r)}}])})(jt),jt.API.addSvgAsImage=function(t,e,n,r,a,s,l,u){if(isNaN(e)||isNaN(n))throw pr.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(a))throw pr.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var c=document.createElement("canvas");c.width=r,c.height=a;var h=c.getContext("2d");h.fillStyle="#fff",h.fillRect(0,0,c.width,c.height);var d={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},m=this;return(Qt.canvg?Promise.resolve(Qt.canvg):J1(()=>import("./index.es-Bwf93iys.js"),[])).catch(function(y){return Promise.reject(new Error("Could not load canvg: "+y))}).then(function(y){return y.default?y.default:y}).then(function(y){return y.fromString(h,t,d)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(y){return y.render(d)}).then(function(){m.addImage(c.toDataURL("image/jpeg",1),e,n,r,a,l,u)})},jt.API.putTotalPages=function(t){var e,n=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(e=new RegExp(t,"g"),n=this.internal.getNumberOfPages()):(e=new RegExp(this.pdfEscape16(t,this.internal.getFont()),"g"),n=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var a=0;a<this.internal.pages[r].length;a++)this.internal.pages[r][a]=this.internal.pages[r][a].replace(e,n);return this},jt.API.viewerPreferences=function(t,e){var n;t=t||{},e=e||!1;var r,a,s,l={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},u=Object.keys(l),c=[],h=0,d=0,m=0;function y(x,_){var N,A=!1;for(N=0;N<x.length;N+=1)x[N]===_&&(A=!0);return A}if(this.internal.viewerpreferences===void 0&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(l)),this.internal.viewerpreferences.isSubscribed=!1),n=this.internal.viewerpreferences.configuration,t==="reset"||e===!0){var g=u.length;for(m=0;m<g;m+=1)n[u[m]].value=n[u[m]].defaultValue,n[u[m]].explicitSet=!1}if(In(t)==="object"){for(a in t)if(s=t[a],y(u,a)&&s!==void 0){if(n[a].type==="boolean"&&typeof s=="boolean")n[a].value=s;else if(n[a].type==="name"&&y(n[a].valueSet,s))n[a].value=s;else if(n[a].type==="integer"&&Number.isInteger(s))n[a].value=s;else if(n[a].type==="array"){for(h=0;h<s.length;h+=1)if(r=!0,s[h].length===1&&typeof s[h][0]=="number")c.push(String(s[h]-1));else if(s[h].length>1){for(d=0;d<s[h].length;d+=1)typeof s[h][d]!="number"&&(r=!1);r===!0&&c.push([s[h][0]-1,s[h][1]-1].join(" "))}n[a].value="["+c.join(" ")+"]"}else n[a].value=n[a].defaultValue;n[a].explicitSet=!0}}return this.internal.viewerpreferences.isSubscribed===!1&&(this.internal.events.subscribe("putCatalog",function(){var x,_=[];for(x in n)n[x].explicitSet===!0&&(n[x].type==="name"?_.push("/"+x+" /"+n[x].value):_.push("/"+x+" "+n[x].value));_.length!==0&&this.internal.write(`/ViewerPreferences
|
|
1139
|
+
<<
|
|
1140
|
+
`+_.join(`
|
|
1141
|
+
`)+`
|
|
1142
|
+
>>`)}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=n,this},jt.API.addMetadata=function(t,e){return this.internal.__metadata__===void 0&&(this.internal.__metadata__={metadata:t,namespaceUri:e??"http://jspdf.default.namespaceuri/",rawXml:typeof e=="boolean"&&e},this.internal.events.subscribe("putCatalog",gz),this.internal.events.subscribe("postPutResources",mz)),this},(function(t){var e=t.API,n=e.pdfEscape16=function(s,l){for(var u,c=l.metadata.Unicode.widths,h=["","0","00","000","0000"],d=[""],m=0,y=s.length;m<y;++m){if(u=l.metadata.characterToGlyph(s.charCodeAt(m)),l.metadata.glyIdsUsed.push(u),l.metadata.toUnicode[u]=s.charCodeAt(m),c.indexOf(u)==-1&&(c.push(u),c.push([parseInt(l.metadata.widthOfGlyph(u),10)])),u=="0")return d.join("");u=u.toString(16),d.push(h[4-u.length],u)}return d.join("")},r=function(s){var l,u,c,h,d,m,y;for(d=`/CIDInit /ProcSet findresource begin
|
|
1143
|
+
12 dict begin
|
|
1144
|
+
begincmap
|
|
1145
|
+
/CIDSystemInfo <<
|
|
1146
|
+
/Registry (Adobe)
|
|
1147
|
+
/Ordering (UCS)
|
|
1148
|
+
/Supplement 0
|
|
1149
|
+
>> def
|
|
1150
|
+
/CMapName /Adobe-Identity-UCS def
|
|
1151
|
+
/CMapType 2 def
|
|
1152
|
+
1 begincodespacerange
|
|
1153
|
+
<0000><ffff>
|
|
1154
|
+
endcodespacerange`,c=[],m=0,y=(u=Object.keys(s).sort(function(g,x){return g-x})).length;m<y;m++)l=u[m],c.length>=100&&(d+=`
|
|
1155
|
+
`+c.length+` beginbfchar
|
|
1156
|
+
`+c.join(`
|
|
1157
|
+
`)+`
|
|
1158
|
+
endbfchar`,c=[]),s[l]!==void 0&&s[l]!==null&&typeof s[l].toString=="function"&&(h=("0000"+s[l].toString(16)).slice(-4),l=("0000"+(+l).toString(16)).slice(-4),c.push("<"+l+"><"+h+">"));return c.length&&(d+=`
|
|
1159
|
+
`+c.length+` beginbfchar
|
|
1160
|
+
`+c.join(`
|
|
1161
|
+
`)+`
|
|
1162
|
+
endbfchar
|
|
1163
|
+
`),d+`endcmap
|
|
1164
|
+
CMapName currentdict /CMap defineresource pop
|
|
1165
|
+
end
|
|
1166
|
+
end`};e.events.push(["putFont",function(s){(function(l){var u=l.font,c=l.out,h=l.newObject,d=l.putStream;if(u.metadata instanceof t.API.TTFFont&&u.encoding==="Identity-H"){for(var m=u.metadata.Unicode.widths,y=u.metadata.subset.encode(u.metadata.glyIdsUsed,1),g="",x=0;x<y.length;x++)g+=String.fromCharCode(y[x]);var _=h();d({data:g,addLength1:!0,objectId:_}),c("endobj");var N=h();d({data:r(u.metadata.toUnicode),addLength1:!0,objectId:N}),c("endobj");var A=h();c("<<"),c("/Type /FontDescriptor"),c("/FontName /"+Af(u.fontName)),c("/FontFile2 "+_+" 0 R"),c("/FontBBox "+t.API.PDFObject.convert(u.metadata.bbox)),c("/Flags "+u.metadata.flags),c("/StemV "+u.metadata.stemV),c("/ItalicAngle "+u.metadata.italicAngle),c("/Ascent "+u.metadata.ascender),c("/Descent "+u.metadata.decender),c("/CapHeight "+u.metadata.capHeight),c(">>"),c("endobj");var j=h();c("<<"),c("/Type /Font"),c("/BaseFont /"+Af(u.fontName)),c("/FontDescriptor "+A+" 0 R"),c("/W "+t.API.PDFObject.convert(m)),c("/CIDToGIDMap /Identity"),c("/DW 1000"),c("/Subtype /CIDFontType2"),c("/CIDSystemInfo"),c("<<"),c("/Supplement 0"),c("/Registry (Adobe)"),c("/Ordering ("+u.encoding+")"),c(">>"),c(">>"),c("endobj"),u.objectNumber=h(),c("<<"),c("/Type /Font"),c("/Subtype /Type0"),c("/ToUnicode "+N+" 0 R"),c("/BaseFont /"+Af(u.fontName)),c("/Encoding /"+u.encoding),c("/DescendantFonts ["+j+" 0 R]"),c(">>"),c("endobj"),u.isAlreadyPutted=!0}})(s)}]),e.events.push(["putFont",function(s){(function(l){var u=l.font,c=l.out,h=l.newObject,d=l.putStream;if(u.metadata instanceof t.API.TTFFont&&u.encoding==="WinAnsiEncoding"){for(var m=u.metadata.rawData,y="",g=0;g<m.length;g++)y+=String.fromCharCode(m[g]);var x=h();d({data:y,addLength1:!0,objectId:x}),c("endobj");var _=h();d({data:r(u.metadata.toUnicode),addLength1:!0,objectId:_}),c("endobj");var N=h();c("<<"),c("/Descent "+u.metadata.decender),c("/CapHeight "+u.metadata.capHeight),c("/StemV "+u.metadata.stemV),c("/Type /FontDescriptor"),c("/FontFile2 "+x+" 0 R"),c("/Flags 96"),c("/FontBBox "+t.API.PDFObject.convert(u.metadata.bbox)),c("/FontName /"+Af(u.fontName)),c("/ItalicAngle "+u.metadata.italicAngle),c("/Ascent "+u.metadata.ascender),c(">>"),c("endobj"),u.objectNumber=h();for(var A=0;A<u.metadata.hmtx.widths.length;A++)u.metadata.hmtx.widths[A]=parseInt(u.metadata.hmtx.widths[A]*(1e3/u.metadata.head.unitsPerEm));c("<</Subtype/TrueType/Type/Font/ToUnicode "+_+" 0 R/BaseFont/"+Af(u.fontName)+"/FontDescriptor "+N+" 0 R/Encoding/"+u.encoding+" /FirstChar 29 /LastChar 255 /Widths "+t.API.PDFObject.convert(u.metadata.hmtx.widths)+">>"),c("endobj"),u.isAlreadyPutted=!0}})(s)}]);var a=function(s){var l,u=s.text||"",c=s.x,h=s.y,d=s.options||{},m=s.mutex||{},y=m.pdfEscape,g=m.activeFontKey,x=m.fonts,_=g,N="",A=0,j="",L=x[_].encoding;if(x[_].encoding!=="Identity-H")return{text:u,x:c,y:h,options:d,mutex:m};for(j=u,_=g,Array.isArray(u)&&(j=u[0]),A=0;A<j.length;A+=1)x[_].metadata.hasOwnProperty("cmap")&&(l=x[_].metadata.cmap.unicode.codeMap[j[A].charCodeAt(0)]),l||j[A].charCodeAt(0)<256&&x[_].metadata.hasOwnProperty("Unicode")?N+=j[A]:N+="";var R="";return parseInt(_.slice(1))<14||L==="WinAnsiEncoding"?R=y(N,_).split("").map(function(I){return I.charCodeAt(0).toString(16)}).join(""):L==="Identity-H"&&(R=n(N,x[_])),m.isHex=!0,{text:R,x:c,y:h,options:d,mutex:m}};e.events.push(["postProcessText",function(s){var l=s.text||"",u=[],c={text:l,x:s.x,y:s.y,options:s.options,mutex:s.mutex};if(Array.isArray(l)){var h=0;for(h=0;h<l.length;h+=1)Array.isArray(l[h])&&l[h].length===3?u.push([a(Object.assign({},c,{text:l[h][0]})).text,l[h][1],l[h][2]]):u.push(a(Object.assign({},c,{text:l[h]})).text);s.text=u}else s.text=a(Object.assign({},c,{text:l})).text}])})(jt),(function(t){var e=function(){return this.internal.vFS===void 0&&(this.internal.vFS={}),!0};t.existsFileInVFS=function(n){return e.call(this),this.internal.vFS[n]!==void 0},t.addFileToVFS=function(n,r){return e.call(this),this.internal.vFS[n]=r,this},t.getFileFromVFS=function(n){return e.call(this),this.internal.vFS[n]!==void 0?this.internal.vFS[n]:null}})(jt.API),(function(t){t.__bidiEngine__=t.prototype.__bidiEngine__=function(r){var a,s,l,u,c,h,d,m=e,y=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],g=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],x={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},_={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},N=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],A=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),j=!1,L=0;this.__bidiEngine__={};var R=function(F){var $=F.charCodeAt(),K=$>>8,Y=_[K];return Y!==void 0?m[256*Y+(255&$)]:K===252||K===253?"AL":A.test(K)?"L":K===8?"R":"N"},I=function(F){for(var $,K=0;K<F.length;K++){if(($=R(F.charAt(K)))==="L")return!1;if($==="R")return!0}return!1},ee=function(F,$,K,Y){var he,te,oe,le,pe=$[Y];switch(pe){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":j=!1;break;case"N":case"AN":break;case"EN":j&&(pe="AN");break;case"AL":j=!0,pe="R";break;case"WS":case"BN":pe="N";break;case"CS":Y<1||Y+1>=$.length||(he=K[Y-1])!=="EN"&&he!=="AN"||(te=$[Y+1])!=="EN"&&te!=="AN"?pe="N":j&&(te="AN"),pe=te===he?te:"N";break;case"ES":pe=(he=Y>0?K[Y-1]:"B")==="EN"&&Y+1<$.length&&$[Y+1]==="EN"?"EN":"N";break;case"ET":if(Y>0&&K[Y-1]==="EN"){pe="EN";break}if(j){pe="N";break}for(oe=Y+1,le=$.length;oe<le&&$[oe]==="ET";)oe++;pe=oe<le&&$[oe]==="EN"?"EN":"N";break;case"NSM":if(l&&!u){for(le=$.length,oe=Y+1;oe<le&&$[oe]==="NSM";)oe++;if(oe<le){var Ne=F[Y],U=Ne>=1425&&Ne<=2303||Ne===64286;if(he=$[oe],U&&(he==="R"||he==="AL")){pe="R";break}}}pe=Y<1||(he=$[Y-1])==="B"?"N":K[Y-1];break;case"B":j=!1,a=!0,pe=L;break;case"S":s=!0,pe="N"}return pe},G=function(F,$,K){var Y=F.split("");return K&&P(Y,K,{hiLevel:L}),Y.reverse(),$&&$.reverse(),Y.join("")},P=function(F,$,K){var Y,he,te,oe,le,pe=-1,Ne=F.length,U=0,O=[],V=L?g:y,Z=[];for(j=!1,a=!1,s=!1,he=0;he<Ne;he++)Z[he]=R(F[he]);for(te=0;te<Ne;te++){if(le=U,O[te]=ee(F,Z,O,te),Y=240&(U=V[le][x[O[te]]]),U&=15,$[te]=oe=V[U][5],Y>0)if(Y===16){for(he=pe;he<te;he++)$[he]=1;pe=-1}else pe=-1;if(V[U][6])pe===-1&&(pe=te);else if(pe>-1){for(he=pe;he<te;he++)$[he]=oe;pe=-1}Z[te]==="B"&&($[te]=0),K.hiLevel|=oe}s&&(function(ie,z,se){for(var ge=0;ge<se;ge++)if(ie[ge]==="S"){z[ge]=L;for(var xe=ge-1;xe>=0&&ie[xe]==="WS";xe--)z[xe]=L}})(Z,$,Ne)},B=function(F,$,K,Y,he){if(!(he.hiLevel<F)){if(F===1&&L===1&&!a)return $.reverse(),void(K&&K.reverse());for(var te,oe,le,pe,Ne=$.length,U=0;U<Ne;){if(Y[U]>=F){for(le=U+1;le<Ne&&Y[le]>=F;)le++;for(pe=U,oe=le-1;pe<oe;pe++,oe--)te=$[pe],$[pe]=$[oe],$[oe]=te,K&&(te=K[pe],K[pe]=K[oe],K[oe]=te);U=le}U++}}},X=function(F,$,K){var Y=F.split(""),he={hiLevel:L};return K||(K=[]),P(Y,K,he),(function(te,oe,le){if(le.hiLevel!==0&&d)for(var pe,Ne=0;Ne<te.length;Ne++)oe[Ne]===1&&(pe=N.indexOf(te[Ne]))>=0&&(te[Ne]=N[pe+1])})(Y,K,he),B(2,Y,$,K,he),B(1,Y,$,K,he),Y.join("")};return this.__bidiEngine__.doBidiReorder=function(F,$,K){if((function(he,te){if(te)for(var oe=0;oe<he.length;oe++)te[oe]=oe;u===void 0&&(u=I(he)),h===void 0&&(h=I(he))})(F,$),l||!c||h)if(l&&c&&u^h)L=u?1:0,F=G(F,$,K);else if(!l&&c&&h)L=u?1:0,F=X(F,$,K),F=G(F,$);else if(!l||u||c||h){if(l&&!c&&u^h)F=G(F,$),u?(L=0,F=X(F,$,K)):(L=1,F=X(F,$,K),F=G(F,$));else if(l&&u&&!c&&h)L=1,F=X(F,$,K),F=G(F,$);else if(!l&&!c&&u^h){var Y=d;u?(L=1,F=X(F,$,K),L=0,d=!1,F=X(F,$,K),d=Y):(L=0,F=X(F,$,K),F=G(F,$),L=1,d=!1,F=X(F,$,K),d=Y,F=G(F,$))}}else L=0,F=X(F,$,K);else L=u?1:0,F=X(F,$,K);return F},this.__bidiEngine__.setOptions=function(F){F&&(l=F.isInputVisual,c=F.isOutputVisual,u=F.isInputRtl,h=F.isOutputRtl,d=F.isSymmetricSwapping)},this.__bidiEngine__.setOptions(r),this.__bidiEngine__};var e=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],n=new t.__bidiEngine__({isInputVisual:!0});t.API.events.push(["postProcessText",function(r){var a=r.text;r.x,r.y;var s=r.options||{};r.mutex,s.lang;var l=[];if(s.isInputVisual=typeof s.isInputVisual!="boolean"||s.isInputVisual,n.setOptions(s),Object.prototype.toString.call(a)==="[object Array]"){var u=0;for(l=[],u=0;u<a.length;u+=1)Object.prototype.toString.call(a[u])==="[object Array]"?l.push([n.doBidiReorder(a[u][0]),a[u][1],a[u][2]]):l.push([n.doBidiReorder(a[u])]);r.text=l}else r.text=n.doBidiReorder(a);n.setOptions({isInputVisual:!0})}])})(jt),jt.API.TTFFont=(function(){function t(e){var n;if(this.rawData=e,n=this.contents=new Cu(e),this.contents.pos=4,n.readString(4)==="ttcf")throw new Error("TTCF not supported.");n.pos=0,this.parse(),this.subset=new Oz(this),this.registerTTF()}return t.open=function(e){return new t(e)},t.prototype.parse=function(){return this.directory=new vz(this.contents),this.head=new bz(this),this.name=new Ez(this),this.cmap=new FA(this),this.toUnicode={},this.hhea=new wz(this),this.maxp=new Az(this),this.hmtx=new Nz(this),this.post=new Sz(this),this.os2=new xz(this),this.loca=new jz(this),this.glyf=new Cz(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},t.prototype.registerTTF=function(){var e,n,r,a,s;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=(function(){var l,u,c,h;for(h=[],l=0,u=(c=this.bbox).length;l<u;l++)e=c[l],h.push(Math.round(e*this.scaleFactor));return h}).call(this),this.stemV=0,this.post.exists?(r=255&(a=this.post.italic_angle),32768&(n=a>>16)&&(n=-(1+(65535^n))),this.italicAngle=+(n+"."+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=(s=this.familyClass)===1||s===2||s===3||s===4||s===5||s===7,this.isScript=this.familyClass===10,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),this.italicAngle!==0&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},t.prototype.characterToGlyph=function(e){var n;return((n=this.cmap.unicode)!=null?n.codeMap[e]:void 0)||0},t.prototype.widthOfGlyph=function(e){var n;return n=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*n},t.prototype.widthOfString=function(e,n,r){var a,s,l,u;for(l=0,s=0,u=(e=""+e).length;0<=u?s<u:s>u;s=0<=u?++s:--s)a=e.charCodeAt(s),l+=this.widthOfGlyph(this.characterToGlyph(a))+r*(1e3/n)||0;return l*(n/1e3)},t.prototype.lineHeight=function(e,n){var r;return n==null&&(n=!1),r=n?this.lineGap:0,(this.ascender+r-this.decender)/1e3*e},t})();var ro,Cu=(function(){function t(e){this.data=e??[],this.pos=0,this.length=this.data.length}return t.prototype.readByte=function(){return this.data[this.pos++]},t.prototype.writeByte=function(e){return this.data[this.pos++]=e},t.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},t.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},t.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},t.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},t.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},t.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},t.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},t.prototype.readString=function(e){var n,r;for(r=[],n=0;0<=e?n<e:n>e;n=0<=e?++n:--n)r[n]=String.fromCharCode(this.readByte());return r.join("")},t.prototype.writeString=function(e){var n,r,a;for(a=[],n=0,r=e.length;0<=r?n<r:n>r;n=0<=r?++n:--n)a.push(this.writeByte(e.charCodeAt(n)));return a},t.prototype.readShort=function(){return this.readInt16()},t.prototype.writeShort=function(e){return this.writeInt16(e)},t.prototype.readLongLong=function(){var e,n,r,a,s,l,u,c;return e=this.readByte(),n=this.readByte(),r=this.readByte(),a=this.readByte(),s=this.readByte(),l=this.readByte(),u=this.readByte(),c=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^n)+1099511627776*(255^r)+4294967296*(255^a)+16777216*(255^s)+65536*(255^l)+256*(255^u)+(255^c)+1):72057594037927940*e+281474976710656*n+1099511627776*r+4294967296*a+16777216*s+65536*l+256*u+c},t.prototype.writeLongLong=function(e){var n,r;return n=Math.floor(e/4294967296),r=4294967295&e,this.writeByte(n>>24&255),this.writeByte(n>>16&255),this.writeByte(n>>8&255),this.writeByte(255&n),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},t.prototype.readInt=function(){return this.readInt32()},t.prototype.writeInt=function(e){return this.writeInt32(e)},t.prototype.read=function(e){var n,r;for(n=[],r=0;0<=e?r<e:r>e;r=0<=e?++r:--r)n.push(this.readByte());return n},t.prototype.write=function(e){var n,r,a,s;for(s=[],r=0,a=e.length;r<a;r++)n=e[r],s.push(this.writeByte(n));return s},t})(),vz=(function(){var t;function e(n){var r,a,s;for(this.scalarType=n.readInt(),this.tableCount=n.readShort(),this.searchRange=n.readShort(),this.entrySelector=n.readShort(),this.rangeShift=n.readShort(),this.tables={},a=0,s=this.tableCount;0<=s?a<s:a>s;a=0<=s?++a:--a)r={tag:n.readString(4),checksum:n.readInt(),offset:n.readInt(),length:n.readInt()},this.tables[r.tag]=r}return e.prototype.encode=function(n){var r,a,s,l,u,c,h,d,m,y,g,x,_;for(_ in g=Object.keys(n).length,c=Math.log(2),m=16*Math.floor(Math.log(g)/c),l=Math.floor(m/c),d=16*g-m,(a=new Cu).writeInt(this.scalarType),a.writeShort(g),a.writeShort(m),a.writeShort(l),a.writeShort(d),s=16*g,h=a.pos+s,u=null,x=[],n)for(y=n[_],a.writeString(_),a.writeInt(t(y)),a.writeInt(h),a.writeInt(y.length),x=x.concat(y),_==="head"&&(u=h),h+=y.length;h%4;)x.push(0),h++;return a.write(x),r=2981146554-t(a.data),a.pos=u+8,a.writeUInt32(r),a.data},t=function(n){var r,a,s,l;for(n=UA.call(n);n.length%4;)n.push(0);for(s=new Cu(n),a=0,r=0,l=n.length;r<l;r=r+=4)a+=s.readUInt32();return 4294967295&a},e})(),yz={}.hasOwnProperty,qo=function(t,e){for(var n in e)yz.call(e,n)&&(t[n]=e[n]);function r(){this.constructor=t}return r.prototype=e.prototype,t.prototype=new r,t.__super__=e.prototype,t};ro=(function(){function t(e){var n;this.file=e,n=this.file.directory.tables[this.tag],this.exists=!!n,n&&(this.offset=n.offset,this.length=n.length,this.parse(this.file.contents))}return t.prototype.parse=function(){},t.prototype.encode=function(){},t.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},t})();var bz=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return qo(t,ro),t.prototype.tag="head",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},t.prototype.encode=function(e){var n;return(n=new Cu).writeInt(this.version),n.writeInt(this.revision),n.writeInt(this.checkSumAdjustment),n.writeInt(this.magicNumber),n.writeShort(this.flags),n.writeShort(this.unitsPerEm),n.writeLongLong(this.created),n.writeLongLong(this.modified),n.writeShort(this.xMin),n.writeShort(this.yMin),n.writeShort(this.xMax),n.writeShort(this.yMax),n.writeShort(this.macStyle),n.writeShort(this.lowestRecPPEM),n.writeShort(this.fontDirectionHint),n.writeShort(e),n.writeShort(this.glyphDataFormat),n.data},t})(),$_=(function(){function t(e,n){var r,a,s,l,u,c,h,d,m,y,g,x,_,N,A,j,L;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=n+e.readInt(),m=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=this.platformID===3&&this.encodingID===1&&this.format===4||this.platformID===0&&this.format===4,this.codeMap={},this.format){case 0:for(c=0;c<256;++c)this.codeMap[c]=e.readByte();break;case 4:for(g=e.readUInt16(),y=g/2,e.pos+=6,s=(function(){var R,I;for(I=[],c=R=0;0<=y?R<y:R>y;c=0<=y?++R:--R)I.push(e.readUInt16());return I})(),e.pos+=2,_=(function(){var R,I;for(I=[],c=R=0;0<=y?R<y:R>y;c=0<=y?++R:--R)I.push(e.readUInt16());return I})(),h=(function(){var R,I;for(I=[],c=R=0;0<=y?R<y:R>y;c=0<=y?++R:--R)I.push(e.readUInt16());return I})(),d=(function(){var R,I;for(I=[],c=R=0;0<=y?R<y:R>y;c=0<=y?++R:--R)I.push(e.readUInt16());return I})(),a=(this.length-e.pos+this.offset)/2,u=(function(){var R,I;for(I=[],c=R=0;0<=a?R<a:R>a;c=0<=a?++R:--R)I.push(e.readUInt16());return I})(),c=A=0,L=s.length;A<L;c=++A)for(N=s[c],r=j=x=_[c];x<=N?j<=N:j>=N;r=x<=N?++j:--j)d[c]===0?l=r+h[c]:(l=u[d[c]/2+(r-x)-(y-c)]||0)!==0&&(l+=h[c]),this.codeMap[r]=65535&l}e.pos=m}return t.encode=function(e,n){var r,a,s,l,u,c,h,d,m,y,g,x,_,N,A,j,L,R,I,ee,G,P,B,X,F,$,K,Y,he,te,oe,le,pe,Ne,U,O,V,Z,ie,z,se,ge,xe,Re,De,qe;switch(Y=new Cu,l=Object.keys(e).sort(function(Pe,Ke){return Pe-Ke}),n){case"macroman":for(_=0,N=(function(){var Pe=[];for(x=0;x<256;++x)Pe.push(0);return Pe})(),j={0:0},s={},he=0,pe=l.length;he<pe;he++)j[xe=e[a=l[he]]]==null&&(j[xe]=++_),s[a]={old:e[a],new:j[e[a]]},N[a]=j[e[a]];return Y.writeUInt16(1),Y.writeUInt16(0),Y.writeUInt32(12),Y.writeUInt16(0),Y.writeUInt16(262),Y.writeUInt16(0),Y.write(N),{charMap:s,subtable:Y.data,maxGlyphID:_+1};case"unicode":for($=[],m=[],L=0,j={},r={},A=h=null,te=0,Ne=l.length;te<Ne;te++)j[I=e[a=l[te]]]==null&&(j[I]=++L),r[a]={old:I,new:j[I]},u=j[I]-a,A!=null&&u===h||(A&&m.push(A),$.push(a),h=u),A=a;for(A&&m.push(A),m.push(65535),$.push(65535),X=2*(B=$.length),P=2*Math.pow(Math.log(B)/Math.LN2,2),y=Math.log(P/2)/Math.LN2,G=2*B-P,c=[],ee=[],g=[],x=oe=0,U=$.length;oe<U;x=++oe){if(F=$[x],d=m[x],F===65535){c.push(0),ee.push(0);break}if(F-(K=r[F].new)>=32768)for(c.push(0),ee.push(2*(g.length+B-x)),a=le=F;F<=d?le<=d:le>=d;a=F<=d?++le:--le)g.push(r[a].new);else c.push(K-F),ee.push(0)}for(Y.writeUInt16(3),Y.writeUInt16(1),Y.writeUInt32(12),Y.writeUInt16(4),Y.writeUInt16(16+8*B+2*g.length),Y.writeUInt16(0),Y.writeUInt16(X),Y.writeUInt16(P),Y.writeUInt16(y),Y.writeUInt16(G),se=0,O=m.length;se<O;se++)a=m[se],Y.writeUInt16(a);for(Y.writeUInt16(0),ge=0,V=$.length;ge<V;ge++)a=$[ge],Y.writeUInt16(a);for(Re=0,Z=c.length;Re<Z;Re++)u=c[Re],Y.writeUInt16(u);for(De=0,ie=ee.length;De<ie;De++)R=ee[De],Y.writeUInt16(R);for(qe=0,z=g.length;qe<z;qe++)_=g[qe],Y.writeUInt16(_);return{charMap:r,subtable:Y.data,maxGlyphID:L+1}}},t})(),FA=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return qo(t,ro),t.prototype.tag="cmap",t.prototype.parse=function(e){var n,r,a;for(e.pos=this.offset,this.version=e.readUInt16(),a=e.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=a?r<a:r>a;r=0<=a?++r:--r)n=new $_(e,this.offset),this.tables.push(n),n.isUnicode&&this.unicode==null&&(this.unicode=n);return!0},t.encode=function(e,n){var r,a;return n==null&&(n="macroman"),r=$_.encode(e,n),(a=new Cu).writeUInt16(0),a.writeUInt16(1),r.table=a.data.concat(r.subtable),r},t})(),wz=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return qo(t,ro),t.prototype.tag="hhea",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},t})(),xz=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return qo(t,ro),t.prototype.tag="OS/2",t.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=(function(){var n,r;for(r=[],n=0;n<10;++n)r.push(e.readByte());return r})(),this.charRange=(function(){var n,r;for(r=[],n=0;n<4;++n)r.push(e.readInt());return r})(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=(function(){var n,r;for(r=[],n=0;n<2;n=++n)r.push(e.readInt());return r})(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},t})(),Sz=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return qo(t,ro),t.prototype.tag="post",t.prototype.parse=function(e){var n,r,a;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var s;for(r=e.readUInt16(),this.glyphNameIndex=[],s=0;0<=r?s<r:s>r;s=0<=r?++s:--s)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],a=[];e.pos<this.offset+this.length;)n=e.readByte(),a.push(this.names.push(e.readString(n)));return a;case 151552:return r=e.readUInt16(),this.offsets=e.read(r);case 262144:return this.map=(function(){var l,u,c;for(c=[],s=l=0,u=this.file.maxp.numGlyphs;0<=u?l<u:l>u;s=0<=u?++l:--l)c.push(e.readUInt32());return c}).call(this)}},t})(),_z=function(t,e){this.raw=t,this.length=t.length,this.platformID=e.platformID,this.encodingID=e.encodingID,this.languageID=e.languageID},Ez=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return qo(t,ro),t.prototype.tag="name",t.prototype.parse=function(e){var n,r,a,s,l,u,c,h,d,m,y;for(e.pos=this.offset,e.readShort(),n=e.readShort(),u=e.readShort(),r=[],s=0;0<=n?s<n:s>n;s=0<=n?++s:--s)r.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+u+e.readShort()});for(c={},s=d=0,m=r.length;d<m;s=++d)a=r[s],e.pos=a.offset,h=e.readString(a.length),l=new _z(h,a),c[y=a.nameID]==null&&(c[y]=[]),c[a.nameID].push(l);this.strings=c,this.copyright=c[0],this.fontFamily=c[1],this.fontSubfamily=c[2],this.uniqueSubfamily=c[3],this.fontName=c[4],this.version=c[5];try{this.postscriptName=c[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=c[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=c[7],this.manufacturer=c[8],this.designer=c[9],this.description=c[10],this.vendorUrl=c[11],this.designerUrl=c[12],this.license=c[13],this.licenseUrl=c[14],this.preferredFamily=c[15],this.preferredSubfamily=c[17],this.compatibleFull=c[18],this.sampleText=c[19]},t})(),Az=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return qo(t,ro),t.prototype.tag="maxp",t.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},t})(),Nz=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return qo(t,ro),t.prototype.tag="hmtx",t.prototype.parse=function(e){var n,r,a,s,l,u,c;for(e.pos=this.offset,this.metrics=[],n=0,u=this.file.hhea.numberOfMetrics;0<=u?n<u:n>u;n=0<=u?++n:--n)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(a=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=(function(){var h,d;for(d=[],n=h=0;0<=a?h<a:h>a;n=0<=a?++h:--h)d.push(e.readInt16());return d})(),this.widths=(function(){var h,d,m,y;for(y=[],h=0,d=(m=this.metrics).length;h<d;h++)s=m[h],y.push(s.advance);return y}).call(this),r=this.widths[this.widths.length-1],c=[],n=l=0;0<=a?l<a:l>a;n=0<=a?++l:--l)c.push(this.widths.push(r));return c},t.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},t})(),UA=[].slice,Cz=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return qo(t,ro),t.prototype.tag="glyf",t.prototype.parse=function(){return this.cache={}},t.prototype.glyphFor=function(e){var n,r,a,s,l,u,c,h,d,m;return e in this.cache?this.cache[e]:(s=this.file.loca,n=this.file.contents,r=s.indexOf(e),(a=s.lengthOf(e))===0?this.cache[e]=null:(n.pos=this.offset+r,l=(u=new Cu(n.read(a))).readShort(),h=u.readShort(),m=u.readShort(),c=u.readShort(),d=u.readShort(),this.cache[e]=l===-1?new Lz(u,h,m,c,d):new Tz(u,l,h,m,c,d),this.cache[e]))},t.prototype.encode=function(e,n,r){var a,s,l,u,c;for(l=[],s=[],u=0,c=n.length;u<c;u++)a=e[n[u]],s.push(l.length),a&&(l=l.concat(a.encode(r)));return s.push(l.length),{table:l,offsets:s}},t})(),Tz=(function(){function t(e,n,r,a,s,l){this.raw=e,this.numberOfContours=n,this.xMin=r,this.yMin=a,this.xMax=s,this.yMax=l,this.compound=!1}return t.prototype.encode=function(){return this.raw.data},t})(),Lz=(function(){function t(e,n,r,a,s){var l,u;for(this.raw=e,this.xMin=n,this.yMin=r,this.xMax=a,this.yMax=s,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],l=this.raw;u=l.readShort(),this.glyphOffsets.push(l.pos),this.glyphIDs.push(l.readUInt16()),32&u;)l.pos+=1&u?4:2,128&u?l.pos+=8:64&u?l.pos+=4:8&u&&(l.pos+=2)}return t.prototype.encode=function(){var e,n,r;for(n=new Cu(UA.call(this.raw.data)),e=0,r=this.glyphIDs.length;e<r;++e)n.pos=this.glyphOffsets[e];return n.data},t})(),jz=(function(){function t(){return t.__super__.constructor.apply(this,arguments)}return qo(t,ro),t.prototype.tag="loca",t.prototype.parse=function(e){var n,r;return e.pos=this.offset,n=this.file.head.indexToLocFormat,this.offsets=n===0?(function(){var a,s;for(s=[],r=0,a=this.length;r<a;r+=2)s.push(2*e.readUInt16());return s}).call(this):(function(){var a,s;for(s=[],r=0,a=this.length;r<a;r+=4)s.push(e.readUInt32());return s}).call(this)},t.prototype.indexOf=function(e){return this.offsets[e]},t.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},t.prototype.encode=function(e,n){for(var r=new Uint32Array(this.offsets.length),a=0,s=0,l=0;l<r.length;++l)if(r[l]=a,s<n.length&&n[s]==l){++s,r[l]=a;var u=this.offsets[l],c=this.offsets[l+1]-u;c>0&&(a+=c)}for(var h=new Array(4*r.length),d=0;d<r.length;++d)h[4*d+3]=255&r[d],h[4*d+2]=(65280&r[d])>>8,h[4*d+1]=(16711680&r[d])>>16,h[4*d]=(4278190080&r[d])>>24;return h},t})(),Oz=(function(){function t(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return t.prototype.generateCmap=function(){var e,n,r,a,s;for(n in a=this.font.cmap.tables[0].codeMap,e={},s=this.subset)r=s[n],e[n]=a[r];return e},t.prototype.glyphsFor=function(e){var n,r,a,s,l,u,c;for(a={},l=0,u=e.length;l<u;l++)a[s=e[l]]=this.font.glyf.glyphFor(s);for(s in n=[],a)(r=a[s])!=null&&r.compound&&n.push.apply(n,r.glyphIDs);if(n.length>0)for(s in c=this.glyphsFor(n))r=c[s],a[s]=r;return a},t.prototype.encode=function(e,n){var r,a,s,l,u,c,h,d,m,y,g,x,_,N,A;for(a in r=FA.encode(this.generateCmap(),"unicode"),l=this.glyphsFor(e),g={0:0},A=r.charMap)g[(c=A[a]).old]=c.new;for(x in y=r.maxGlyphID,l)x in g||(g[x]=y++);return d=(function(j){var L,R;for(L in R={},j)R[j[L]]=L;return R})(g),m=Object.keys(d).sort(function(j,L){return j-L}),_=(function(){var j,L,R;for(R=[],j=0,L=m.length;j<L;j++)u=m[j],R.push(d[u]);return R})(),s=this.font.glyf.encode(l,_,g),h=this.font.loca.encode(s.offsets,_),N={cmap:this.font.cmap.raw(),glyf:s.table,loca:h,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(n)},this.font.os2.exists&&(N["OS/2"]=this.font.os2.raw()),this.font.directory.encode(N)},t})();jt.API.PDFObject=(function(){var t;function e(){}return t=function(n,r){return(Array(r+1).join("0")+n).slice(-r)},e.convert=function(n){var r,a,s,l;if(Array.isArray(n))return"["+(function(){var u,c,h;for(h=[],u=0,c=n.length;u<c;u++)r=n[u],h.push(e.convert(r));return h})().join(" ")+"]";if(typeof n=="string")return"/"+n;if(n!=null&&n.isString)return"("+n+")";if(n instanceof Date)return"(D:"+t(n.getUTCFullYear(),4)+t(n.getUTCMonth(),2)+t(n.getUTCDate(),2)+t(n.getUTCHours(),2)+t(n.getUTCMinutes(),2)+t(n.getUTCSeconds(),2)+"Z)";if({}.toString.call(n)==="[object Object]"){for(a in s=["<<"],n)l=n[a],s.push("/"+a+" "+e.convert(l));return s.push(">>"),s.join(`
|
|
1167
|
+
`)}return""+n},e})();function BA(t,e,n,r,a){r=r||{};var s=1.15,l=a.internal.scaleFactor,u=a.internal.getFontSize()/l,c=a.getLineHeightFactor?a.getLineHeightFactor():s,h=u*c,d=/\r\n|\r|\n/g,m="",y=1;if((r.valign==="middle"||r.valign==="bottom"||r.halign==="center"||r.halign==="right")&&(m=typeof t=="string"?t.split(d):t,y=m.length||1),n+=u*(2-s),r.valign==="middle"?n-=y/2*h:r.valign==="bottom"&&(n-=y*h),r.halign==="center"||r.halign==="right"){var g=u;if(r.halign==="center"&&(g*=.5),m&&y>=1){for(var x=0;x<m.length;x++)a.text(m[x],e-a.getStringUnitWidth(m[x])*g,n),n+=h;return a}e-=a.getStringUnitWidth(t)*g}return r.halign==="justify"?a.text(t,e,n,{maxWidth:r.maxWidth||100,align:"justify"}):a.text(t,e,n),a}var z_={},$f=(function(){function t(e){this.jsPDFDocument=e,this.userStyles={textColor:e.getTextColor?this.jsPDFDocument.getTextColor():0,fontSize:e.internal.getFontSize(),fontStyle:e.internal.getFont().fontStyle,font:e.internal.getFont().fontName,lineWidth:e.getLineWidth?this.jsPDFDocument.getLineWidth():0,lineColor:e.getDrawColor?this.jsPDFDocument.getDrawColor():0}}return t.setDefaults=function(e,n){n===void 0&&(n=null),n?n.__autoTableDocumentDefaults=e:z_=e},t.unifyColor=function(e){return Array.isArray(e)?e:typeof e=="number"?[e,e,e]:typeof e=="string"?[e]:null},t.prototype.applyStyles=function(e,n){var r,a,s;n===void 0&&(n=!1),e.fontStyle&&this.jsPDFDocument.setFontStyle&&this.jsPDFDocument.setFontStyle(e.fontStyle);var l=this.jsPDFDocument.internal.getFont(),u=l.fontStyle,c=l.fontName;if(e.font&&(c=e.font),e.fontStyle){u=e.fontStyle;var h=this.getFontList()[c];h&&h.indexOf(u)===-1&&this.jsPDFDocument.setFontStyle&&(this.jsPDFDocument.setFontStyle(h[0]),u=h[0])}if(this.jsPDFDocument.setFont(c,u),e.fontSize&&this.jsPDFDocument.setFontSize(e.fontSize),!n){var d=t.unifyColor(e.fillColor);d&&(r=this.jsPDFDocument).setFillColor.apply(r,d),d=t.unifyColor(e.textColor),d&&(a=this.jsPDFDocument).setTextColor.apply(a,d),d=t.unifyColor(e.lineColor),d&&(s=this.jsPDFDocument).setDrawColor.apply(s,d),typeof e.lineWidth=="number"&&this.jsPDFDocument.setLineWidth(e.lineWidth)}},t.prototype.splitTextToSize=function(e,n,r){return this.jsPDFDocument.splitTextToSize(e,n,r)},t.prototype.rect=function(e,n,r,a,s){return this.jsPDFDocument.rect(e,n,r,a,s)},t.prototype.getLastAutoTable=function(){return this.jsPDFDocument.lastAutoTable||null},t.prototype.getTextWidth=function(e){return this.jsPDFDocument.getTextWidth(e)},t.prototype.getDocument=function(){return this.jsPDFDocument},t.prototype.setPage=function(e){this.jsPDFDocument.setPage(e)},t.prototype.addPage=function(){return this.jsPDFDocument.addPage()},t.prototype.getFontList=function(){return this.jsPDFDocument.getFontList()},t.prototype.getGlobalOptions=function(){return z_||{}},t.prototype.getDocumentOptions=function(){return this.jsPDFDocument.__autoTableDocumentDefaults||{}},t.prototype.pageSize=function(){var e=this.jsPDFDocument.internal.pageSize;return e.width==null&&(e={width:e.getWidth(),height:e.getHeight()}),e},t.prototype.scaleFactor=function(){return this.jsPDFDocument.internal.scaleFactor},t.prototype.getLineHeightFactor=function(){var e=this.jsPDFDocument;return e.getLineHeightFactor?e.getLineHeightFactor():1.15},t.prototype.getLineHeight=function(e){return e/this.scaleFactor()*this.getLineHeightFactor()},t.prototype.pageNumber=function(){var e=this.jsPDFDocument.internal.getCurrentPageInfo();return e?e.pageNumber:this.jsPDFDocument.internal.getNumberOfPages()},t})(),Ay=function(t,e){return Ay=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},Ay(t,e)};function $A(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ay(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var zA=(function(t){$A(e,t);function e(n){var r=t.call(this)||this;return r._element=n,r}return e})(Array);function Rz(t){return{font:"helvetica",fontStyle:"normal",overflow:"linebreak",fillColor:!1,textColor:20,halign:"left",valign:"top",fontSize:10,cellPadding:5/t,lineColor:200,lineWidth:0,cellWidth:"auto",minCellHeight:0,minCellWidth:0}}function kz(t){var e={striped:{table:{fillColor:255,textColor:80,fontStyle:"normal"},head:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},body:{},foot:{textColor:255,fillColor:[41,128,185],fontStyle:"bold"},alternateRow:{fillColor:245}},grid:{table:{fillColor:255,textColor:80,fontStyle:"normal",lineWidth:.1},head:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},body:{},foot:{textColor:255,fillColor:[26,188,156],fontStyle:"bold",lineWidth:0},alternateRow:{}},plain:{head:{fontStyle:"bold"},foot:{fontStyle:"bold"}}};return e[t]}function gg(t,e,n){n.applyStyles(e,!0);var r=Array.isArray(t)?t:[t],a=r.map(function(s){return n.getTextWidth(s)}).reduce(function(s,l){return Math.max(s,l)},0);return a}function qA(t,e,n,r){var a=e.settings.tableLineWidth,s=e.settings.tableLineColor;t.applyStyles({lineWidth:a,lineColor:s});var l=HA(a,!1);l&&t.rect(n.x,n.y,e.getWidth(t.pageSize().width),r.y-n.y,l)}function HA(t,e){var n=t>0,r=e||e===0;return n&&r?"DF":n?"S":r?"F":null}function Gg(t,e){var n,r,a,s;if(t=t||e,Array.isArray(t)){if(t.length>=4)return{top:t[0],right:t[1],bottom:t[2],left:t[3]};if(t.length===3)return{top:t[0],right:t[1],bottom:t[2],left:t[1]};if(t.length===2)return{top:t[0],right:t[1],bottom:t[0],left:t[1]};t.length===1?t=t[0]:t=e}return typeof t=="object"?(typeof t.vertical=="number"&&(t.top=t.vertical,t.bottom=t.vertical),typeof t.horizontal=="number"&&(t.right=t.horizontal,t.left=t.horizontal),{left:(n=t.left)!==null&&n!==void 0?n:e,top:(r=t.top)!==null&&r!==void 0?r:e,right:(a=t.right)!==null&&a!==void 0?a:e,bottom:(s=t.bottom)!==null&&s!==void 0?s:e}):(typeof t!="number"&&(t=e),{top:t,right:t,bottom:t,left:t})}function VA(t,e){var n=Gg(e.settings.margin,0);return t.pageSize().width-(n.left+n.right)}function Dz(t,e,n,r,a){var s={},l=1.3333333333333333,u=yv(e,function(L){return a.getComputedStyle(L).backgroundColor});u!=null&&(s.fillColor=u);var c=yv(e,function(L){return a.getComputedStyle(L).color});c!=null&&(s.textColor=c);var h=Mz(r,n);h&&(s.cellPadding=h);var d="borderTopColor",m=l*n,y=r.borderTopWidth;if(r.borderBottomWidth===y&&r.borderRightWidth===y&&r.borderLeftWidth===y){var g=(parseFloat(y)||0)/m;g&&(s.lineWidth=g)}else s.lineWidth={top:(parseFloat(r.borderTopWidth)||0)/m,right:(parseFloat(r.borderRightWidth)||0)/m,bottom:(parseFloat(r.borderBottomWidth)||0)/m,left:(parseFloat(r.borderLeftWidth)||0)/m},s.lineWidth.top||(s.lineWidth.right?d="borderRightColor":s.lineWidth.bottom?d="borderBottomColor":s.lineWidth.left&&(d="borderLeftColor"));var x=yv(e,function(L){return a.getComputedStyle(L)[d]});x!=null&&(s.lineColor=x);var _=["left","right","center","justify"];_.indexOf(r.textAlign)!==-1&&(s.halign=r.textAlign),_=["middle","bottom","top"],_.indexOf(r.verticalAlign)!==-1&&(s.valign=r.verticalAlign);var N=parseInt(r.fontSize||"");isNaN(N)||(s.fontSize=N/l);var A=Pz(r);A&&(s.fontStyle=A);var j=(r.fontFamily||"").toLowerCase();return t.indexOf(j)!==-1&&(s.font=j),s}function Pz(t){var e="";return(t.fontWeight==="bold"||t.fontWeight==="bolder"||parseInt(t.fontWeight)>=700)&&(e="bold"),(t.fontStyle==="italic"||t.fontStyle==="oblique")&&(e+="italic"),e}function yv(t,e){var n=GA(t,e);if(!n)return null;var r=n.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d*\.?\d*))?\)$/);if(!r||!Array.isArray(r))return null;var a=[parseInt(r[1]),parseInt(r[2]),parseInt(r[3])],s=parseInt(r[4]);return s===0||isNaN(a[0])||isNaN(a[1])||isNaN(a[2])?null:a}function GA(t,e){var n=e(t);return n==="rgba(0, 0, 0, 0)"||n==="transparent"||n==="initial"||n==="inherit"?t.parentElement==null?null:GA(t.parentElement,e):n}function Mz(t,e){var n=[t.paddingTop,t.paddingRight,t.paddingBottom,t.paddingLeft],r=96/(72/e),a=(parseInt(t.lineHeight)-parseInt(t.fontSize))/e/2,s=n.map(function(u){return parseInt(u||"0")/r}),l=Gg(s,0);return a>l.top&&(l.top=a),a>l.bottom&&(l.bottom=a),l}function WA(t,e,n,r,a){var s,l;r===void 0&&(r=!1),a===void 0&&(a=!1);var u;typeof e=="string"?u=n.document.querySelector(e):u=e;var c=Object.keys(t.getFontList()),h=t.scaleFactor(),d=[],m=[],y=[];if(!u)return console.error("Html table could not be found with input: ",e),{head:d,body:m,foot:y};for(var g=0;g<u.rows.length;g++){var x=u.rows[g],_=(l=(s=x==null?void 0:x.parentElement)===null||s===void 0?void 0:s.tagName)===null||l===void 0?void 0:l.toLowerCase(),N=Iz(c,h,n,x,r,a);N&&(_==="thead"?d.push(N):_==="tfoot"?y.push(N):m.push(N))}return{head:d,body:m,foot:y}}function Iz(t,e,n,r,a,s){for(var l=new zA(r),u=0;u<r.cells.length;u++){var c=r.cells[u],h=n.getComputedStyle(c);if(a||h.display!=="none"){var d=void 0;s&&(d=Dz(t,c,e,h,n)),l.push({rowSpan:c.rowSpan,colSpan:c.colSpan,styles:d,_element:c,content:Fz(c)})}}var m=n.getComputedStyle(r);if(l.length>0&&(a||m.display!=="none"))return l}function Fz(t){var e=t.cloneNode(!0);return e.innerHTML=e.innerHTML.replace(/\n/g,"").replace(/ +/g," "),e.innerHTML=e.innerHTML.split(/<br.*?>/).map(function(n){return n.trim()}).join(`
|
|
1168
|
+
`),e.innerText||e.textContent||""}function Uz(t,e,n){for(var r=0,a=[t,e,n];r<a.length;r++){var s=a[r];s&&typeof s!="object"&&console.error("The options parameter should be of type object, is: "+typeof s),s.startY&&typeof s.startY!="number"&&(console.error("Invalid value for startY option",s.startY),delete s.startY)}}function kl(t,e,n,r,a){if(t==null)throw new TypeError("Cannot convert undefined or null to object");for(var s=Object(t),l=1;l<arguments.length;l++){var u=arguments[l];if(u!=null)for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(s[c]=u[c])}return s}function YA(t,e){var n=new $f(t),r=n.getDocumentOptions(),a=n.getGlobalOptions();Uz(a,r,e);var s=kl({},a,r,e),l;typeof window<"u"&&(l=window);var u=Bz(a,r,e),c=$z(a,r,e),h=zz(n,s),d=Hz(n,s,l);return{id:e.tableId,content:d,hooks:c,styles:u,settings:h}}function Bz(t,e,n){for(var r={styles:{},headStyles:{},bodyStyles:{},footStyles:{},alternateRowStyles:{},columnStyles:{}},a=function(c){if(c==="columnStyles"){var h=t[c],d=e[c],m=n[c];r.columnStyles=kl({},h,d,m)}else{var y=[t,e,n],g=y.map(function(x){return x[c]||{}});r[c]=kl({},g[0],g[1],g[2])}},s=0,l=Object.keys(r);s<l.length;s++){var u=l[s];a(u)}return r}function $z(t,e,n){for(var r=[t,e,n],a={didParseCell:[],willDrawCell:[],didDrawCell:[],willDrawPage:[],didDrawPage:[]},s=0,l=r;s<l.length;s++){var u=l[s];u.didParseCell&&a.didParseCell.push(u.didParseCell),u.willDrawCell&&a.willDrawCell.push(u.willDrawCell),u.didDrawCell&&a.didDrawCell.push(u.didDrawCell),u.willDrawPage&&a.willDrawPage.push(u.willDrawPage),u.didDrawPage&&a.didDrawPage.push(u.didDrawPage)}return a}function zz(t,e){var n,r,a,s,l,u,c,h,d,m,y,g,x=Gg(e.margin,40/t.scaleFactor()),_=(n=qz(t,e.startY))!==null&&n!==void 0?n:x.top,N;e.showFoot===!0?N="everyPage":e.showFoot===!1?N="never":N=(r=e.showFoot)!==null&&r!==void 0?r:"everyPage";var A;e.showHead===!0?A="everyPage":e.showHead===!1?A="never":A=(a=e.showHead)!==null&&a!==void 0?a:"everyPage";var j=(s=e.useCss)!==null&&s!==void 0?s:!1,L=e.theme||(j?"plain":"striped"),R=!!e.horizontalPageBreak,I=(l=e.horizontalPageBreakRepeat)!==null&&l!==void 0?l:null;return{includeHiddenHtml:(u=e.includeHiddenHtml)!==null&&u!==void 0?u:!1,useCss:j,theme:L,startY:_,margin:x,pageBreak:(c=e.pageBreak)!==null&&c!==void 0?c:"auto",rowPageBreak:(h=e.rowPageBreak)!==null&&h!==void 0?h:"auto",tableWidth:(d=e.tableWidth)!==null&&d!==void 0?d:"auto",showHead:A,showFoot:N,tableLineWidth:(m=e.tableLineWidth)!==null&&m!==void 0?m:0,tableLineColor:(y=e.tableLineColor)!==null&&y!==void 0?y:200,horizontalPageBreak:R,horizontalPageBreakRepeat:I,horizontalPageBreakBehaviour:(g=e.horizontalPageBreakBehaviour)!==null&&g!==void 0?g:"afterAllRows"}}function qz(t,e){var n=t.getLastAutoTable(),r=t.scaleFactor(),a=t.pageNumber(),s=!1;if(n&&n.startPageNumber){var l=n.startPageNumber+n.pageNumber-1;s=l===a}return typeof e=="number"?e:(e==null||e===!1)&&s&&(n==null?void 0:n.finalY)!=null?n.finalY+20/r:null}function Hz(t,e,n){var r=e.head||[],a=e.body||[],s=e.foot||[];if(e.html){var l=e.includeHiddenHtml;if(n){var u=WA(t,e.html,n,l,e.useCss)||{};r=u.head||r,a=u.body||r,s=u.foot||r}else console.error("Cannot parse html in non browser environment")}var c=e.columns||Vz(r,a,s);return{columns:c,head:r,body:a,foot:s}}function Vz(t,e,n){var r=t[0]||e[0]||n[0]||[],a=[];return Object.keys(r).filter(function(s){return s!=="_element"}).forEach(function(s){var l=1,u;Array.isArray(r)?u=r[parseInt(s)]:u=r[s],typeof u=="object"&&!Array.isArray(u)&&(l=(u==null?void 0:u.colSpan)||1);for(var c=0;c<l;c++){var h=void 0;Array.isArray(r)?h=a.length:h=s+(c>0?"_".concat(c):"");var d={dataKey:h};a.push(d)}}),a}var Ny=(function(){function t(e,n,r){this.table=n,this.pageNumber=n.pageNumber,this.settings=n.settings,this.cursor=r,this.doc=e.getDocument()}return t})(),Gz=(function(t){$A(e,t);function e(n,r,a,s,l,u){var c=t.call(this,n,r,u)||this;return c.cell=a,c.row=s,c.column=l,c.section=s.section,c}return e})(Ny),Wz=(function(){function t(e,n){this.pageNumber=1,this.id=e.id,this.settings=e.settings,this.styles=e.styles,this.hooks=e.hooks,this.columns=n.columns,this.head=n.head,this.body=n.body,this.foot=n.foot}return t.prototype.getHeadHeight=function(e){return this.head.reduce(function(n,r){return n+r.getMaxCellHeight(e)},0)},t.prototype.getFootHeight=function(e){return this.foot.reduce(function(n,r){return n+r.getMaxCellHeight(e)},0)},t.prototype.allRows=function(){return this.head.concat(this.body).concat(this.foot)},t.prototype.callCellHooks=function(e,n,r,a,s,l){for(var u=0,c=n;u<c.length;u++){var h=c[u],d=new Gz(e,this,r,a,s,l),m=h(d)===!1;if(r.text=Array.isArray(r.text)?r.text:[r.text],m)return!1}return!0},t.prototype.callEndPageHooks=function(e,n){e.applyStyles(e.userStyles);for(var r=0,a=this.hooks.didDrawPage;r<a.length;r++){var s=a[r];s(new Ny(e,this,n))}},t.prototype.callWillDrawPageHooks=function(e,n){for(var r=0,a=this.hooks.willDrawPage;r<a.length;r++){var s=a[r];s(new Ny(e,this,n))}},t.prototype.getWidth=function(e){if(typeof this.settings.tableWidth=="number")return this.settings.tableWidth;if(this.settings.tableWidth==="wrap"){var n=this.columns.reduce(function(a,s){return a+s.wrappedWidth},0);return n}else{var r=this.settings.margin;return e-r.left-r.right}},t})(),KA=(function(){function t(e,n,r,a,s){s===void 0&&(s=!1),this.height=0,this.raw=e,e instanceof zA&&(this.raw=e._element,this.element=e._element),this.index=n,this.section=r,this.cells=a,this.spansMultiplePages=s}return t.prototype.getMaxCellHeight=function(e){var n=this;return e.reduce(function(r,a){var s;return Math.max(r,((s=n.cells[a.index])===null||s===void 0?void 0:s.height)||0)},0)},t.prototype.hasRowSpan=function(e){var n=this;return e.filter(function(r){var a=n.cells[r.index];return a?a.rowSpan>1:!1}).length>0},t.prototype.canEntireRowFit=function(e,n){return this.getMaxCellHeight(n)<=e},t.prototype.getMinimumRowHeight=function(e,n){var r=this;return e.reduce(function(a,s){var l=r.cells[s.index];if(!l)return 0;var u=n.getLineHeight(l.styles.fontSize),c=l.padding("vertical"),h=c+u;return h>a?h:a},0)},t})(),JA=(function(){function t(e,n,r){var a;this.contentHeight=0,this.contentWidth=0,this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.height=0,this.x=0,this.y=0,this.styles=n,this.section=r,this.raw=e;var s=e;e!=null&&typeof e=="object"&&!Array.isArray(e)?(this.rowSpan=e.rowSpan||1,this.colSpan=e.colSpan||1,s=(a=e.content)!==null&&a!==void 0?a:e,e._element&&(this.raw=e._element)):(this.rowSpan=1,this.colSpan=1);var l=s!=null?""+s:"",u=/\r\n|\r|\n/g;this.text=l.split(u)}return t.prototype.getTextPos=function(){var e;if(this.styles.valign==="top")e=this.y+this.padding("top");else if(this.styles.valign==="bottom")e=this.y+this.height-this.padding("bottom");else{var n=this.height-this.padding("vertical");e=this.y+n/2+this.padding("top")}var r;if(this.styles.halign==="right")r=this.x+this.width-this.padding("right");else if(this.styles.halign==="center"){var a=this.width-this.padding("horizontal");r=this.x+a/2+this.padding("left")}else r=this.x+this.padding("left");return{x:r,y:e}},t.prototype.getContentHeight=function(e,n){n===void 0&&(n=1.15);var r=Array.isArray(this.text)?this.text.length:1,a=this.styles.fontSize/e*n,s=r*a+this.padding("vertical");return Math.max(s,this.styles.minCellHeight)},t.prototype.padding=function(e){var n=Gg(this.styles.cellPadding,0);return e==="vertical"?n.top+n.bottom:e==="horizontal"?n.left+n.right:n[e]},t})(),Yz=(function(){function t(e,n,r){this.wrappedWidth=0,this.minReadableWidth=0,this.minWidth=0,this.width=0,this.dataKey=e,this.raw=n,this.index=r}return t.prototype.getMaxCustomCellWidth=function(e){for(var n=0,r=0,a=e.allRows();r<a.length;r++){var s=a[r],l=s.cells[this.index];l&&typeof l.styles.cellWidth=="number"&&(n=Math.max(n,l.styles.cellWidth))}return n},t})();function Kz(t,e){Jz(t,e);var n=[],r=0;e.columns.forEach(function(s){var l=s.getMaxCustomCellWidth(e);l?s.width=l:(s.width=s.wrappedWidth,n.push(s)),r+=s.width});var a=e.getWidth(t.pageSize().width)-r;a&&(a=Cy(n,a,function(s){return Math.max(s.minReadableWidth,s.minWidth)})),a&&(a=Cy(n,a,function(s){return s.minWidth})),a=Math.abs(a),!e.settings.horizontalPageBreak&&a>.1/t.scaleFactor()&&(a=a<1?a:Math.round(a),console.log("Of the table content, ".concat(a," units width could not fit page"))),Zz(e),Qz(e,t),Xz(e)}function Jz(t,e){var n=t.scaleFactor(),r=e.settings.horizontalPageBreak,a=VA(t,e);e.allRows().forEach(function(s){for(var l=0,u=e.columns;l<u.length;l++){var c=u[l],h=s.cells[c.index];if(h){var d=e.hooks.didParseCell;e.callCellHooks(t,d,h,s,c,null);var m=h.padding("horizontal");h.contentWidth=gg(h.text,h.styles,t)+m;var y=gg(h.text.join(" ").split(/[^\S\u00A0]+/),h.styles,t);if(h.minReadableWidth=y+h.padding("horizontal"),typeof h.styles.cellWidth=="number")h.minWidth=h.styles.cellWidth,h.wrappedWidth=h.styles.cellWidth;else if(h.styles.cellWidth==="wrap"||r===!0)h.contentWidth>a?(h.minWidth=a,h.wrappedWidth=a):(h.minWidth=h.contentWidth,h.wrappedWidth=h.contentWidth);else{var g=10/n;h.minWidth=h.styles.minCellWidth||g,h.wrappedWidth=h.contentWidth,h.minWidth>h.wrappedWidth&&(h.wrappedWidth=h.minWidth)}}}}),e.allRows().forEach(function(s){for(var l=0,u=e.columns;l<u.length;l++){var c=u[l],h=s.cells[c.index];if(h&&h.colSpan===1)c.wrappedWidth=Math.max(c.wrappedWidth,h.wrappedWidth),c.minWidth=Math.max(c.minWidth,h.minWidth),c.minReadableWidth=Math.max(c.minReadableWidth,h.minReadableWidth);else{var d=e.styles.columnStyles[c.dataKey]||e.styles.columnStyles[c.index]||{},m=d.cellWidth||d.minCellWidth;m&&typeof m=="number"&&(c.minWidth=m,c.wrappedWidth=m)}h&&(h.colSpan>1&&!c.minWidth&&(c.minWidth=h.minWidth),h.colSpan>1&&!c.wrappedWidth&&(c.wrappedWidth=h.minWidth))}})}function Cy(t,e,n){for(var r=e,a=t.reduce(function(g,x){return g+x.wrappedWidth},0),s=0;s<t.length;s++){var l=t[s],u=l.wrappedWidth/a,c=r*u,h=l.width+c,d=n(l),m=h<d?d:h;e-=m-l.width,l.width=m}if(e=Math.round(e*1e10)/1e10,e){var y=t.filter(function(g){return e<0?g.width>n(g):!0});y.length&&(e=Cy(y,e,n))}return e}function Xz(t){for(var e={},n=1,r=t.allRows(),a=0;a<r.length;a++)for(var s=r[a],l=0,u=t.columns;l<u.length;l++){var c=u[l],h=e[c.index];if(n>1)n--,delete s.cells[c.index];else if(h)h.cell.height+=s.height,n=h.cell.colSpan,delete s.cells[c.index],h.left--,h.left<=1&&delete e[c.index];else{var d=s.cells[c.index];if(!d)continue;if(d.height=s.height,d.rowSpan>1){var m=r.length-a,y=d.rowSpan>m?m:d.rowSpan;e[c.index]={cell:d,left:y,row:s}}}}}function Zz(t){for(var e=t.allRows(),n=0;n<e.length;n++)for(var r=e[n],a=null,s=0,l=0,u=0;u<t.columns.length;u++){var c=t.columns[u];if(l-=1,l>1&&t.columns[u+1])s+=c.width,delete r.cells[c.index];else if(a){var h=a;delete r.cells[c.index],a=null,h.width=c.width+s}else{var h=r.cells[c.index];if(!h)continue;if(l=h.colSpan,s=0,h.colSpan>1){a=h,s+=c.width;continue}h.width=c.width+s}}}function Qz(t,e){for(var n={count:0,height:0},r=0,a=t.allRows();r<a.length;r++){for(var s=a[r],l=0,u=t.columns;l<u.length;l++){var c=u[l],h=s.cells[c.index];if(h){e.applyStyles(h.styles,!0);var d=h.width-h.padding("horizontal");if(h.styles.overflow==="linebreak")h.text=e.splitTextToSize(h.text,d+1/e.scaleFactor(),{fontSize:h.styles.fontSize});else if(h.styles.overflow==="ellipsize")h.text=q_(h.text,d,h.styles,e,"...");else if(h.styles.overflow==="hidden")h.text=q_(h.text,d,h.styles,e,"");else if(typeof h.styles.overflow=="function"){var m=h.styles.overflow(h.text,d);typeof m=="string"?h.text=[m]:h.text=m}h.contentHeight=h.getContentHeight(e.scaleFactor(),e.getLineHeightFactor());var y=h.contentHeight/h.rowSpan;h.rowSpan>1&&n.count*n.height<y*h.rowSpan?n={height:y,count:h.rowSpan}:n&&n.count>0&&n.height>y&&(y=n.height),y>s.height&&(s.height=y)}}n.count--}}function q_(t,e,n,r,a){return t.map(function(s){return eq(s,e,n,r,a)})}function eq(t,e,n,r,a){var s=1e4*r.scaleFactor();if(e=Math.ceil(e*s)/s,e>=gg(t,n,r))return t;for(;e<gg(t+a,n,r)&&!(t.length<=1);)t=t.substring(0,t.length-1);return t.trim()+a}function XA(t,e){var n=new $f(t),r=tq(e,n.scaleFactor()),a=new Wz(e,r);return Kz(n,a),n.applyStyles(n.userStyles),a}function tq(t,e){var n=t.content,r=rq(n.columns);if(n.head.length===0){var a=H_(r,"head");a&&n.head.push(a)}if(n.foot.length===0){var a=H_(r,"foot");a&&n.foot.push(a)}var s=t.settings.theme,l=t.styles;return{columns:r,head:bv("head",n.head,r,l,s,e),body:bv("body",n.body,r,l,s,e),foot:bv("foot",n.foot,r,l,s,e)}}function bv(t,e,n,r,a,s){var l={},u=e.map(function(c,h){for(var d=0,m={},y=0,g=0,x=0,_=n;x<_.length;x++){var N=_[x];if(l[N.index]==null||l[N.index].left===0)if(g===0){var A=void 0;Array.isArray(c)?A=c[N.index-y-d]:A=c[N.dataKey];var j={};typeof A=="object"&&!Array.isArray(A)&&(j=(A==null?void 0:A.styles)||{});var L=aq(t,N,h,a,r,s,j),R=new JA(A,L,t);m[N.dataKey]=R,m[N.index]=R,g=R.colSpan-1,l[N.index]={left:R.rowSpan-1,times:g}}else g--,y++;else l[N.index].left--,g=l[N.index].times,d++}return new KA(c,h,t,m)});return u}function H_(t,e){var n={};return t.forEach(function(r){if(r.raw!=null){var a=nq(e,r.raw);a!=null&&(n[r.dataKey]=a)}}),Object.keys(n).length>0?n:null}function nq(t,e){if(t==="head"){if(typeof e=="object")return e.header||null;if(typeof e=="string"||typeof e=="number")return e}else if(t==="foot"&&typeof e=="object")return e.footer;return null}function rq(t){return t.map(function(e,n){var r,a;return typeof e=="object"?a=(r=e.dataKey)!==null&&r!==void 0?r:n:a=n,new Yz(a,e,n)})}function aq(t,e,n,r,a,s,l){var u=kz(r),c;t==="head"?c=a.headStyles:t==="body"?c=a.bodyStyles:t==="foot"&&(c=a.footStyles);var h=kl({},u.table,u[t],a.styles,c),d=a.columnStyles[e.dataKey]||a.columnStyles[e.index]||{},m=t==="body"?d:{},y=t==="body"&&n%2===0?kl({},u.alternateRow,a.alternateRowStyles):{},g=Rz(s),x=kl({},g,h,y,m);return kl(x,l)}function iq(t,e,n){var r;n===void 0&&(n={});var a=VA(t,e),s=new Map,l=[],u=[],c=[];Array.isArray(e.settings.horizontalPageBreakRepeat)?c=e.settings.horizontalPageBreakRepeat:(typeof e.settings.horizontalPageBreakRepeat=="string"||typeof e.settings.horizontalPageBreakRepeat=="number")&&(c=[e.settings.horizontalPageBreakRepeat]),c.forEach(function(y){var g=e.columns.find(function(x){return x.dataKey===y||x.index===y});g&&!s.has(g.index)&&(s.set(g.index,!0),l.push(g.index),u.push(e.columns[g.index]),a-=g.wrappedWidth)});for(var h=!0,d=(r=n==null?void 0:n.start)!==null&&r!==void 0?r:0;d<e.columns.length;){if(s.has(d)){d++;continue}var m=e.columns[d].wrappedWidth;if(h||a>=m)h=!1,l.push(d),u.push(e.columns[d]),a-=m;else break;d++}return{colIndexes:l,columns:u,lastIndex:d-1}}function sq(t,e){for(var n=[],r=0;r<e.columns.length;r++){var a=iq(t,e,{start:r});a.columns.length&&(n.push(a),r=a.lastIndex)}return n}function ZA(t,e){var n=e.settings,r=n.startY,a=n.margin,s={x:a.left,y:r},l=e.getHeadHeight(e.columns)+e.getFootHeight(e.columns),u=r+a.bottom+l;if(n.pageBreak==="avoid"){var c=e.body,h=c.reduce(function(y,g){return y+g.height},0);u+=h}var d=new $f(t);(n.pageBreak==="always"||n.startY!=null&&u>d.pageSize().height)&&(e6(d),s.y=a.top),e.callWillDrawPageHooks(d,s);var m=kl({},s);e.startPageNumber=d.pageNumber(),n.horizontalPageBreak?oq(d,e,m,s):(d.applyStyles(d.userStyles),(n.showHead==="firstPage"||n.showHead==="everyPage")&&e.head.forEach(function(y){return Il(d,e,y,s,e.columns)}),d.applyStyles(d.userStyles),e.body.forEach(function(y,g){var x=g===e.body.length-1;vg(d,e,y,x,m,s,e.columns)}),d.applyStyles(d.userStyles),(n.showFoot==="lastPage"||n.showFoot==="everyPage")&&e.foot.forEach(function(y){return Il(d,e,y,s,e.columns)})),qA(d,e,m,s),e.callEndPageHooks(d,s),e.finalY=s.y,t.lastAutoTable=e,d.applyStyles(d.userStyles)}function oq(t,e,n,r){var a=sq(t,e),s=e.settings;if(s.horizontalPageBreakBehaviour==="afterAllRows")a.forEach(function(h,d){t.applyStyles(t.userStyles),d>0?sd(t,e,n,r,h.columns,!0):V_(t,e,r,h.columns),lq(t,e,n,r,h.columns),wv(t,e,r,h.columns)});else for(var l=-1,u=a[0],c=function(){var h=l;if(u){t.applyStyles(t.userStyles);var d=u.columns;l>=0?sd(t,e,n,r,d,!0):V_(t,e,r,d),h=G_(t,e,l+1,r,d),wv(t,e,r,d)}var m=h-l;a.slice(1).forEach(function(y){t.applyStyles(t.userStyles),sd(t,e,n,r,y.columns,!0),G_(t,e,l+1,r,y.columns,m),wv(t,e,r,y.columns)}),l=h};l<e.body.length-1;)c()}function V_(t,e,n,r){var a=e.settings;t.applyStyles(t.userStyles),(a.showHead==="firstPage"||a.showHead==="everyPage")&&e.head.forEach(function(s){return Il(t,e,s,n,r)})}function lq(t,e,n,r,a){t.applyStyles(t.userStyles),e.body.forEach(function(s,l){var u=l===e.body.length-1;vg(t,e,s,u,n,r,a)})}function G_(t,e,n,r,a,s){t.applyStyles(t.userStyles),s=s??e.body.length;for(var l=Math.min(n+s,e.body.length),u=-1,c=e.body.slice(n,l),h=0;h<c.length;h++){var d=c[h],m=n+h===e.body.length-1,y=QA(t,e,m,r);if(d.canEntireRowFit(y,a))Il(t,e,d,r,a),u=n+h;else break}return u}function wv(t,e,n,r){var a=e.settings;t.applyStyles(t.userStyles),(a.showFoot==="lastPage"||a.showFoot==="everyPage")&&e.foot.forEach(function(s){return Il(t,e,s,n,r)})}function uq(t,e,n){var r=n.getLineHeight(t.styles.fontSize),a=t.padding("vertical"),s=Math.floor((e-a)/r);return Math.max(0,s)}function cq(t,e,n,r){var a={};t.spansMultiplePages=!0,t.height=0;for(var s=0,l=0,u=n.columns;l<u.length;l++){var c=u[l],h=t.cells[c.index];if(h){Array.isArray(h.text)||(h.text=[h.text]);var d=new JA(h.raw,h.styles,h.section);d=kl(d,h),d.text=[];var m=uq(h,e,r);h.text.length>m&&(d.text=h.text.splice(m,h.text.length));var y=r.scaleFactor(),g=r.getLineHeightFactor();h.contentHeight=h.getContentHeight(y,g),h.contentHeight>=e&&(h.contentHeight=e,d.styles.minCellHeight-=e),h.contentHeight>t.height&&(t.height=h.contentHeight),d.contentHeight=d.getContentHeight(y,g),d.contentHeight>s&&(s=d.contentHeight),a[c.index]=d}}var x=new KA(t.raw,-1,t.section,a,!0);x.height=s;for(var _=0,N=n.columns;_<N.length;_++){var c=N[_],d=x.cells[c.index];d&&(d.height=x.height);var h=t.cells[c.index];h&&(h.height=t.height)}return x}function fq(t,e,n,r){var a=t.pageSize().height,s=r.settings.margin,l=s.top+s.bottom,u=a-l;e.section==="body"&&(u-=r.getHeadHeight(r.columns)+r.getFootHeight(r.columns));var c=e.getMinimumRowHeight(r.columns,t),h=c<n;if(c>u)return console.log("Will not be able to print row ".concat(e.index," correctly since it's minimum height is larger than page height")),!0;if(!h)return!1;var d=e.hasRowSpan(r.columns),m=e.getMaxCellHeight(r.columns)>u;return m?(d&&console.log("The content of row ".concat(e.index," will not be drawn correctly since drawing rows with a height larger than the page height and has cells with rowspans is not supported.")),!0):!(d||r.settings.rowPageBreak==="avoid")}function vg(t,e,n,r,a,s,l){var u=QA(t,e,r,s);if(n.canEntireRowFit(u,l))Il(t,e,n,s,l);else if(fq(t,n,u,e)){var c=cq(n,u,e,t);Il(t,e,n,s,l),sd(t,e,a,s,l),vg(t,e,c,r,a,s,l)}else sd(t,e,a,s,l),vg(t,e,n,r,a,s,l)}function Il(t,e,n,r,a){r.x=e.settings.margin.left;for(var s=0,l=a;s<l.length;s++){var u=l[s],c=n.cells[u.index];if(!c){r.x+=u.width;continue}t.applyStyles(c.styles),c.x=r.x,c.y=r.y;var h=e.callCellHooks(t,e.hooks.willDrawCell,c,n,u,r);if(h===!1){r.x+=u.width;continue}hq(t,c,r);var d=c.getTextPos();BA(c.text,d.x,d.y,{halign:c.styles.halign,valign:c.styles.valign,maxWidth:Math.ceil(c.width-c.padding("left")-c.padding("right"))},t.getDocument()),e.callCellHooks(t,e.hooks.didDrawCell,c,n,u,r),r.x+=u.width}r.y+=n.height}function hq(t,e,n){var r=e.styles;if(t.getDocument().setFillColor(t.getDocument().getFillColor()),typeof r.lineWidth=="number"){var a=HA(r.lineWidth,r.fillColor);a&&t.rect(e.x,n.y,e.width,e.height,a)}else typeof r.lineWidth=="object"&&(r.fillColor&&t.rect(e.x,n.y,e.width,e.height,"F"),dq(t,e,n,r.lineWidth))}function dq(t,e,n,r){var a,s,l,u;r.top&&(a=n.x,s=n.y,l=n.x+e.width,u=n.y,r.right&&(l+=.5*r.right),r.left&&(a-=.5*r.left),c(r.top,a,s,l,u)),r.bottom&&(a=n.x,s=n.y+e.height,l=n.x+e.width,u=n.y+e.height,r.right&&(l+=.5*r.right),r.left&&(a-=.5*r.left),c(r.bottom,a,s,l,u)),r.left&&(a=n.x,s=n.y,l=n.x,u=n.y+e.height,r.top&&(s-=.5*r.top),r.bottom&&(u+=.5*r.bottom),c(r.left,a,s,l,u)),r.right&&(a=n.x+e.width,s=n.y,l=n.x+e.width,u=n.y+e.height,r.top&&(s-=.5*r.top),r.bottom&&(u+=.5*r.bottom),c(r.right,a,s,l,u));function c(h,d,m,y,g){t.getDocument().setLineWidth(h),t.getDocument().line(d,m,y,g,"S")}}function QA(t,e,n,r){var a=e.settings.margin.bottom,s=e.settings.showFoot;return(s==="everyPage"||s==="lastPage"&&n)&&(a+=e.getFootHeight(e.columns)),t.pageSize().height-r.y-a}function sd(t,e,n,r,a,s){a===void 0&&(a=[]),s===void 0&&(s=!1),t.applyStyles(t.userStyles),e.settings.showFoot==="everyPage"&&!s&&e.foot.forEach(function(u){return Il(t,e,u,r,a)}),e.callEndPageHooks(t,r);var l=e.settings.margin;qA(t,e,n,r),e6(t),e.pageNumber++,r.x=l.left,r.y=l.top,n.y=l.top,e.callWillDrawPageHooks(t,r),e.settings.showHead==="everyPage"&&(e.head.forEach(function(u){return Il(t,e,u,r,a)}),t.applyStyles(t.userStyles))}function e6(t){var e=t.pageNumber();t.setPage(e+1);var n=t.pageNumber();return n===e?(t.addPage(),!0):!1}function pq(t){t.API.autoTable=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0],a=YA(this,r),s=XA(this,a);return ZA(this,s),this},t.API.lastAutoTable=!1,t.API.autoTableText=function(e,n,r,a){BA(e,n,r,a,this)},t.API.autoTableSetDefaults=function(e){return $f.setDefaults(e,this),this},t.autoTableSetDefaults=function(e,n){$f.setDefaults(e,n)},t.API.autoTableHtmlToJson=function(e,n){var r;if(n===void 0&&(n=!1),typeof window>"u")return console.error("Cannot run autoTableHtmlToJson in non browser environment"),null;var a=new $f(this),s=WA(a,e,window,n,!1),l=s.head,u=s.body,c=((r=l[0])===null||r===void 0?void 0:r.map(function(h){return h.content}))||[];return{columns:c,rows:u,data:u}}}var xv;function mq(t,e){var n=YA(t,e),r=XA(t,n);ZA(t,r)}try{if(typeof window<"u"&&window){var W_=window,Y_=W_.jsPDF||((xv=W_.jspdf)===null||xv===void 0?void 0:xv.jsPDF);Y_&&pq(Y_)}}catch(t){console.error("Could not apply autoTable plugin",t)}const K_=()=>E.jsx("div",{className:"flex items-center justify-center h-full",children:E.jsx("div",{className:"w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin"})}),gq=({onCSV:t,onPDF:e,onCancel:n,downloading:r})=>{const{t:a}=Ar();return E.jsx("div",{className:"fixed inset-0 bg-black/50 flex justify-center items-center z-50",children:E.jsx("div",{className:"bg-white rounded-lg p-6 max-w-xs w-full shadow-lg",children:E.jsxs("div",{className:"flex flex-col gap-3",children:[E.jsx("button",{className:"bg-green-600 text-white rounded py-2 font-medium hover:cursor-pointer",onClick:t,disabled:r,children:r?E.jsx(K_,{}):a("SAVE AS CSV")}),E.jsx("button",{className:"bg-blue-600 text-white rounded py-2 font-medium hover:cursor-pointer",onClick:e,disabled:r,children:r?E.jsx(K_,{}):a("SAVE AS PDF")}),E.jsx("button",{className:"text-gray-500 mt-2 hover:cursor-pointer",onClick:n,disabled:r,children:a("CANCEL")})]})})})},vq=t=>new Promise((e,n)=>{const r=new Image;r.crossOrigin="anonymous",r.onload=()=>{const a=document.createElement("canvas");a.width=r.width,a.height=r.height;const s=a.getContext("2d");if(!s){n("Canvas context is null");return}s.drawImage(r,0,0);try{const l=a.toDataURL("image/png");e(l)}catch(l){n("Failed to convert image to base64: "+l)}},r.onerror=a=>n("Image load error: "+a),r.src=t}),t6="prayerApp",zf="prayer_ranges";async function yq(t,e){await(await Xr(t6,1,{upgrade(r){r.objectStoreNames.contains(zf)||r.createObjectStore(zf,{keyPath:"key"})}})).put(zf,{key:t,data:e,timestamp:Date.now()})}async function bq(t){const n=await(await Xr(t6,1,{upgrade(r){r.objectStoreNames.contains(zf)||r.createObjectStore(zf,{keyPath:"key"})}})).get(zf,t);return n&&Date.now()-n.timestamp<1440*60*1e3?n:null}function wq({locationId:t,periodFrom:e,periodTo:n,asrMethod:r,prayerMethod:a}){const[s,l]=D.useState([]),[u,c]=D.useState(!1),h=async(m=!0)=>{m&&c(!1);const y=vx(e),g=vx(n),x=`prayer_range_${t}_${y}_${g}`;try{const _=await bq(x);if(_&&l(_.data),!navigator.onLine){m&&c(!0);return}const N=new AbortController,A=setTimeout(()=>N.abort(),1e4),j=await Promise.race([tP(t,y,g,r,a),new Promise((L,R)=>setTimeout(()=>R(new Error("Request timeout")),1e4))]);clearTimeout(A),N.abort(),l(j),await yq(x,j)}catch(_){console.error("Error fetching prayer times range: ",_),await aa(_,{message:"Error fetching prayer times range",function:"usePrayerTimesRange"}),_.name==="AbortError"||_.message.includes("timeout")?Rn("warning","Slow connection, showing cached data"):Rn("error","An unexpected error occured!")}finally{m&&c(!0)}};return D.useEffect(()=>{h(!0)},[t,e,n,r,a]),D.useEffect(()=>{if(!navigator.onLine)return;let m=null;return m=ot.channel(`prayer_times_range:${t}`).on("postgres_changes",{event:"*",schema:"public",table:"prayertime",filter:`location_iso=eq.${t}`},()=>{h(!1)}).subscribe(),()=>{m==null||m.unsubscribe()}},[t]),{prayerTimes:s,ready:u,refetch:()=>h(!0)}}const J_={7:{text:"text-white",footer:"text-[#27391C]",button:"bg-[#D9D9D9] text-[#27391C] mb-3 mr-3"},8:{text:"text-[#543A14]",footer:"text-[#543A14]",button:"bg-[#F0BB78] text-[#27391C] mb-3 mr-3"},9:{text:"text-[#E5D0AC]",footer:"text-[#6D2323]",button:"bg-[#E5D0AC] text-[#27391C] mb-3 mr-3"}},n6=({isView:t})=>{const{language:e,colorScheme:n,locationId:r,selectedMosque:a,periodFrom:s,periodTo:l,asrMethod:u,prayerMethod:c}=vi(),[h,d]=D.useState(!1),[m,y]=D.useState(!1),g=Bi(),{org_nr:x}=ia(),{t:_}=Ar(),N=e==="ar",{udThemeId:A}=Bd(x),{masjidName:j,masjidLogo:L,masjidAddress:R,masjidContact:I}=Pd(a==null?void 0:a.value),ee=n.isDefault,G=J_[A]||J_[7],{prayerTimes:P,ready:B}=wq({locationId:r,periodFrom:s,periodTo:l,asrMethod:u,prayerMethod:c}),X=()=>{if(y(!0),P.length===0){Rn("error","No prayer times to download."),y(!1),d(!1);return}const K=["Date","Fajr","Sunrise","Dhuhr","Asr","Maghrib","Isha"],Y=P.map(pe=>[new Date(pe.date).toLocaleDateString("en-IN"),pe.fajr,pe.sunrise,pe.dhuhr,pe.asr,pe.maghrib,pe.isha]),he=[K,...Y].map(pe=>pe.join(",")).join(`
|
|
1169
|
+
`),te=new Blob([he],{type:"text/csv;charset=utf-8;"}),oe=URL.createObjectURL(te),le=document.createElement("a");le.href=oe,le.setAttribute("download",`prayer-timetable-${new Date().toISOString().slice(0,10)}.csv`),document.body.appendChild(le),le.click(),document.body.removeChild(le),URL.revokeObjectURL(oe),y(!1),d(!1)},F=async()=>{if(y(!0),P.length===0){Rn("error","No prayer times to download."),y(!1),d(!1);return}const K=new jt({orientation:"portrait",unit:"mm",format:[210,350]}),Y=K.internal.pageSize.getWidth();let he="/img/IRN-logo.png";if(L)try{he=L!=null&&L.startsWith("http")?await vq(L):`data:image/png;base64,${L}`}catch(z){console.warn("Could not convert mosque logo to base64, using fallback.",z)}try{K.addImage(he,"PNG",14,8,30,20)}catch(z){console.warn("Error adding logo to PDF:",z)}const te=12,oe=14,le=[j||"Islamic Resource Network",R||"Contact us: info@irn.no",I||"Phone: +47 123 456 789"].filter(Boolean);K.setFontSize(14);const pe=K.getFont().fontName;K.setFont(pe,"bold");const Ne=le[0];let U=K.getTextWidth(Ne);K.text(Ne,Y-oe-U,te),K.setFontSize(10),K.setFont(pe,"normal");let O=7;for(let z=1;z<le.length;z++){const se=le[z],ge=K.getTextWidth(se);K.text(se,Y-oe-ge,te+O*z)}K.setFontSize(16),K.text("Prayer Timetable",14,50);const V=["Date","Fajr","Sunrise","Dhuhr","Asr","Maghrib","Isha"],Z=P.map(z=>[new Date(z.date).toLocaleDateString("en-IN"),z.fajr,z.sunrise,z.dhuhr,z.asr,z.maghrib,z.isha]);mq(K,{startY:40,head:[V],body:Z,styles:{fontSize:10,cellPadding:2},headStyles:{fillColor:[58,125,68]}});const ie=`prayer-timetable-${new Date().toISOString().slice(0,10)}.pdf`;K.save(ie),y(!1),d(!1)},$=K=>{const Y=new Date(K),he=Y.getDate().toString().padStart(2,"0"),te=(Y.getMonth()+1).toString().padStart(2,"0"),oe=Y.getFullYear().toString().slice(-2);return`${he}-${te}-${oe}`};return B?E.jsxs("div",{className:"w-full h-full font-DM flex flex-col justify-between",style:{direction:N?"rtl":"ltr"},children:[E.jsxs("div",{className:"flex-1 border shadow-md rounded-xl px-4 py-1 mb-2 backdrop-blur-md flex flex-col justify-between",style:{color:ee?G.text:n.prayerTimesColor.text,backgroundColor:t?ee?"#ffffff33":n.prayerTimesColor.bg:"#F8F5E9"},children:[t&&!a?E.jsx("div",{className:"flex justify-center items-center py-3 border-b border-[#0000004D]",children:E.jsx("span",{className:`font-medium ${G.text}`,children:"Prayer Timetable"})}):E.jsxs("div",{className:"border-b border-[#0000004D] flex justify-between items-center py-3",children:[t?E.jsx("span",{className:"text-sm sm:text-base font-medium",children:_("PRAYER TIMETABLE")}):E.jsx("img",{src:L!=null&&L.startsWith("http")?L:L?`data:image/png;base64,${L}`:"/default-logo.png",alt:"logo",className:"h-12"}),t?E.jsx("p",{className:`text-sm sm:text-base font-medium ${N?"text-left":"text-right"}`,children:j}):E.jsxs("p",{className:`text-sm font-semibold ${N?"text-left":"text-right"}`,children:[R," ",E.jsx("br",{}),I]})]}),E.jsx("div",{className:"flex-1 overflow-auto px-2",children:E.jsxs("table",{className:"w-full text-sm text-left text-black border-collapse",children:[E.jsx("thead",{className:"bg-white text-xs font-bold border-b border-black/30",children:E.jsxs("tr",{children:[E.jsx("th",{className:`px-4 py-2 ${N?"text-right":"text-left"}`,children:_("DATE")}),E.jsx("th",{className:"px-4 py-2",children:_("FAJR")}),E.jsx("th",{className:"px-4 py-2",children:_("SUNRISE")}),E.jsx("th",{className:"px-4 py-2",children:_("DHUHR")}),E.jsx("th",{className:"px-4 py-2",children:_("ASR")}),E.jsx("th",{className:"px-4 py-2",children:_("MAGHRIB")}),E.jsx("th",{className:"px-4 py-2",children:_("ISHA")})]})}),B?E.jsx("tbody",{children:P.length===0?E.jsx("tr",{children:E.jsx("td",{colSpan:7,className:"text-center py-4",children:"No prayer times available"})}):P.map((K,Y)=>E.jsxs("tr",{className:"border-b bg-white/70",children:[E.jsx("td",{className:`px-4 py-2 font-semibold ${N?"text-right":"text-left"} whitespace-nowrap`,children:$(K.date)}),E.jsx("td",{className:"px-4 py-2",children:K.fajr}),E.jsx("td",{className:"px-4 py-2",children:K.sunrise}),E.jsx("td",{className:"px-4 py-2",children:K.dhuhr}),E.jsx("td",{className:"px-4 py-2",children:K.asr}),E.jsx("td",{className:"px-4 py-2",children:K.maghrib}),E.jsx("td",{className:"px-4 py-2",children:K.isha})]},K.date||Y))}):E.jsx("tbody",{children:E.jsx("tr",{children:E.jsx("td",{colSpan:7,children:E.jsx("div",{className:"flex justify-center items-center h-[200px] w-full",children:E.jsx(qf,{})})})})})]})}),E.jsx("div",{className:"border-t border-[#0000004D] h-9 flex justify-center items-center",children:E.jsx("span",{className:"text-sm font-semibold",children:!t&&"irn.no"})})]}),E.jsx("div",{className:"mt-3 flex justify-end",children:E.jsx("button",{className:`${G.button} rounded-lg py-2 px-4 text-xs font-medium hover:cursor-pointer`,style:{color:ee?"":n.bgColor,backgroundColor:ee?"":n.textColor},onClick:()=>{t?g(`/${(a==null?void 0:a.value)||982842840}/download-timetable`):d(!0)},children:_(t?"DOWNLOAD TIMETABLE":"DOWNLOAD (CSV/PDF)")})}),h&&E.jsx(gq,{onCSV:X,onPDF:F,onCancel:()=>d(!1),downloading:m})]}):E.jsx(qf,{})},xq={7:{text:"text-white"},8:{text:"text-[#543A14]",backgroundImage:"/img/ud/bg2.png",overlayOpacityClass:"",backgroundColorClass:"bg-[#FFF0DC]/90"},9:{text:"text-[#E5D0AC]",backgroundImage:"/img/ud/bg3.png",overlayOpacityClass:"",backgroundColorClass:"bg-[#6D2323]/97"}},Sq={text:"text-black"},_q=()=>{const{colorScheme:t}=vi(),e=Bi(),{org_nr:n}=ia(),{udThemeId:r}=Bd(n),a=xq[r]||Sq;return E.jsxs("div",{className:`relative w-full h-screen ${a.text}`,style:{color:t.textColor},children:[E.jsx("div",{className:"absolute inset-0 bg-center pointer-events-none",style:{backgroundImage:t.bgImage?`url('${t.bgImage}')`:void 0,backgroundRepeat:t.bgRepeat??"",backgroundSize:t.bgRepeat?"":"cover",opacity:t.bgOpacity,filter:t.bgRepeat?"":"blur(8px)"}}),E.jsxs("div",{className:"relative h-full z-10 p-4 flex flex-col",style:{backgroundColor:t.bgColor},children:[E.jsxs("div",{className:"flex flex-col",children:[E.jsx(Ud,{isHome:!1}),E.jsxs("div",{className:"flex justify-between gap-3 mt-3 mb-3",children:[E.jsx("button",{onClick:()=>e(-1),className:"w-6 h-6 rounded-md flex items-center justify-center mt-2",style:{backgroundColor:t.textColor,color:t.bgColor},children:E.jsx(o2,{})}),E.jsx("div",{className:"flex justify-end",children:E.jsx(qg,{nr:r,isHome:!1})})]})]}),E.jsx("div",{className:"flex-1 overflow-auto",children:E.jsx(n6,{isView:!1})})]})]})},Eq=()=>{const{org_nr:t}=ia(),e=Bi(),{udThemeId:n}=Bd(t),{colorScheme:r,setPeriodType:a,setPeriodFrom:s,setPeriodTo:l}=vi();return D.useEffect(()=>{a("Monthly");const u=new Date,c=new Date(u.getFullYear(),u.getMonth(),1),h=new Date(u.getFullYear(),u.getMonth()+1,0);s(c),l(h)},[]),E.jsxs("div",{className:"relative w-full h-screen",style:{color:r.textColor},children:[E.jsx("div",{className:"absolute inset-0 pointer-events-none bg-center",style:{backgroundImage:r.bgImage?`url('${r.bgImage}')`:void 0,backgroundRepeat:r.bgRepeat??"",backgroundSize:r.bgRepeat?"":"cover",opacity:r.bgOpacity,filter:r.bgRepeat?"":"blur(8px)"}}),E.jsxs("div",{className:"relative h-full z-10 p-4 flex flex-col",style:{backgroundColor:r.bgColor},children:[E.jsxs("div",{className:"flex flex-col",children:[E.jsx(Ud,{isHome:!1}),E.jsxs("div",{className:"flex justify-between gap-3 mt-3 mb-3",children:[E.jsx("button",{onClick:()=>e(-1),className:"w-6 h-6 rounded-md flex items-center justify-center mt-2",style:{backgroundColor:r.textColor,color:r.bgColor},children:E.jsx(o2,{})}),E.jsx("div",{className:"flex justify-end",children:E.jsx(qg,{nr:n,isHome:!1})})]})]}),E.jsx("div",{className:"flex-1 overflow-auto",children:E.jsx(n6,{isView:!0})})]})]})},Aq={7:{container:"bg-[#255F38]",item:"p-3 rounded-md text-left transition",date:"sm:text-lg font-bold pb-2",description:"text-sm sm:text-base font-semibold"},8:{container:"bg-[#F0BB78]",item:"p-3 rounded-md text-left transition",date:"sm:text-lg font-bold pb-2",description:"text-sm sm:text-base font-semibold"},9:{container:"bg-[#FEF9E1]/20 border",item:"p-3 rounded-md text-left transition",date:"sm:text-lg font-bold pb-2",description:"text-sm sm:text-base font-semibold"}},Nq=({events:t=[],tn:e=7})=>{const{i18n:n,t:r}=Ar(),a=n.language,s=Aq[e],{colorScheme:l,hijriMonthNames:u}=vi(),c=l.isDefault,[h,d]=D.useState(new Map);return D.useEffect(()=>{if(!t||t.length===0)return;const m=t.map(j=>new Date(j.date)),y=new Date(Math.min(...m.map(j=>j.getTime()))),g=new Date(Math.max(...m.map(j=>j.getTime()))),x=new Date(y.getFullYear(),0,1),_=new Date(g.getFullYear(),11,31),N=x.toLocaleDateString("en-CA"),A=_.toLocaleDateString("en-CA");Dg(N,A).then(j=>{d(j)}).catch(j=>{console.error("Failed to fetch Hijri dates for events:",j)})},[t]),E.jsx("div",{className:`pb-2 px-2 rounded-lg shadow-md mt- ${s.container}`,style:{color:l.prayerTimesColor.text,backgroundColor:c?"":l.prayerTimesColor.bg},children:E.jsx("div",{className:"flex justify-between items-center",children:E.jsx("div",{children:t.map((m,y)=>{const g=new Date(m.date);let x;if(a==="ar"){const _=g.toLocaleDateString("en-CA"),N=h.get(_);x=N?zo({hijriDayObj:N,language:a,t:r,hijriMonthNames:u}):""}else{const _=g.toLocaleDateString("en-US",{month:"long"}).toUpperCase(),N=g.getDate(),A=g.getFullYear();x=`${N} ${_} ${A}`}return E.jsxs("div",{className:s.item,children:[E.jsx("h2",{className:`${s.date} font-extrabold text-sm sm:text-base`,children:x}),E.jsx("p",{className:`${s.description} text-[10px] sm:text-xs font-medium leading-tight`,children:m.description})]},y)})})})})},Cq={7:{text:"text-white font-DM"},8:{text:"text-[#543A14] font-montserrat",bg:"bg-[#FFF0DC]/90"},9:{text:"text-[#FEF9E1] font-ones"}},Tq=()=>{const{colorScheme:t,events:e,eventsLoading:n}=vi(),{t:r}=Ar(),a=Bi(),{org_nr:s}=ia(),{udThemeId:l}=Bd(s),u=Cq[l];return n?E.jsx("div",{className:"h-screen",children:E.jsx(qf,{})}):E.jsxs("div",{className:`relative w-full min-h-screen font-DM ${u.text}`,style:{color:t.textColor},children:[t.bgImage&&E.jsx("div",{className:"absolute inset-0 pointer-events-none min-h-screen",style:{backgroundImage:t.bgImage?`url('${t.bgImage}')`:void 0,backgroundRepeat:t.bgRepeat??"",opacity:t.bgOpacity,filter:t.bgRepeat?"":"blur(8px)"}}),E.jsxs("div",{className:"relative flex flex-col min-h-screen z-10 p-4",style:{backgroundColor:t.bgColor},children:[E.jsx(Ud,{isHome:!1}),E.jsxs("div",{className:"flex flex-col md:gap-4",children:[E.jsxs("div",{className:"flex items-center gap-3 py-8",children:[E.jsx("button",{onClick:()=>a(`/${s}`),className:"w-6 h-6 rounded-md flex items-center justify-center",style:{backgroundColor:t.textColor,color:t.bgColor},children:E.jsx(o2,{})}),E.jsx("div",{className:"text-center w-full",children:E.jsx("h2",{className:"text-lg sm:text-xl font-bold",style:{color:t.textColor},children:r("EVENTS & CALENDAR").toUpperCase()})})]}),E.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[E.jsx("div",{className:"calendar-container flex-grow",children:E.jsx(Cm,{tn:l,showDate:!0})}),E.jsx("div",{className:"md:w-1/2 flex items-center",children:E.jsx("div",{className:"w-full grid gap-2 md:max-h-[calc(100vh-200px)] md:overflow-y-auto",children:e.length>0?e.map((c,h)=>E.jsx(Nq,{events:[c],tn:l},h)):E.jsx("div",{className:"flex items-center justify-center py-10 text-center",children:E.jsx("p",{className:" text-lg",children:"No events available."})})})})]})]})]})]})},Lq=()=>{const t=Bi(),{org_nr:e}=ia(),[n]=$T(),r=n.get("name"),a=Number(n.get("endTime")),s=Math.max(0,a-Date.now());return D.useEffect(()=>{if(!e){t("/masjid");return}if(!r||!Number.isFinite(a)){t(`/${e}/masjid`);return}if(s<=0){t(`/${e}/masjid`);return}const l=setTimeout(()=>{t(`/${e}/masjid`)},s);return()=>clearTimeout(l)},[r,a,s,e,t]),r?E.jsxs("div",{className:"min-h-screen w-full bg-black flex flex-col items-center justify-center gap-12",children:[E.jsxs("div",{className:"bg-black p-8 rounded-lg shadow-lg text-center max-w-md w-full",children:[E.jsx("h1",{className:"text-4xl font-bold text-white mb-6",children:"IQAMAH"}),E.jsx("br",{}),E.jsx("h1",{className:"text-4xl font-bold text-white mb-6",children:"قد قامت الصلاة"}),E.jsx("p",{className:"text-5xl text-white mb-8 font-bold",children:r})]}),E.jsxs("div",{className:"flex items-center gap-6 bg-white rounded-[70px] p-6",children:[E.jsx("img",{src:"/img/instruction.jpg",alt:"No Mobile",className:"w-24 h-24 rounded-full object-cover"}),E.jsx("p",{className:"text-3xl text-black font-bold",children:"Please keep your phones OFF or in silent mode"})]})]}):(console.log("No currentPrayer, rendering fallback UI"),E.jsx("div",{className:"min-h-dvh w-full bg-black flex items-center justify-center text-white",children:"No prayer data available."}))};function jq({error:t,resetErrorBoundary:e}){const n=t instanceof Error?t.message:typeof t=="string"?t:JSON.stringify(t,null,2)||"An unexpected error occurred. Please try again.";return E.jsx("div",{className:"min-h-screen bg-gradient-to-br from-red-50 to-orange-50 flex items-center justify-center p-8",children:E.jsxs("div",{className:"max-w-md w-full bg-white rounded-2xl shadow-2xl border border-red-100 p-8 text-center",children:[E.jsx("div",{className:"w-24 h-24 mx-auto mb-6 bg-red-100 rounded-2xl flex items-center justify-center",children:E.jsx("svg",{className:"w-12 h-12 text-red-500",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-2.5L13.732 4c-.77-.833-1.964-.833-2.732 0L3.732 16.5c-.77.833.192 2.5 1.732 2.5z"})})}),E.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-gray-900 mb-4",children:"Something went wrong"}),E.jsx("p",{className:"text-gray-600 mb-6 leading-relaxed",children:n}),E.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 justify-center",children:[E.jsx("button",{onClick:e,className:"px-6 py-3 bg-blue-600 text-white font-medium rounded-xl hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-all duration-200 shadow-lg",children:"Try Again"}),E.jsx("button",{onClick:()=>window.location.reload(),className:"px-6 py-3 bg-gray-100 text-gray-900 font-medium rounded-xl hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-gray-500 focus:ring-offset-2 transition-all duration-200",children:"Refresh Page"})]}),E.jsxs("details",{className:"mt-6 p-4 bg-gray-50 rounded-xl border",children:[E.jsx("summary",{className:"cursor-pointer font-medium text-sm text-gray-700 mb-2",children:"Show technical details"}),E.jsx("pre",{className:"text-xs text-red-800 bg-red-50 p-3 rounded font-mono overflow-auto max-h-40",children:n}),E.jsx("button",{onClick:()=>navigator.clipboard.writeText(n),className:"mt-2 text-xs text-blue-600 hover:underline",children:"Copy error"})]})]})})}function Oq(){const{org_nr:t}=ia();return E.jsx(i7,{mosqueId:t,children:E.jsx(j4,{})})}const Rq=()=>{D.useEffect(()=>{const n=()=>{Rn("success","Back online!")},r=()=>{Rn("warning","You are offline!")};return window.addEventListener("online",n),window.addEventListener("offline",r),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}},[]);const{prayerTimes:t,asrInfo:e}=vi();return E.jsxs("div",{className:"relative text-red-500",children:[E.jsx("div",{className:"absolute inset-0 bg-repeat pointer-events-none opacity-30",style:{backgroundImage:"url('/img/ud/bg1.png')"}}),E.jsxs("div",{className:"relative h-full z-10 bg-[#3A7D44]/90 p-4",children:[E.jsx(Ud,{}),E.jsxs("div",{className:"flex items-center sm:pr-2",children:[E.jsx("div",{className:"flex-[2] h-fit sm:block hidden p-2 md:p-6",children:E.jsx(Id,{theme:1,prayerTimes:t,asrInfo:e})}),E.jsxs("div",{className:"sm:flex-[3] w-full",children:[E.jsx("div",{className:"my-6 sm:my-8",children:E.jsx(qg,{nr:9})}),E.jsx(GE,{prayerTimesColor:{bg:"red",text:"blue"}}),E.jsxs("div",{children:[E.jsx(WE,{tn:7,prayerTimesColor:{bg:"red",text:"blue"}}),E.jsx(YE,{tn:7,prayerTimesColor:{bg:"red",text:"blue"}})]})]})]}),E.jsx("div",{className:"mt-5 rounded-md overflow-hidden",children:E.jsx(Ky,{})})]})]})},kq=()=>E.jsxs(cP,{fallbackRender:jq,children:[E.jsxs(uT,{children:[E.jsxs(Ka,{element:E.jsx(qU,{}),children:[E.jsx(Ka,{path:"/:org_nr/ud",element:E.jsx(Rq,{})}),E.jsx(Ka,{path:"/:org_nr",element:E.jsx(jS,{})}),E.jsx(Ka,{path:"/user",element:E.jsx(Pp,{to:"/982842840"})}),E.jsx(Ka,{path:"/loc/:loc_id",element:E.jsx(jS,{})}),E.jsx(Ka,{path:"/:org_nr/events",element:E.jsx(Tq,{})}),E.jsx(Ka,{path:"/:org_nr/view-timetable",element:E.jsx(Eq,{})}),E.jsx(Ka,{path:"/:org_nr/download-timetable",element:E.jsx(_q,{})})]}),E.jsxs(Ka,{element:E.jsx(Oq,{}),children:[E.jsx(Ka,{path:"/:org_nr/masjid",element:E.jsx(AP,{})}),E.jsx(Ka,{path:"/:org_nr/masjid/iqamah",element:E.jsx(Lq,{})}),E.jsx(Ka,{path:"/masjid",element:E.jsx(Pp,{to:"/982842840/masjid"})}),E.jsx(Ka,{path:"/:org_nr/lobby",element:E.jsx(wM,{})}),E.jsx(Ka,{path:"/lobby",element:E.jsx(Pp,{to:"/982842840/lobby"})})]}),E.jsx(Ka,{path:"/",element:E.jsx(Pp,{to:"/loc/NO0301"})}),E.jsx(Ka,{path:"*",element:E.jsx(zU,{})})]}),E.jsx(q7,{})]});function Dq(){const t=DT([{path:"/*",element:E.jsx(kq,{})}]);return E.jsx(WT,{router:t})}xN.createRoot(document.getElementById("root")).render(E.jsx(D.StrictMode,{children:E.jsx(c8,{children:E.jsx(Dq,{})})}));export{Xh as _,Mq as c,yg as g};
|