@qratilabs/qrati-connect 2.23.9 → 2.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/README.md +84 -54
  2. package/element/2CMH9VMM.js +4 -0
  3. package/element/BKDqpSN62.js +3 -0
  4. package/element/{lrjV8c1G2.js → BM9ujORR2.js} +1 -1
  5. package/element/{BqHk5hDM.js → BOQzjiMV.js} +3 -3
  6. package/element/{BYEF5Khs.js → BOqkzZ92.js} +1 -1
  7. package/element/{-p_JqYFM2.js → BP2rYgya2.js} +9 -9
  8. package/element/BZu3c37u.js +1 -0
  9. package/element/{srDF4VyG.js → Bb7nx5xF.js} +1 -1
  10. package/element/Bh8kXbe92.js +93 -0
  11. package/{umd/BvNf2yif2.js → element/Bow6F3212.js} +29 -29
  12. package/{umd/BkvtmX4K.js → element/BsYbcfkG.js} +1 -1
  13. package/element/{C8_zGNAf.js → C12iSy3L.js} +1 -1
  14. package/element/{D9NypPiv.js → C3dOFk9A.js} +1 -1
  15. package/element/C52SUIvC2.js +35 -0
  16. package/element/{DIYUC8M3.js → CAETItHr.js} +1 -1
  17. package/element/{Cb1JRT_1.js → CATr-3VW.js} +1 -1
  18. package/element/{Byk0pccK.js → CFnGGYmq.js} +1 -1
  19. package/element/CHTzn6mh2.js +4 -0
  20. package/element/CL_evx_l.js +1 -0
  21. package/element/{e_wwJ5wx2.js → CLdpUOLk2.js} +4 -4
  22. package/element/{qWp4ucdT.js → CM46vluW.js} +1 -1
  23. package/{umd/BtN9y353.js → element/CVRTTCyF.js} +1 -1
  24. package/{umd/9QY9BKOL2.js → element/CWhnvMey2.js} +8 -8
  25. package/{umd/B14kCOq8.js → element/CZ9iaxjO.js} +1 -1
  26. package/element/CaX2xgrP.js +41 -0
  27. package/element/{b6CwQBFC.js → ChJXhA9c.js} +5 -5
  28. package/element/{4VTPoA38.js → CqBk9L5O.js} +1 -1
  29. package/{umd/CiiNqDJq.js → element/CsfDBJh72.js} +1 -1
  30. package/element/{_ty2jtjs.js → D35mTuTT.js} +1 -1
  31. package/element/D5TKEdBd2.js +3 -0
  32. package/element/{CCLXmMXp.js → DF0LxcV7.js} +1 -1
  33. package/element/{DvTRhlvs.js → DGGc10Cy.js} +1 -1
  34. package/element/{ekog7y-V.js → DGbyGc8b.js} +1 -1
  35. package/element/DN26AtHL2.js +4 -0
  36. package/element/{DsvRTvCp.js → DWBbTgnB.js} +1 -1
  37. package/element/{BQuhYd4G2.js → DZtaQWVG2.js} +1 -1
  38. package/{umd/D0VKfxwE.js → element/DdOwRfWG.js} +2 -2
  39. package/element/DkG0zv7_2.js +9 -0
  40. package/{umd/gk4TX_a62.js → element/DlRUi0u42.js} +1 -1
  41. package/element/{DXx41__x2.js → DlqJDAie2.js} +1 -1
  42. package/element/DnIueBGr2.js +1 -0
  43. package/element/{BglDIiFp.js → DnQ6XaLR.js} +2 -2
  44. package/element/DrrpB4Om.js +1 -0
  45. package/element/DtRwaUYF2.js +85 -0
  46. package/element/{CSO2IaJ1.js → LYboLIEU.js} +2 -2
  47. package/{umd/DNG5BSHx2.js → element/N4HKgEC52.js} +1 -1
  48. package/element/Rcen6i0h.js +80 -0
  49. package/element/{MpvHkxaz2.js → Z0-Tddye2.js} +1 -1
  50. package/element/dT6WSX65.js +1 -0
  51. package/element/h4ZjZXfe2.js +1 -0
  52. package/element/kiL9JENf2.js +3 -0
  53. package/element/{BdOzsWR32.js → lcKuIs2T2.js} +1 -1
  54. package/element/{DdmVPlUC2.js → mIANlVHi2.js} +1 -1
  55. package/element/mQzpzQ_t.js +3 -0
  56. package/element/web.es.js +26 -105
  57. package/package.json +3 -15
  58. package/react/index.d.mts +182 -6
  59. package/react/index.d.ts +182 -6
  60. package/element/9QY9BKOL2.js +0 -8
  61. package/element/B14kCOq8.js +0 -2
  62. package/element/BItJQVdK.js +0 -41
  63. package/element/BYoa-kpQ2.js +0 -9
  64. package/element/Be1e_ATJ.js +0 -1
  65. package/element/BfkCwRAR2.js +0 -3
  66. package/element/BkvtmX4K.js +0 -2
  67. package/element/BsT0vqml.js +0 -1
  68. package/element/BtN9y353.js +0 -1
  69. package/element/BvNf2yif2.js +0 -39
  70. package/element/C030L_Hu2.js +0 -4
  71. package/element/C0MGOytI.js +0 -1
  72. package/element/C3tT7YRo2.js +0 -37
  73. package/element/C3uDEVBt.js +0 -1
  74. package/element/CJ5ChvJ52.js +0 -93
  75. package/element/CiiNqDJq.js +0 -3
  76. package/element/CnoPTYOO.js +0 -1
  77. package/element/D0VKfxwE.js +0 -10
  78. package/element/D4apO9G62.js +0 -4
  79. package/element/DB1jhaAe2.js +0 -85
  80. package/element/DNG5BSHx2.js +0 -2
  81. package/element/LJWh_4Di.js +0 -2
  82. package/element/gjXXuILV2.js +0 -3
  83. package/element/gk4TX_a62.js +0 -7
  84. package/element/qNDy94Dr2.js +0 -3
  85. package/element/styles.css +0 -288
  86. package/umd/-p_JqYFM2.js +0 -14
  87. package/umd/4VTPoA38.js +0 -1
  88. package/umd/BCTYvPrD.js +0 -1
  89. package/umd/BItJQVdK.js +0 -41
  90. package/umd/BQuhYd4G2.js +0 -2
  91. package/umd/BYEF5Khs.js +0 -1
  92. package/umd/BYoa-kpQ2.js +0 -9
  93. package/umd/BdOzsWR32.js +0 -9
  94. package/umd/Be1e_ATJ.js +0 -1
  95. package/umd/BfkCwRAR2.js +0 -3
  96. package/umd/BglDIiFp.js +0 -3
  97. package/umd/BkIDQGIs.js +0 -1
  98. package/umd/Bki5T_lb.js +0 -1
  99. package/umd/BqHk5hDM.js +0 -9
  100. package/umd/BsT0vqml.js +0 -1
  101. package/umd/Byk0pccK.js +0 -1
  102. package/umd/C030L_Hu2.js +0 -4
  103. package/umd/C0MGOytI.js +0 -1
  104. package/umd/C3tT7YRo2.js +0 -37
  105. package/umd/C3uDEVBt.js +0 -1
  106. package/umd/C8_zGNAf.js +0 -1
  107. package/umd/CCLXmMXp.js +0 -3
  108. package/umd/CJ5ChvJ52.js +0 -93
  109. package/umd/CSO2IaJ1.js +0 -2
  110. package/umd/Cb1JRT_1.js +0 -1
  111. package/umd/CfMNBPpx2.js +0 -1
  112. package/umd/CgUphJWo.js +0 -1
  113. package/umd/Cko4QHwX.js +0 -1
  114. package/umd/CnoPTYOO.js +0 -1
  115. package/umd/D4apO9G62.js +0 -4
  116. package/umd/D9NypPiv.js +0 -7
  117. package/umd/DB1jhaAe2.js +0 -85
  118. package/umd/DIYUC8M3.js +0 -2
  119. package/umd/DXx41__x2.js +0 -2
  120. package/umd/DdmVPlUC2.js +0 -13
  121. package/umd/DsvRTvCp.js +0 -8
  122. package/umd/DvTRhlvs.js +0 -2
  123. package/umd/LJWh_4Di.js +0 -2
  124. package/umd/MpvHkxaz2.js +0 -16
  125. package/umd/_ty2jtjs.js +0 -2
  126. package/umd/b6CwQBFC.js +0 -5
  127. package/umd/e_wwJ5wx2.js +0 -5
  128. package/umd/ekog7y-V.js +0 -1
  129. package/umd/gjXXuILV2.js +0 -3
  130. package/umd/index.d.ts +0 -14
  131. package/umd/lrjV8c1G2.js +0 -8
  132. package/umd/qNDy94Dr2.js +0 -3
  133. package/umd/qWp4ucdT.js +0 -1
  134. package/umd/rtH8O6Hc.js +0 -1
  135. package/umd/srDF4VyG.js +0 -9
  136. package/umd/web.es.js +0 -122
  137. package/umd/web.umd.js +0 -1
@@ -0,0 +1,41 @@
1
+ import{E as e,_ as t,h as r,p as s,r as o,s as n,t as i,v as a,y as c}from"./DrrpB4Om.js";var u={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},l=new class{#e=u;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},h="undefined"==typeof window||"Deno"in globalThis;function d(){}function f(e,t){return"function"==typeof e?e(t):e}function p(e){return"number"==typeof e&&e>=0&&e!==1/0}function m(e,t){return Math.max(e+(t||0)-Date.now(),0)}function y(e,t){return"function"==typeof e?e(t):e}function g(e,t){return"function"==typeof e?e(t):e}function w(e,t){const{type:r="all",exact:s,fetchStatus:o,predicate:n,queryKey:i,stale:a}=e;if(i)if(s){if(t.queryHash!==v(i,t.options))return!1}else if(!E(t.queryKey,i))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return!("boolean"==typeof a&&t.isStale()!==a||o&&o!==t.state.fetchStatus||n&&!n(t))}function b(e,t){const{exact:r,status:s,predicate:o,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(r){if(R(t.options.mutationKey)!==R(n))return!1}else if(!E(t.options.mutationKey,n))return!1}return!(s&&t.state.status!==s||o&&!o(t))}function v(e,t){return(t?.queryKeyHashFn||R)(e)}function R(e){return JSON.stringify(e,(e,t)=>I(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function E(e,t){return e===t||typeof e==typeof t&&!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&Object.keys(t).every(r=>E(e[r],t[r]))}var T=Object.prototype.hasOwnProperty;function S(e,t,r=0){if(e===t)return e;if(r>500)return t;const s=A(e)&&A(t);if(!(s||I(e)&&I(t)))return t;const o=(s?e:Object.keys(e)).length,n=s?t:Object.keys(t),i=n.length,a=s?new Array(i):{};let c=0;for(let u=0;u<i;u++){const i=s?u:n[u],l=e[i],h=t[i];if(l===h){a[i]=l,(s?u<o:T.call(e,i))&&c++;continue}if(null===l||null===h||"object"!=typeof l||"object"!=typeof h){a[i]=h;continue}const d=S(l,h,r+1);a[i]=d,d===l&&c++}return o===i&&c===o?e:a}function O(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(e[r]!==t[r])return!1;return!0}function A(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function I(e){if(!C(e))return!1;const t=e.constructor;if(void 0===t)return!0;const r=t.prototype;return!!C(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function C(e){return"[object Object]"===Object.prototype.toString.call(e)}function P(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?S(e,t):t}function N(e,t,r=0){const s=[...e,t];return r&&s.length>r?s.slice(1):s}function D(e,t,r=0){const s=[t,...e];return r&&s.length>r?s.slice(0,-1):s}var q=/* @__PURE__ */Symbol();function _(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==q?e.queryFn:()=>Promise.reject(/* @__PURE__ */new Error(`Missing queryFn: '${e.queryHash}'`))}function L(e,t){return"function"==typeof e?e(...t):!!e}var x=/* @__PURE__ */(()=>{let e=()=>h;return{isServer:()=>e(),setIsServer(t){e=t}}})(),k=class{constructor(){this.listeners=/* @__PURE__ */new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},F=new class extends k{#r;#s;#o;constructor(){super(),this.#o=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#s||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#s?.(),this.#s=void 0)}setEventListener(e){this.#o=e,this.#s?.(),this.#s=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:"hidden"!==globalThis.document?.visibilityState}},U=function(e){setTimeout(e,0)},M=function(){let e=[],t=0,r=e=>{e()},s=e=>{e()},o=U;const n=s=>{t?e.push(s):o(()=>{r(s)})};return{batch:n=>{let i;t++;try{i=n()}finally{t--,t||(()=>{const t=e;e=[],t.length&&o(()=>{s(()=>{t.forEach(e=>{r(e)})})})})()}return i},batchCalls:e=>(...t)=>{n(()=>{e(...t)})},schedule:n,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{o=e}}}(),$=new class extends k{#n=!0;#s;#o;constructor(){super(),this.#o=e=>{if("undefined"!=typeof window&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#s||this.setEventListener(this.#o)}onUnsubscribe(){this.hasListeners()||(this.#s?.(),this.#s=void 0)}setEventListener(e){this.#o=e,this.#s?.(),this.#s=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function j(){let e,t;const r=new Promise((r,s)=>{e=r,t=s});function s(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{s({status:"fulfilled",value:t}),e(t)},r.reject=e=>{s({status:"rejected",reason:e}),t(e)},r}function H(e){return Math.min(1e3*2**e,3e4)}function G(e){return"online"!==(e??"online")||$.isOnline()}var Q=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function V(e){let t,r=!1,s=0;const o=j(),n=()=>"pending"!==o.status,i=()=>F.isFocused()&&("always"===e.networkMode||$.isOnline())&&e.canRun(),a=()=>G(e.networkMode)&&e.canRun(),c=e=>{n()||(t?.(),o.resolve(e))},u=e=>{n()||(t?.(),o.reject(e))},h=()=>new Promise(r=>{t=e=>{(n()||i())&&r(e)},e.onPause?.()}).then(()=>{t=void 0,n()||e.onContinue?.()}),d=()=>{if(n())return;let t;const o=0===s?e.initialPromise:void 0;try{t=o??e.fn()}catch(a){t=Promise.reject(a)}Promise.resolve(t).then(c).catch(t=>{if(n())return;const o=e.retry??(x.isServer()?0:3),a=e.retryDelay??H,c="function"==typeof a?a(s,t):a,f=!0===o||"number"==typeof o&&s<o||"function"==typeof o&&o(s,t);var p;!r&&f?(s++,e.onFail?.(s,t),(p=c,new Promise(e=>{l.setTimeout(e,p)})).then(()=>i()?void 0:h()).then(()=>{r?u(t):d()})):u(t)})};return{promise:o,status:()=>o.status,cancel:t=>{if(!n()){const r=new Q(t);u(r),e.onCancel?.(r)}},continue:()=>(t?.(),o),cancelRetry:()=>{r=!0},continueRetry:()=>{r=!1},canStart:a,start:()=>(a()?d():h().then(d),o)}}var B=class{#i;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),p(this.gcTime)&&(this.#i=l.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(x.isServer()?1/0:3e5))}clearGcTimeout(){void 0!==this.#i&&(l.clearTimeout(this.#i),this.#i=void 0)}};function z(e){return{onFetch:(t,r)=>{const s=t.options,o=t.fetchOptions?.meta?.fetchMore?.direction,n=t.state.data?.pages||[],i=t.state.data?.pageParams||[];let a={pages:[],pageParams:[]},c=0;const u=async()=>{let r=!1;const u=e=>{!function(e,r,s){let o,n=!1;Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(o??=t.signal,n||(n=!0,o.aborted?s():o.addEventListener("abort",s,{once:!0})),o)})}(e,0,()=>r=!0)},l=_(t.options,t.fetchOptions),h=async(e,s,o)=>{if(r)return Promise.reject(t.signal.reason);if(null==s&&e.pages.length)return Promise.resolve(e);const n=await l((()=>{const e={client:t.client,queryKey:t.queryKey,pageParam:s,direction:o?"backward":"forward",meta:t.options.meta};return u(e),e})()),{maxPages:i}=t.options,a=o?D:N;return{pages:a(e.pages,n,i),pageParams:a(e.pageParams,s,i)}};if(o&&n.length){const e="backward"===o,t=e?Z:W,r={pages:n,pageParams:i};a=await h(r,t(s,r),e)}else{const t=e??n.length;do{const e=0===c?i[0]??s.initialPageParam:W(s,a);if(c>0&&null==e)break;a=await h(a,e),c++}while(c<t)}return a};t.options.persister?t.fetchFn=()=>t.options.persister?.(u,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=u}}}function W(e,{pages:t,pageParams:r}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,r[s],r):void 0}function Z(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}function K(e,t){return!!t&&null!=W(e,t)}function J(e,t){return!(!t||!e.getPreviousPageParam)&&null!=Z(e,t)}var Y=class extends B{#a;#c;#u;#l;#h;#d;#f;#p;constructor(e){super(),this.#p=!1,this.#f=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#h=e.client,this.#l=this.#h.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#c=te(this.options),this.state=e.state??this.#c,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#a}get promise(){return this.#d?.promise}setOptions(e){if(this.options={...this.#f,...e},e?._type&&(this.#a=e._type),this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const e=te(this.options);void 0!==e.data&&(this.setState(ee(e.data,e.dataUpdatedAt)),this.#c=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,t){const r=P(this.state.data,e,this.options);return this.#m({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e){this.#m({type:"setState",state:e})}cancel(e){const t=this.#d?.promise;return this.#d?.cancel(e),t?t.then(d).catch(d):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#c}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>!1!==g(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===q||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===y(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!m(this.state.dataUpdatedAt,e))}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#d?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#d?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#d&&(this.#p||this.#y()?this.#d.cancel({revert:!0}):this.#d.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}#y(){return"paused"===this.state.fetchStatus&&"pending"===this.state.status}invalidate(){this.state.isInvalidated||this.#m({type:"invalidate"})}async fetch(e,t){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#d?.status())if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#d)return this.#d.continueRetry(),this.#d.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}const r=new AbortController,s=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#p=!0,r.signal)})},o=()=>{const e=_(this.options,t),r=(()=>{const e={client:this.#h,queryKey:this.queryKey,meta:this.meta};return s(e),e})();return this.#p=!1,this.options.persister?this.options.persister(e,r,this):e(r)},n=(()=>{const e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:o};return s(e),e})();("infinite"===this.#a?z(this.options.pages):this.options.behavior)?.onFetch(n,this),this.#u=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===n.fetchOptions?.meta||this.#m({type:"fetch",meta:n.fetchOptions?.meta}),this.#d=V({initialPromise:t?.initialPromise,fn:n.fetchFn,onCancel:e=>{e instanceof Q&&e.revert&&this.setState({...this.#u,fetchStatus:"idle"}),r.abort()},onFail:(e,t)=>{this.#m({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#m({type:"pause"})},onContinue:()=>{this.#m({type:"continue"})},retry:n.options.retry,retryDelay:n.options.retryDelay,networkMode:n.options.networkMode,canRun:()=>!0});try{const e=await this.#d.start();if(void 0===e)throw new Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),e}catch(i){if(i instanceof Q){if(i.silent)return this.#d.promise;if(i.revert){if(void 0===this.state.data)throw i;return this.state.data}}throw this.#m({type:"error",error:i}),this.#l.config.onError?.(i,this),this.#l.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#m(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...X(t.data,this.options),fetchMeta:e.meta??null};case"success":const r={...t,...ee(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#u=e.manual?r:void 0,r;case"error":const s=e.error;return{...t,error:s,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:s,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),M.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function X(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:G(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function ee(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function te(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,s=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var re=class extends k{constructor(e,t){super(),this.options=t,this.#h=e,this.#g=null,this.#w=j(),this.bindMethods(),this.setOptions(t)}#h;#b=void 0;#v=void 0;#R=void 0;#E;#T;#w;#g;#S;#O;#A;#I;#C;#P;#N=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#b.addObserver(this),se(this.#b,this.options)?this.#D():this.updateResult(),this.#q())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return oe(this.#b,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return oe(this.#b,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#_(),this.#L(),this.#b.removeObserver(this)}setOptions(e){const t=this.options,r=this.#b;if(this.options=this.#h.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof g(this.options.enabled,this.#b))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#x(),this.#b.setOptions(this.options),t._defaulted&&!O(this.options,t)&&this.#h.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#b,observer:this});const s=this.hasListeners();s&&ne(this.#b,r,this.options,t)&&this.#D(),this.updateResult(),!s||this.#b===r&&g(this.options.enabled,this.#b)===g(t.enabled,this.#b)&&y(this.options.staleTime,this.#b)===y(t.staleTime,this.#b)||this.#k();const o=this.#F();!s||this.#b===r&&g(this.options.enabled,this.#b)===g(t.enabled,this.#b)&&o===this.#P||this.#U(o)}getOptimisticResult(e){const t=this.#h.getQueryCache().build(this.#h,e),r=this.createResult(t,e);var s;return s=r,O(this.getCurrentResult(),s)||(this.#R=r,this.#T=this.options,this.#E=this.#b.state),r}getCurrentResult(){return this.#R}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#w.status||this.#w.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#N.add(e)}getCurrentQuery(){return this.#b}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#h.defaultQueryOptions(e),r=this.#h.getQueryCache().build(this.#h,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#D({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#R))}#D(e){this.#x();let t=this.#b.fetch(this.options,e);return e?.throwOnError||(t=t.catch(d)),t}#k(){this.#_();const e=y(this.options.staleTime,this.#b);if(x.isServer()||this.#R.isStale||!p(e))return;const t=m(this.#R.dataUpdatedAt,e)+1;this.#I=l.setTimeout(()=>{this.#R.isStale||this.updateResult()},t)}#F(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#b):this.options.refetchInterval)??!1}#U(e){this.#L(),this.#P=e,!x.isServer()&&!1!==g(this.options.enabled,this.#b)&&p(this.#P)&&0!==this.#P&&(this.#C=l.setInterval(()=>{(this.options.refetchIntervalInBackground||F.isFocused())&&this.#D()},this.#P))}#q(){this.#k(),this.#U(this.#F())}#_(){void 0!==this.#I&&(l.clearTimeout(this.#I),this.#I=void 0)}#L(){void 0!==this.#C&&(l.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){const r=this.#b,s=this.options,o=this.#R,n=this.#E,i=this.#T,a=e!==r?e.state:this.#v,{state:c}=e;let u,l={...c},h=!1;if(t._optimisticResults){const o=this.hasListeners(),n=!o&&se(e,t),i=o&&ne(e,r,t,s);(n||i)&&(l={...l,...X(c.data,e.options)}),"isRestoring"===t._optimisticResults&&(l.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:p}=l;u=l.data;let m=!1;if(void 0!==t.placeholderData&&void 0===u&&"pending"===p){let e;o?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=o.data,m=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#A?.state.data,this.#A):t.placeholderData,void 0!==e&&(p="success",u=P(o?.data,e,t),h=!0)}if(t.select&&void 0!==u&&!m)if(o&&u===n?.data&&t.select===this.#S)u=this.#O;else try{this.#S=t.select,u=t.select(u),u=P(o?.data,u,t),this.#O=u,this.#g=null}catch(T){this.#g=T}this.#g&&(d=this.#g,u=this.#O,f=Date.now(),p="error");const y="fetching"===l.fetchStatus,w="pending"===p,b="error"===p,v=w&&y,R=void 0!==u,E={status:p,fetchStatus:l.fetchStatus,isPending:w,isSuccess:"success"===p,isError:b,isInitialLoading:v,isLoading:v,data:u,dataUpdatedAt:l.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>a.dataUpdateCount||l.errorUpdateCount>a.errorUpdateCount,isFetching:y,isRefetching:y&&!w,isLoadingError:b&&!R,isPaused:"paused"===l.fetchStatus,isPlaceholderData:h,isRefetchError:b&&R,isStale:ie(e,t),refetch:this.refetch,promise:this.#w,isEnabled:!1!==g(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==E.data,s="error"===E.status&&!t,o=e=>{s?e.reject(E.error):t&&e.resolve(E.data)},n=()=>{o(this.#w=E.promise=j())},i=this.#w;switch(i.status){case"pending":e.queryHash===r.queryHash&&o(i);break;case"fulfilled":(s||E.data!==i.value)&&n();break;case"rejected":s&&E.error===i.reason||n()}}return E}updateResult(){const e=this.#R,t=this.createResult(this.#b,this.options);this.#E=this.#b.state,this.#T=this.options,void 0!==this.#E.data&&(this.#A=this.#b),O(t,e)||(this.#R=t,this.#M({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#N.size)return!0;const s=new Set(r??this.#N);return this.options.throwOnError&&s.add("error"),Object.keys(this.#R).some(t=>{const r=t;return this.#R[r]!==e[r]&&s.has(r)})})()}))}#x(){const e=this.#h.getQueryCache().build(this.#h,this.options);if(e===this.#b)return;const t=this.#b;this.#b=e,this.#v=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#q()}#M(e){M.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#R)}),this.#h.getQueryCache().notify({query:this.#b,type:"observerResultsUpdated"})})}};function se(e,t){return function(e,t){return!1!==g(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===g(t.retryOnMount,e))}(e,t)||void 0!==e.state.data&&oe(e,t,t.refetchOnMount)}function oe(e,t,r){if(!1!==g(t.enabled,e)&&"static"!==y(t.staleTime,e)){const s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&ie(e,t)}return!1}function ne(e,t,r,s){return(e!==t||!1===g(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&ie(e,r)}function ie(e,t){return!1!==g(t.enabled,e)&&e.isStaleByTime(y(t.staleTime,e))}var ae=e(void 0),ce=e=>{const t=c(ae);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},ue=({client:e,children:r})=>(t(()=>(e.mount(),()=>{e.unmount()}),[e]),/* @__PURE__ */i(ae.Provider,{value:e,children:r})),le=e(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),he=e(!1),de=(he.Provider,(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()}));function fe(e,s,n){const i=c(he),u=c(le),l=ce(n),h=l.defaultQueryOptions(e);l.getDefaultOptions().queries?._experimental_beforeQuery?.(h);const f=l.getQueryCache().get(h.queryHash),p=!1!==e.subscribed;h._optimisticResults=i?"isRestoring":p?"optimistic":void 0,(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),s=e.staleTime;e.staleTime="function"==typeof s?(...e)=>r(s(...e)):r(s),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(h),((e,t,r)=>{const s=r?.state.error&&"function"==typeof e.throwOnError?L(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))})(h,u,f),(e=>{t(()=>{e.clearReset()},[e])})(u);const m=!l.getQueryCache().get(h.queryHash),[y]=r(()=>new s(l,h)),g=y.getOptimisticResult(h),w=!i&&p;if(o(a(e=>{const t=w?y.subscribe(M.batchCalls(e)):d;return y.updateResult(),t},[y,w]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),t(()=>{y.setOptions(h)},[h,y]),((e,t)=>e?.suspense&&t.isPending)(h,g))throw de(h,y,u);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(o&&void 0===e.data||L(r,[e.error,s])))({result:g,errorResetBoundary:u,throwOnError:h.throwOnError,query:f,suspense:h.suspense}))throw g.error;return l.getDefaultOptions().queries?._experimental_afterQuery?.(h,g),h.experimental_prefetchInRender&&!x.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(g,i)&&(m?de(h,y,u):f?.promise)?.catch(d).finally(()=>{y.updateResult()}),h.notifyOnChangeProps?g:y.trackResult(g)}function pe(e,t){return fe(e,re,t)}var me=class extends Error{name="KyError";get isKyError(){return!0}},ye=class extends me{name="HTTPError";response;request;options;data;constructor(e,t,r){const s=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${s?`status code ${s}`:"an unknown error"}: ${t.method} ${t.url}`),this.response=e,this.request=t,this.options=r}},ge=class extends me{name="NetworkError";request;constructor(e,t){super(`Request failed due to a network error: ${e.method} ${e.url}`,t),this.request=e}},we=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},be=class extends me{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new we(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},ve=class extends Error{name="SchemaValidationError";issues;constructor(e){super("Response schema validation failed"),this.issues=e}},Re=class extends me{name="TimeoutError";request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.request=e}},Ee=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,s="function"==typeof globalThis.Request;if(r&&s)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&"unsupported BodyInit type"===o.message)return!1;throw o}return e&&!t})(),Te="function"==typeof globalThis.AbortController,Se="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,Oe="function"==typeof globalThis.ReadableStream,Ae="function"==typeof globalThis.FormData,Ie=["get","post","put","patch","head","delete"],Ce={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Pe=Symbol("stop"),Ne=class{options;constructor(e){this.options=e}},De=e=>new Ne(e),qe={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,baseUrl:!0,prefix:!0,retry:!0,timeout:!0,totalTimeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},_e={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},Le=new TextEncoder,xe=(e,t,r)=>{let s,o=0;return e.pipeThrough(new TransformStream({transform(e,n){if(n.enqueue(e),s){o+=s.byteLength;let e=0===t?0:o/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,o),transferredBytes:o},s)}s=e},flush(){s&&(o+=s.byteLength,r?.({percent:1,totalBytes:Math.max(t,o),transferredBytes:o},s))}}))},ke=e=>null!==e&&"object"==typeof e,Fe=Symbol("replaceOption"),Ue=e=>ke(e)&&!0===e[Fe]?{isReplace:!0,value:e.value}:{isReplace:!1,value:e},Me=(...e)=>{for(const t of e)if((!ke(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return We({},...e)},$e=(e={},t={})=>{const r=new globalThis.Headers(e),s=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(const[n,i]of o.entries())s&&"undefined"===i||void 0===i?r.delete(n):r.set(n,i);return r},je=e=>{if(!ke(e)||Array.isArray(e))return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||null===t},He=e=>{if(e instanceof URLSearchParams){const t=new URLSearchParams(e),r=e[Be];return r&&(t[Be]=new Set(r)),t}return e instanceof globalThis.Headers?new globalThis.Headers(e):Array.isArray(e)?[...e]:je(e)?{...e}:e},Ge=(e,t)=>{return je(e)&&je(t)?(r={...e,...t},Object.fromEntries(Object.entries(r).filter(e=>void 0!==e[1]))):$e(e,t);var r};function Qe(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:We(e[r]??[],t[r]??[])}var Ve=(e={},t={})=>({init:Qe(e,t,"init"),beforeRequest:Qe(e,t,"beforeRequest"),beforeRetry:Qe(e,t,"beforeRetry"),beforeError:Qe(e,t,"beforeError"),afterResponse:Qe(e,t,"afterResponse")}),Be=Symbol("deletedParameters"),ze=(e,t)=>{const r=new URLSearchParams,s=/* @__PURE__ */new Set;for(const o of[e,t])if(void 0!==o)if(o instanceof URLSearchParams){for(const[t,n]of o.entries())r.append(t,n),s.delete(t);const e=o[Be];if(e)for(const t of e)r.delete(t),s.add(t)}else if(Array.isArray(o))for(const e of o){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1])),s.delete(String(e[0]))}else if(ke(o))for(const[e,t]of Object.entries(o))void 0===t?(r.delete(e),s.add(e)):(r.append(e,String(t)),s.delete(e));else{const e=new URLSearchParams(o);for(const[t,o]of e.entries())r.append(t,o),s.delete(t)}return s.size>0&&(r[Be]=s),r},We=(...e)=>{let t,r={},s={},o={};const n=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(ke(i)){for(let[e,s]of Object.entries(i)){if("signal"===e&&s instanceof globalThis.AbortSignal){n.push(s);continue}const o=Ue(s),{isReplace:i}=o;if(s=o.value,"context"!==e)"searchParams"!==e?(ke(s)&&!i&&e in r&&(s=We(r[e],s)),r={...r,[e]:s}):t=null==s?void 0:i||void 0===t?s:ze(t,s);else{if(null!=s&&(!ke(s)||Array.isArray(s)))throw new TypeError("The `context` option must be an object");r={...r,context:null==s?{}:i?{...s}:{...r.context,...s}}}}if(ke(i.hooks)){const{value:e,isReplace:t}=Ue(i.hooks);o=Ve(t?{}:o,e),r.hooks=o}if(ke(i.headers)){const{value:e,isReplace:t}=Ue(i.headers);s=t?He(e):Ge(s,e),r.headers=s}}return void 0!==t&&(r.searchParams=t),n.length>0&&(1===n.length?r.signal=n[0]:r.signal=Se?AbortSignal.any(n):n.at(-1)),r},Ze=e=>Ie.includes(e)?e.toUpperCase():e,Ke={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},Je=(e={})=>{if("number"==typeof e)return{...Ke,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries({...e,methods:e.methods?.map(e=>e.toLowerCase())}).filter(([,e])=>void 0!==e));return{...Ke,...t}};async function Ye(e,{signal:t}){return new Promise((r,s)=>{function o(){clearTimeout(n),s(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));const n=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e)})}var Xe=Object.prototype.toString,et=/* @__PURE__ */new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);var tt=(e,t)=>e instanceof t||e?.name===t.name,rt=Symbol("timedOutResponseData"),st="The `schema` argument must follow the Standard Schema specification",ot=Object.prototype.toString,nt=e=>e instanceof globalThis.Request||"[object Request]"===ot.call(e),it=e=>e instanceof globalThis.Response||"[object Response]"===ot.call(e),at=async(e,t)=>{if("object"!=typeof t&&"function"!=typeof t||null===t)throw new TypeError(st);const r=t["~standard"];if("object"!=typeof r||null===r||"function"!=typeof r.validate)throw new TypeError(st);const s=await r.validate(e);if(s.issues)throw new ve(s.issues);return s.value},ct=class e{static create(t,r){const s=r.hooks?.init??[],o=s.length>0?function(e){const t={...e,json:He(e.json),context:He(e.context),headers:He(e.headers),searchParams:(r=e.searchParams,Array.isArray(r)?r.map(e=>[...e]):He(r))};var r;return void 0!==e.retry&&(t.retry=(e=>"object"!=typeof e?e:{...e,...e.methods&&{methods:[...e.methods]},...e.statusCodes&&{statusCodes:[...e.statusCodes]},...e.afterStatusCodes&&{afterStatusCodes:[...e.afterStatusCodes]}})(e.retry)),t}(r):r;for(const e of s)e(o);const n=new e(t,o),i=(async()=>{try{return await(async()=>{if("number"==typeof n.#$.timeout&&n.#$.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");if("number"==typeof n.#$.totalTimeout&&n.#$.totalTimeout>2147483647)throw new RangeError("The `totalTimeout` option cannot be greater than 2147483647");await Promise.resolve();const e=await n.#j();let t=e??await n.#H(async()=>n.#G()),r=void 0!==e||n.#Q();for(;;){if(void 0===t)return t;if(it(t))try{t=await n.#V(t)}catch(s){if(!(s instanceof be))throw s;const e=await n.#B(s,async()=>n.#G());if(void 0===e)return e;t=e,r=n.#Q();continue}const e=t;if(!e.ok&&"opaque"!==e.type&&("function"==typeof n.#$.throwHttpErrors?n.#$.throwHttpErrors(e.status):n.#$.throwHttpErrors)){const s=new ye(e,n.#z(e),n.#W()),o=s;if(s.data=await n.#Z(e),r)throw o;const i=await n.#B(s,async()=>n.#G());if(void 0===i)return i;t=i,r=n.#Q();continue}break}if(!it(t))return t;if(n.#K(t),n.#$.onDownloadProgress){if("function"!=typeof n.#$.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Oe)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const e=t.clone();return n.#J(t),((e,t)=>{if(!e.body)return e;const r={status:e.status,statusText:e.statusText,headers:e.headers};if(204===e.status)return new Response(null,r);const s=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(xe(e.body,s,t),r)})(e,n.#$.onDownloadProgress)}return t})()}catch(e){if(!(e instanceof Error))throw e;if(n.#Y.has(e))throw e;let t=e;for(const r of n.#$.hooks.beforeError){const e=await r({request:n.request,options:n.#W(),error:t,retryCount:n.#X});e instanceof Error&&(t=e)}throw t}finally{const e=n.#ee;n.#te(e?.body??void 0),n.request!==e&&n.#te(n.request.body??void 0)}})();for(const[e,a]of Object.entries(Ce))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(i[e]=async t=>{n.request.headers.set("accept",n.request.headers.get("accept")||a);const r=await i;if("json"!==e)return r[e]();const s=await r.text();if(""===s)return void 0!==t?at(void 0,t):JSON.parse(s);const c=o.parseJson?await o.parseJson(s,{request:n.#z(r),response:r}):JSON.parse(s);return void 0===t?c:at(c,t)});return i}static#re(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#se;#X=0;#oe;#$;#ee;#ne;#Y=/* @__PURE__ */new WeakSet;#ie;#ae;#ce=!1;#ue=/* @__PURE__ */new WeakMap;constructor(t,r={}){if(this.#oe=t,Object.hasOwn(r,"prefixUrl"))throw new Error("The `prefixUrl` option has been renamed `prefix` in v2 and enhanced to allow slashes in input. See also the new `baseUrl` option for improved flexibility with standard URL resolution: https://github.com/sindresorhus/ky#baseurl");if(this.#$={...r,headers:$e(this.#oe.headers,r.headers),hooks:Ve({},r.hooks),method:Ze(r.method??this.#oe.method??"GET"),prefix:String(r.prefix||""),retry:Je(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,totalTimeout:r.totalTimeout??!1,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#oe&&!(this.#oe instanceof URL||this.#oe instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if("string"==typeof this.#oe){if(this.#$.prefix){const e=this.#$.prefix.replace(/\/+$/,""),t=this.#oe.replace(/^\/+/,"");this.#oe=`${e}/${t}`}if(this.#$.baseUrl){let e;try{e=new URL(this.#oe)}catch{}e||(this.#oe=new URL(this.#oe,new Request(this.#$.baseUrl).url))}}Te&&Se&&(this.#ne=this.#$.signal??this.#oe.signal,this.#se=new globalThis.AbortController,this.#$.signal=this.#le()),Ee&&(this.#$.duplex="half"),void 0!==this.#$.json&&(this.#$.body=this.#$.stringifyJson?.(this.#$.json)??JSON.stringify(this.#$.json),this.#$.headers.set("content-type",this.#$.headers.get("content-type")??"application/json"));const s=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#oe instanceof globalThis.Request&&(Ae&&this.#$.body instanceof globalThis.FormData||this.#$.body instanceof URLSearchParams)&&!s&&this.#$.headers.delete("content-type"),this.request=new globalThis.Request(this.#oe,this.#$),void 0!==(o=this.#$.searchParams)&&(Array.isArray(o)?o.length>0:o instanceof URLSearchParams?o.size>0||Boolean(o[Be]?.size):"object"==typeof o?Object.keys(o).length>0:"string"==typeof o?o.trim().length>0:Boolean(o))){const t=new URL(this.request.url),r=this.#$.searchParams?.[Be];if(r)for(const e of r)t.searchParams.delete(e);if("string"==typeof this.#$.searchParams){const e=this.#$.searchParams.replace(/^\?/,"");""!==e&&(t.search=t.search?`${t.search}&${e}`:`?${e}`)}else{const r=new URLSearchParams(e.#re(this.#$.searchParams));for(const[e,s]of r.entries())t.searchParams.append(e,s)}if(this.#$.searchParams&&"object"==typeof this.#$.searchParams&&!Array.isArray(this.#$.searchParams)&&!(this.#$.searchParams instanceof URLSearchParams))for(const[e,s]of Object.entries(this.#$.searchParams))void 0===s&&t.searchParams.delete(e);this.request=new globalThis.Request(t,this.#$)}var o;if(this.#$.onUploadProgress&&"function"!=typeof this.#$.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");this.#ae="number"==typeof this.#$.totalTimeout?this.#he():void 0}#de(){const e=this.#$.retry.delay(this.#X+1);let t=e;return!0===this.#$.retry.jitter?t=Math.random()*e:"function"==typeof this.#$.retry.jitter&&(t=this.#$.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e)),Math.min(this.#$.retry.backoffLimit,t)}async#fe(e){if(this.#X>=this.#$.retry.limit)throw e;const t=e instanceof Error?e:new we(e);if(t instanceof be)return t.customDelay??this.#de();if(!this.#$.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#$.retry.shouldRetry){const r=await this.#$.retry.shouldRetry({error:t,retryCount:this.#X+1});if(!1===r)throw e;if(!0===r)return this.#de()}if(function(e){return tt(e,Re)}(e)){if(!this.#$.retry.retryOnTimeout)throw e;return this.#de()}if(function(e){return tt(e,ye)}(e)){if(!this.#$.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#$.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);return Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now()),Number.isFinite(e)?(e=Math.max(0,e),Math.min(this.#$.retry.maxRetryAfter,e)):Math.min(this.#$.retry.maxRetryAfter,this.#de())}if(413===e.response.status)throw e;return this.#de()}if(!function(e){return tt(e,ge)}(e))throw e;return this.#de()}#K(e){const t=this.#z(e);return this.#$.parseJson&&(e.json=async()=>{const r=await e.text();return""===r?JSON.parse(r):this.#$.parseJson(r,{request:t,response:e})}),e}async#Z(e){const t=await this.#pe(e,this.#me());if(t===rt)return void this.#ye();if(!t)return;if(!this.#ge(e.headers.get("content-type")??""))return t;const r=await this.#we(t,e,this.#me(),this.#z(e));if(r!==rt)return r;this.#ye()}#me(){const e=!1===this.#$.timeout?1e4:this.#$.timeout,t=this.#be();if(void 0===t)return e;if(t<=0)throw new Re(this.request);return Math.min(e,t)}#ge(e){const t=(e.split(";",1)[0]??"").trim().toLowerCase();return/\/(?:.*[.+-])?json$/.test(t)}async#pe(e,t){const{body:r}=e;if(!r)try{return await e.text()}catch{return}let s;try{s=r.getReader()}catch{return}const o=(e=>{const t=/;\s*charset\s*=\s*(?:"([^"]+)"|([^;,\s]+))/i.exec(e),r=t?.[1]??t?.[2];if(r)try{return new TextDecoder(r)}catch{}return new TextDecoder})(e.headers.get("content-type")??""),n=[];let i=0;const a=(async()=>{try{for(;;){const{done:e,value:t}=await s.read();if(e)break;if(i+=t.byteLength,i>10485760)return void s.cancel().catch(()=>{});n.push(o.decode(t,{stream:!0}))}}catch{return}return n.push(o.decode()),n.join("")})(),c=new Promise(e=>{const r=setTimeout(()=>{e(rt)},t);a.finally(()=>{clearTimeout(r)})}),u=await Promise.race([a,c]);return u===rt&&s.cancel().catch(()=>{}),u}async#we(e,t,r,s){let o;try{return await Promise.race([Promise.resolve().then(()=>this.#$.parseJson?this.#$.parseJson(e,{request:s,response:t}):JSON.parse(e)),new Promise(e=>{o=setTimeout(()=>{e(rt)},r)})])}catch{return}finally{clearTimeout(o)}}#te(e){e&&e.cancel().catch(()=>{})}#J(e){this.#te(e.body??void 0)}#le(){return this.#ne?AbortSignal.any([this.#ne,this.#se.signal]):this.#se.signal}#ye(){const e=this.#be();if(void 0!==e&&e<=0)throw new Re(this.request)}async#j(){for(const e of this.#$.hooks.beforeRequest){const t=await e({request:this.request,options:this.#W(),retryCount:0});if(nt(t))this.#ve(t);else if(it(t))return t}}async#V(e){const t=this.#z(e);for(const s of this.#$.hooks.afterResponse){const o=this.#Re(e.clone(),t);let n;this.#K(o);try{n=await s({request:this.request,options:this.#W(),response:o,retryCount:this.#X})}catch(r){throw o!==e&&this.#J(o),this.#J(e),r}if(n instanceof Ne)throw o!==e&&this.#J(o),this.#J(e),new be(n.options);const i=it(n)?this.#Re(n,t):e;o!==e&&o!==i&&o.body!==i.body&&this.#J(o),e!==i&&e.body!==i.body&&this.#J(e),e=i}return e}async#H(e){try{return await e()}catch(t){return this.#B(t,e)}}async#B(e,t){this.#ce=!1;const r=Math.min(await this.#fe(e),2147483647),s={signal:this.#ne},o=this.#be();if(void 0!==o){if(o<=0)throw new Re(this.request);if(r>=o)throw await Ye(o,s),new Re(this.request)}if(await Ye(r,s),this.#ye(),e instanceof be&&e.customRequest){const t=new globalThis.Request(e.customRequest,this.#$.signal?{signal:this.#$.signal}:void 0);this.#ve(t)}for(const i of this.#$.hooks.beforeRetry){let t;try{t=await i({request:this.request,options:this.#W(),error:e,retryCount:this.#X+1})}catch(n){throw n instanceof Error&&n!==e&&this.#Y.add(n),n}if(nt(t)){this.#ve(t);break}if(it(t))return this.#ce=!0,this.#X++,t;if(t===Pe)return}return this.#ye(),this.#X++,this.#H(t)}#Q(){const e=this.#ce;return this.#ce=!1,e}async#G(){this.#se?.signal.aborted&&(this.#se=new globalThis.AbortController,this.#$.signal=this.#le(),this.request=new globalThis.Request(this.request,{signal:this.#$.signal}));const e=(e=>{const t={};for(const r in e)Object.hasOwn(e,r)&&(r in _e||r in qe||(t[r]=e[r]));return t})(this.#$),t=this.#$.retry.limit>0?this.request.clone():void 0,r=this.#Ee(this.request,this.#$.body??void 0);this.#ee=r,t&&(this.request=t);try{const t=this.#be();if(void 0!==t&&t<=0)throw new Re(this.request);const s=!1===this.#$.timeout?t:void 0===t?this.#$.timeout:Math.min(this.#$.timeout,t),o=void 0===s?await this.#$.fetch(r,e):await async function(e,t,r,s){return new Promise((o,n)=>{const i=setTimeout(()=>{r&&r.abort(),n(new Re(e))},s.timeout);s.fetch(e,t).then(o).catch(n).then(()=>{clearTimeout(i)})})}(r,e,this.#se,{timeout:s,fetch:this.#$.fetch});return this.#Re(o,r)}catch(s){if(function(e){if(!e||(t=e,"[object Error]"!==Xe.call(t))||"TypeError"!==e.name||"string"!=typeof e.message)return!1;var t;const{message:r,stack:s}=e;return"Load failed"===r?void 0===s||"__sentry_captured__"in e:!!r.startsWith("error sending request for url")||!!("Failed to fetch"===r||r.startsWith("Failed to fetch (")&&r.endsWith(")"))||et.has(r)}(s))throw new ge(this.request,{cause:s});throw s}}#be(){if(void 0===this.#ae)return;const e=this.#he()-this.#ae;return Math.max(0,this.#$.totalTimeout-e)}#he(){return globalThis.performance?.now()??Date.now()}#W(){if(!this.#ie){const{hooks:e,json:t,parseJson:r,stringifyJson:s,searchParams:o,timeout:n,totalTimeout:i,throwHttpErrors:a,fetch:c,...u}=this.#$;this.#ie=Object.freeze(u)}return this.#ie}#ve(e){this.#ie=void 0,this.request=e}#z(e){return this.#ue.get(e)??this.request}#Re(e,t){return this.#ue.set(e,t),e}#Ee(e,t){return this.#$.onUploadProgress&&e.body&&Ee?((e,t,r)=>{if(!e.body)return e;const s=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,s]of e)t+=40,t+=Le.encode(`Content-Disposition: form-data; name="${r}"`).byteLength,t+="string"==typeof s?Le.encode(s).byteLength:s.size;return t}return e instanceof Blob?e.size:e instanceof ArrayBuffer||ArrayBuffer.isView(e)?e.byteLength:"string"==typeof e?Le.encode(e).byteLength:e instanceof URLSearchParams?Le.encode(e.toString()).byteLength:0})(r??e.body);return new Request(e,{duplex:"half",body:xe(e.body,s,t)})})(e,this.#$.onUploadProgress,t??this.#$.body??void 0):e}},ut=e=>{const t=(t,r)=>ct.create(t,Me(e,r));for(const r of Ie)t[r]=(t,s)=>ct.create(t,Me(e,s,{method:r}));return t.create=e=>ut(Me(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),ut(Me(e,t))),t.stop=Pe,t.retry=De,t},lt=ut(),ht={PUBLIC_EVENTS:"/",FOLDER_EVENTS:e=>`/${e}`,LOGIN:"/auth/login",REGISTER:"/auth/register",FORGOT_PASSWORD:"/auth/forgot-password",RESET_PASSWORD:"/auth/reset-password",VERIFY_EMAIL:"/auth/verify-email",GALLERY:e=>`/event/${e}`,UPLOAD:e=>`/event/${e}/upload`,CURATE:e=>`/event/${e}/curate`,LEADERBOARD:e=>`/event/${e}/leaderboard`,MY_UPLOADS:"/my-uploads"},dt={ORGANIZATION_SETTINGS:e=>`https://qrati.com/org/${e}/settings`,ORGANIZATION_SETTINGS_INTEGRATION:e=>`https://qrati.com/org/${e}/settings/integration`,ORGANIZATION_DASHBOARD:e=>`https://qrati.com/org/${e}/dashboard`,ORGANIZATION_ADMINS:e=>`https://qrati.com/org/${e}/admins`,EVENT_SETTINGS_BASIC_DETAILS:e=>`https://qrati.com/event/${e}/settings`,EVENT_REVIEW_CONTENTS:e=>`https://qrati.com/event/${e}/review-contents`,EVENT_DEEP_SEARCH:e=>`https://qrati.com/event/${e}/deep-search`,EVENT_GENERATE_ARTICLE:e=>`https://qrati.com/event/${e}/generate-article`,EVENT_ACCESS_REQUESTS:e=>`https://qrati.com/event/${e}/access-requests`,EVENT_SHOT_INSPECTOR:e=>`https://qrati.com/event/${e}/shot-inspector`,EVENT_CURATION_DETAILS:e=>`https://qrati.com/event/${e}/curation-details`},ft={PUBLIC:"PUBLIC",PRIVATE:"PRIVATE",SECRET:"SECRET"},pt="https://qrati.com/api/connect",mt={INITIALIZE_SESSION:`${pt}/session/initialize`,REGISTER:`${pt}/auth/register`,LOGIN:`${pt}/auth/login`,LOGOUT:`${pt}/auth/logout`,UPDATE_SESSION:`${pt}/session/update`,ACCEPT_TERMS:`${pt}/auth/accept-terms`,EXTERNAL_LOGIN:`${pt}/auth/external-login`,PUBLIC_EVENTS:`${pt}/event/public-events`,SEARCH_EVENTS:`${pt}/event/search`,FOLDER_DETAILS:`${pt}/folder/details`,NESTED_FOLDERS:`${pt}/folder/nested-folders`,GET_EVENT_POINTS:`${pt}/event/points`,ELIGIBLE_TO_CURATE:`${pt}/content/curation-eligibility`,CONTENT_FOR_CURATION:`${pt}/content/for-curation`,CURATE_CONTENT:`${pt}/content/curate`,GET_LEADERBOARD:`${pt}/event/leaderboard`,GET_UPLOAD_COUNT:`${pt}/event/upload-count`,UPLOAD_CREATE:`${pt}/content/upload/create`,UPLOAD_COMPLETE:`${pt}/content/upload/complete`,UPLOAD_FAIL:`${pt}/content/upload/fail`,UPLOAD_ABORT:`${pt}/content/upload/abort`,UPDATE_REACTION:`${pt}/content/update-reaction`,EVENT_DATA:`${pt}/event/details-with-ads-parameters`,UPDATE_EVENT_LAYOUT:`${pt}/event/update-layout`,GET_EVENT_STATISTICS:`${pt}/event/statistics`,GET_CONTENTS:`${pt}/content/for-gallery`,SEARCH_CONTENTS:`${pt}/content/search`,GET_CONTENTS_COUNT:`${pt}/content/count`,UPDATE_AD_ANALYTICS:`${pt}/event/update-ad-analytics`,UPDATE_GAM_ANALYTICS:`${pt}/event/update-gam-analytics`,INCREMENT_EVENT_VIEW:`${pt}/event/increment-view`,SEND_PASSWORD_RESET_CODE:`${pt}/auth/send-password-reset-code`,VERIFY_PASSWORD_RESET_CODE:`${pt}/auth/verify-password-reset-code`,RESET_PASSWORD:`${pt}/auth/reset-password`,REPORT_ERROR:`${pt}/session/report-error`,GET_POST_PROCESSING_SETTINGS:`${pt}/event/post-processing-settings`,MY_UPLOADS:`${pt}/content/my-uploads`,DELETE_CONTENT:`${pt}/content/delete`},yt={OWNER:"owner",ADMIN:"admin",MODERATOR:"moderator"},gt={IMAGE:"IMAGE",VIDEO:"VIDEO",AD:"AD",GAM_AD:"GAM_AD"},wt={GAM_IMPRESSION:"gam_impression",GAM_VIEWABLE:"gam_viewable",GAM_CLICK:"gam_click"},bt={ROW:"ROW",COLUMN:"COLUMN",MASONRY:"MASONRY"},vt={IN_REVIEW:"IN_REVIEW",APPROVED:"APPROVED",REJECTED:"REJECTED"},Rt=26214400,Et=262144e3,Tt={CLOSED:"CLOSED",OPEN:"OPEN",UPCOMING:"UPCOMING"},St={TEXT:"text",IMAGE:"image",LOTTIE:"lottie"},Ot={CONTEST:"CONTEST",REACTION:"REACTION"},At={GRID:"grid",SINGLE:"single"},It={POPULAR:"popular",UPLOAD_TIME:"upload",CAPTURE_TIME:"capture"},Ct={[It.POPULAR]:{label:"Popular",sortField:"score"},[It.UPLOAD_TIME]:{label:"Uploaded",sortField:"createdAt"},[It.CAPTURE_TIME]:{label:"Captured",sortField:"capturedAt"}},Pt="map-view-state",Nt=It.UPLOAD_TIME,Dt={ASC:"asc",DESC:"desc"},qt={[Dt.ASC]:{label:"Ascending",sortOrder:""},[Dt.DESC]:{label:"Descending",sortOrder:"-"}},_t=Dt.DESC,Lt={OWN:"own",CURATED:"curated",ELIGIBLE:"eligible"},xt={NONE:null,LINK:"LINK",EMAIL:"EMAIL",PHONE:"PHONE",SMS:"SMS",WHATSAPP:"WHATSAPP",MESSENGER:"MESSENGER"},kt={AD_IMPRESSION:"impression",AD_ENGAGEMENT:"engagement",AD_CLICK:"click"},Ft={QRATI_CONNECT_SESSION:"qrati-connect-session",EVENT_IN_REVIEW_COUNT:e=>`in-review-count-${e}`,CONTENTS_BY_EVENT:e=>`contents-by-event-${e}`,USER_UPLOADS:"user-uploads"};function Ut({title:e,children:t}){/* @__PURE__ */
2
+ return i("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */i("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit text-[#ff4800]",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */i("g",{transform:"translate(-443.142 -257.876)",children:[
3
+ /* @__PURE__ */i("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
4
+ /* @__PURE__ */i("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
5
+ /* @__PURE__ */i("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
6
+ /* @__PURE__ */i("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
7
+ /* @__PURE__ */i("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
8
+ /* @__PURE__ */i("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
9
+ /* @__PURE__ */i("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 21.923)",fill:"#3f3d56"}),
10
+ /* @__PURE__ */i("path",{d:"M777.254,685.116H250.161a8.257,8.257,0,0,1-8.248-8.248V395.532a8.257,8.257,0,0,1,8.248-8.248H777.254a8.257,8.257,0,0,1,8.248,8.248V676.869a8.257,8.257,0,0,1-8.248,8.248Zm-527.092-296a6.422,6.422,0,0,0-6.415,6.415V676.869a6.422,6.422,0,0,0,6.415,6.415H777.254a6.422,6.422,0,0,0,6.415-6.415V395.532a6.422,6.422,0,0,0-6.415-6.415Z",transform:"translate(317.143 20.083)",fill:"#ccc"}),
11
+ /* @__PURE__ */i("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(928.82 428.806)",fill:"#f2f2f2"}),
12
+ /* @__PURE__ */i("path",{d:"M505.77,325.365h.2l3.553,203.7h-7.5Z",transform:"translate(495.097 175.29)",fill:"#ccc"}),
13
+ /* @__PURE__ */i("path",{d:"M736.239,636.154h0a1.776,1.776,0,0,1-.744,2.4l-10.3,5.425-1.655-3.144,10.3-5.425A1.776,1.776,0,0,1,736.239,636.154Z",transform:"translate(276.882 -0.641)",fill:"#ccc"}),
14
+ /* @__PURE__ */i("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(722.256 428.806)",fill:"#f2f2f2"}),
15
+ /* @__PURE__ */i("path",{d:"M510.532,627.307h0a1.777,1.777,0,0,0-2.4-.744l-7.194,3.788-2.464-141.27h-.2l-3.75,203.7h7.5l-1.02-58.456,8.78-4.622A1.777,1.777,0,0,0,510.532,627.307Z",transform:"translate(296.026 11.574)",fill:"#ccc"}),
16
+ /* @__PURE__ */i("path",{d:"M626.318,603.854a2.25,2.25,0,0,0-3.04-.943l-9.116,4.8-3.122-179h-.25l-4.752,258.115h9.5l-1.292-74.07,11.125-5.857a2.251,2.251,0,0,0,.943-3.04Z",transform:"translate(286.704 16.621)",fill:"#3f3d56"}),
17
+ /* @__PURE__ */i("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1Z",transform:"translate(318.982 22.257)",fill:"#fff"}),
18
+ /* @__PURE__ */i("path",{d:"M671.188,708.113h-370.8c-.464,0-.928-.01-1.386-.036l175.372-98.766c3.339-1.919,10.831-2.595,16.734-1.509a15.16,15.16,0,0,1,4.641,1.509l117.7,66.28,5.639,3.172Z",transform:"translate(288.046 16.168)",fill:"#f2f2f2"}),
19
+ /* @__PURE__ */i("path",{d:"M788.457,708.163H467.743l62.148-29.351,4.472-2.114,80.984-38.25c5.309-2.507,18.082-2.663,24.324-.473q.629.224,1.166.473Z",transform:"translate(287.761 16.118)",fill:"#f2f2f2"}),
20
+ /* @__PURE__ */i("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1ZM250.155,363.117a28.441,28.441,0,0,0-28.409,28.409V672.862a28.441,28.441,0,0,0,28.409,28.409H777.247a28.441,28.441,0,0,0,28.409-28.409V391.525a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 22.257)",fill:"#3f3d56"}),
21
+ /* @__PURE__ */i("g",{transform:"translate(696.754 297.373)",children:[
22
+ /* @__PURE__ */i("ellipse",{cx:"61.798",cy:"61.798",rx:"61.798",ry:"61.798",transform:"translate(215.662 36.955)",fill:"#ff6584"}),
23
+ /* @__PURE__ */i("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(225.025 127.808)",fill:"#e6e6e6"}),
24
+ /* @__PURE__ */i("path",{d:"M508.105,323.365h.215l3.87,221.909h-8.171Z",transform:"translate(-204.593 -117.286)",fill:"#ccc"}),
25
+ /* @__PURE__ */i("path",{d:"M739.374,634.239h0a1.935,1.935,0,0,1-.811,2.614l-11.226,5.91-1.8-3.425,11.226-5.91A1.935,1.935,0,0,1,739.374,634.239Z",transform:"translate(-422.513 -281.249)",fill:"#ccc"}),
26
+ /* @__PURE__ */i("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
27
+ /* @__PURE__ */i("path",{d:"M513.962,637.661h0a1.936,1.936,0,0,0-2.614-.811l-7.837,4.126-2.684-153.9h-.215l-4.085,221.91H504.7l-1.111-63.68,9.565-5.036A1.936,1.936,0,0,0,513.962,637.661Z",transform:"translate(-422.126 -281.002)",fill:"#ccc"}),
28
+ /* @__PURE__ */i("path",{d:"M612.666,280.653c54.774,0,99.294,103.207,99.294,171.768s-44.4,124.14-99.177,124.14-99.177-55.579-99.177-124.14S557.892,280.653,612.666,280.653Z",transform:"translate(-422.155 -280.653)",fill:"currentColor"}),
29
+ /* @__PURE__ */i("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */i("div",{className:"space-y-4",children:[/* @__PURE__ */i("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */i("p",{className:"text-muted-foreground text-center",children:t})]})]})}var Mt=({organizationId:e})=>/* @__PURE__ */i("a",{className:"font-medium text-blue-500",href:dt.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Guide"});function $t({organizationId:e,errorType:t,errorMessage:r}){/* @__PURE__ */
30
+ return i(Ut,"custom-auth-invalid"===t?{title:"Setup needed",children:["Custom auth is enabled. Pass ",
31
+ /* @__PURE__ */i("code",{children:"uid"}),", ",
32
+ /* @__PURE__ */i("code",{children:"fname"}),", and ",
33
+ /* @__PURE__ */i("code",{children:"lname"})," as props to QratiConnect to complete setup. See our ",
34
+ /* @__PURE__ */i(Mt,{organizationId:e})," for details."]}:"service-unavailable"===t?{title:"We'll be right back!",children:["Our service is getting a quick tune-up. Hang tight — great things are coming your way soon! See our"," ",
35
+ /* @__PURE__ */i(Mt,{organizationId:e})," if you need help in the meantime."]}:"generic-error"===t&&r?{title:"Setup needed",children:[r," See our ",
36
+ /* @__PURE__ */i(Mt,{organizationId:e})," for details."]}:"page-not-registered"===t?{title:"Page not registered",children:["Add the current page URL in Allowed URLs under"," ",
37
+ /* @__PURE__ */i("a",{className:"font-medium text-blue-500",href:dt.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨ Integration Settings. See our ",
38
+ /* @__PURE__ */i(Mt,{organizationId:e})," for details."]}:{title:"Heads up",children:["Something needs attention. See our ",
39
+ /* @__PURE__ */i(Mt,{organizationId:e})," for details or contact Qrati support."]})}var jt='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif',Ht=e=>e.trim().replace(/\s+/g," "),Gt=e=>e?.replace(/\/+$/,"")||"",Qt=e=>{if(!e)return jt;const t=Ht("string"==typeof e?e:e.fontFamily||""),r="string"==typeof e?void 0:e.customFontName;return t&&"system"!==t?"custom"===t?`"${r||"QratiCustomFont"}", ${jt}`:`"${t}", ${jt}`:"inherit"};function Vt(e){var t,r,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=Vt(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}function Bt(){for(var e,t,r=0,s="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=Vt(e))&&(s&&(s+=" "),s+=t);return s}var zt=(...e)=>Bt(e.filter(Boolean)),Wt=e=>{const t=e.replace(/#/g,"");return(299*parseInt(t.slice(0,2),16)+587*parseInt(t.slice(2,4),16)+114*parseInt(t.slice(4,6),16))/1e3>=128?"#000000":"#FFFFFF"},Zt="px",Kt=(e,t="light")=>{const r=e?.themeSettings?.colors??{},s=e?.themeSettings?.border,o=e?.themeSettings?.shadow,n=e?.integrationSettings,i="dark"===t,a=(e,t,s,o)=>{const n=i?o:s;return r[i?t:e]||n},c=a("primaryLight","primaryDark","#ff4800","#ff4800");return{"--background":a("backgroundLight","backgroundDark","#fafafa","#0a0a0a"),"--foreground":a("foregroundLight","foregroundDark","#252629","#f5f5f5"),"--muted":a("mutedLight","mutedDark","#e5e5e5","#171717"),"--muted-foreground":a("mutedForegroundLight","mutedForegroundDark","#484848","#b5b8bb"),"--border":a("borderLight","borderDark","#dddddd","#353538"),"--input":a("inputLight","inputDark","#f5f5f5","#171717"),"--primary":c,"--primary-foreground":Wt(c),"--popover":a("popoverLight","popoverDark","#f5f5f5","#171717"),"--popover-foreground":a("popoverForegroundLight","popoverForegroundDark","#252629","#fafafa"),"--info":a("infoLight","infoDark","#2563eb","#5b8def"),"--warning":a("warningLight","warningDark","#f59e0b","#fbbf24"),"--success":a("successLight","successDark","#10b981","#34d399"),"--destructive":a("destructiveLight","destructiveDark","#ef4444","#f87171"),"--border-width":`${s?.width??"1"}${s?.unit??"px"}`,"--radius":`${s?.radius??"10"}${s?.unit??"px"}`,"--shadow-outer-horizontal-offset":`${o?.outerHorizontalOffset??"0"}${o?.unit??Zt}`,"--shadow-outer-vertical-offset":`${o?.outerVerticalOffset??"0"}${o?.unit??Zt}`,"--shadow-outer-blur":`${o?.outerBlur??"0"}${o?.unit??Zt}`,"--shadow-outer-spread":`${o?.outerSpread??"0"}${o?.unit??Zt}`,...n?.fontFamily&&"system"!==n.fontFamily?{"--font-family":Qt(n)}:{}}},Jt=async e=>{try{return await e()}catch{return null}},Yt=(e,t=1)=>{const r=(new TextEncoder).encode(e),s=3432918353,o=461845907;let n=t>>>0;const i=Math.floor(r.length/4),a=new DataView(r.buffer,r.byteOffset,r.byteLength);for(let h=0;h<i;h++){let e=a.getUint32(4*h,!0);e=Math.imul(e,s),e=e<<15|e>>>17,e=Math.imul(e,o),n^=e,n=n<<13|n>>>19,n=Math.imul(n,5)+3864292196>>>0}let c=0;const u=4*i,l=3&r.length;return 3===l&&(c^=r[u+2]<<16),l>=2&&(c^=r[u+1]<<8),l>=1&&(c^=r[u],c=Math.imul(c,s),c=c<<15|c>>>17,c=Math.imul(c,o),n^=c),n^=r.length,n^=n>>>16,n=Math.imul(n,2246822507)>>>0,n^=n>>>13,n=Math.imul(n,3266489909)>>>0,n^=n>>>16,n.toString(16).padStart(8,"0")},Xt=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(Xt).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const s of t){const t=e[s];void 0!==t&&r.push(`${Xt(s)}:${Xt(t)}`)}return`{${r.join(",")}}`},er=async({debug:e=!1}={})=>{const t=performance.now(),r=await Jt(async()=>window.navigator.userAgentData&&"function"==typeof window.navigator.userAgentData.getHighEntropyValues?Xt(await window.navigator.userAgentData.getHighEntropyValues(["architecture","bitness","platformVersion","model","fullVersionList"])):null),s=await Jt(()=>(()=>{const e=document.createElement("video"),t=["video/webm","video/mp4","video/ogg","audio/mp4","audio/webm","audio/ogg","audio/mpeg"],r={};for(const s of t){const t=e.canPlayType(s);r[s]=""===t?"no":t}return Xt(r)})()),o=await Jt(()=>(()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const s={};for(const n of e)r.style.fontFamily=n,s[n]=r.offsetWidth;const o=[];for(const n of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${n}", ${i}`,r.offsetWidth!==s[i]){o.push(n),t=!0;break}t||(r.style.fontFamily=`"${n}"`,r.offsetWidth!==s.monospace&&r.offsetWidth!==s.serif&&o.push(n))}return document.body.removeChild(r),o.length?o.sort().join(","):null})()),n=await Jt(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),i=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,a=Intl.DateTimeFormat().resolvedOptions(),c=a.timeZone,u=/* @__PURE__ */(new Date).getTimezoneOffset(),l=a.calendar||null,h=void 0!==a.hour12?a.hour12?"h12":"h23":a.hourCycle||null,d=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",f=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",p=window.matchMedia("(prefers-contrast: more)").matches?"more":window.matchMedia("(prefers-contrast: less)").matches?"less":window.matchMedia("(prefers-contrast: custom)").matches?"custom":"no-preference",m=window.matchMedia("(prefers-reduced-transparency: reduce)").matches?"reduce":"no-preference",y=window.matchMedia("(forced-colors: active)").matches?"active":null,g="number"==typeof window.devicePixelRatio?Math.round(100*window.devicePixelRatio)/100:null,{pixelDepth:w,colorDepth:b}=window.screen,v="ontouchstart"in window||window.navigator.maxTouchPoints>0,R=await Jt(()=>(async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),s=r.createLinearGradient(0,0,280,100);return s.addColorStop(0,"#f60"),s.addColorStop(.4,"#09f"),s.addColorStop(.7,"#f09"),s.addColorStop(1,"#0f9"),r.fillStyle=s,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t)),Yt(t.toDataURL("image/png"))})(e)),E=await Jt(()=>(async()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return Yt(Xt({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))})()),T=await Jt(()=>(async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return Yt(Xt(r))})(e)),S=await Jt(()=>(async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const s=t.createDynamicsCompressor();s.threshold.value=-48,s.knee.value=30,s.ratio.value=14,s.attack.value=0,s.release.value=.3;const o=t.createGain();o.gain.value=.4,r.connect(s),s.connect(o),o.connect(t.destination),r.start(0);const n=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let u=3e3;u<5800;u+=2){const e=n[u];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const c=i>>>0^a>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(n.slice(4500,5e3)),s=e.width/r.length;for(let o=0;o<r.length;o++){const n=o*s,i=(r[o]+1)/2*e.height;0===o?t.moveTo(n,i):t.lineTo(n,i)}t.stroke(),document.body.appendChild(e)}return Yt(c.toString(16))})(e)),O=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,A=await Jt(()=>window.screen.orientation?.type||null),I=window.navigator.connection||window.navigator.mozConnection||window.navigator.webkitConnection,C=I&&I.type||null,P=I?.effectiveType||null,N=!0===I?.saveData,D="boolean"==typeof window.navigator.pdfViewerEnabled?window.navigator.pdfViewerEnabled:null,q="boolean"==typeof window.navigator.webdriver?window.navigator.webdriver:null,_=await Jt(()=>"function"!=typeof Intl.supportedValuesOf?null:Intl.supportedValuesOf("calendar").join(",")),L=await Jt(async()=>{if(!window.navigator.permissions||"function"!=typeof window.navigator.permissions.query)return null;const e=["geolocation","notifications"],t={};for(const r of e)try{t[r]=(await window.navigator.permissions.query({name:r})).state}catch{t[r]="unsupported"}return Xt(t)}),x={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,userAgentHighEntropy:r||null,mediaCodecs:s||null,fonts:o,numberingSystem:n,languages:i,timezone:c,timezoneOffset:u,intlCalendar:l,hourCycle:h,reducedMotion:d,colorScheme:f,prefersContrast:p,prefersReducedTransparency:m,pdfViewerEnabled:D,webdriver:q,intlSupportedCalendars:_||null,permissionsState:L||null,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:y,devicePixelRatio:g,pixelDepth:w,colorDepth:b,touchSupport:v,screenOrientation:A||null,connectionType:C,effectiveType:P,saveData:N,canvasID:R,webglID:E,webgpuID:T,audioID:S},k={aspectRatio:O,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(x,k);const F=Yt(Xt(x)),U=Math.round(performance.now()-t);return{fingerprint:F,...x,elapsedMs:U}};"undefined"!=typeof window&&(window.getBrowserFingerprint=er);var tr=async(e,t)=>{if(e instanceof ye){try{const t=e.data;if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},rr=e(void 0),sr=({props:e={},children:o})=>{const{organizationId:c,uid:u,fname:l,lname:h,theme:d="light"}=e,f=ce(),[p,m]=r(null),[y,g]=r(()=>{if("undefined"==typeof window)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:w,data:b,error:v}=pe({queryKey:[Ft.QRATI_CONNECT_SESSION,c,u??null,l??null,h??null],queryFn:async()=>{const e=await(async()=>{const e=await er();return"string"==typeof e?e:e?.fingerprint})();try{return(await lt.post(mt.INITIALIZE_SESSION,{json:{uid:u,fname:l,lname:h,browserFingerprint:e},headers:{"x-org-id":c,...!y?.token||u||l||h?{}:{Authorization:`Bearer ${y.token}`}}}).json()).data}catch(t){if(t instanceof ye)try{const e=t.data;t.apiMessage=e?.message||e?.error}catch{}throw t}},enabled:!!c});t(()=>{const e=b?.authSession?.session?.token??b?.authSession?.token,t=b?.authSession?.user;t&&e?(g(r=>({...r,...t,token:e,tcAccepted:void 0===t.tcAccepted?r?.tcAccepted:t.tcAccepted})),localStorage.setItem("qrati_token",e)):b?.organization?.customAuth&&u&&l&&g(e=>e??{_id:u,uid:u,name:h?`${l} ${h}`:l,fname:l,lname:h})},[b]);const R=s(()=>{const e=b?.organization?.integrationSettings?.fontFamily,t=((e,t)=>{const r=Gt("https://qrati.com"),s=t?Ht(t):"";return r&&s?`${r}/api/connect/organization/google-font?family=${encodeURIComponent(s)}`:null})(0,e),r=((e,t)=>{const r=Gt("https://qrati.com");return r&&t?`${r}/api/connect/organization/custom-font?organizationId=${encodeURIComponent(t)}`:null})(0,c);return((e,t,r)=>{if(!e?.fontFamily||"system"===e.fontFamily)return"";const s=Ht(e.fontFamily);if("custom"===s&&t){const r=e.customFontName||"QratiCustomFont",s=/\.woff2(\?|$)/i.test(t)?"woff2":/\.ttf(\?|$)/i.test(t)?"truetype":"woff";return`@font-face{font-family:"${o=r,o.replace(/"/g,'\\"')}";src:url("${t}") format("${s}");font-weight:400 700;font-style:normal;font-display:swap;}`}var o;const n=r||(e=>{if(!e)return null;const t=Ht(e);return t&&"system"!==t.toLowerCase()&&"custom"!==t.toLowerCase()?`https://fonts.googleapis.com/css2?family=${t.replace(/\s+/g,"+")}:wght@400;500;600;700&display=swap`:null})(s);return n?`@import url("${n}");`:""})(b?.organization?.integrationSettings,b?.organization?.customFontUrl?r||b.organization.customFontUrl:void 0,t||void 0)},[b?.organization?.integrationSettings,b?.organization?.customFontUrl,c]);t(()=>{const e=`data-qrati-font-${c}`;if(document.head.querySelector(`[${e}]`)?.remove(),R){if(R.startsWith("@import")){const t=R.match(/@import url\("([^"]+)"\)/);if(!t?.[1])return;const r=document.createElement("link");r.rel="stylesheet",r.href=t[1],r.setAttribute(e,""),document.head.appendChild(r)}else{const t=document.createElement("style");t.textContent=R,t.setAttribute(e,""),document.head.appendChild(t)}return()=>{document.head.querySelector(`[${e}]`)?.remove()}}},[R,c]);const E=a(async e=>{g(t=>({...t,...e}))},[]),T=a(async(e,t,r,s)=>{try{const o=await lt.post(mt.REGISTER,{json:{email:e,password:t,fname:r,lname:s},headers:{"x-org-id":c}}).json();return o.error?{error:o.error}:(g({...o.user,token:o.token}),o.token&&localStorage.setItem("qrati_token",o.token),o)}catch(v){return{error:await tr(v,"Registration failed")}}},[c]),S=a(async(e,t)=>{try{const r=await lt.post(mt.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:(g({...r.user,token:r.token}),r.token&&localStorage.setItem("qrati_token",r.token),r)}catch(v){return{error:await tr(v,"Invalid email or password")}}},[c]),O=a(async e=>{const t=await((e,t,r)=>new Promise((s,o)=>{if(!e)return void o(/* @__PURE__ */new Error("Provider is required"));if(!t)return void o(/* @__PURE__ */new Error("Organization ID is required"));const n=new URL(`${r}/qc-social-auth`);n.searchParams.set("provider",e),n.searchParams.set("organizationId",t),n.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,c=window.open(n.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!c)return void o(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const u=()=>{clearInterval(h),clearTimeout(d),window.removeEventListener("message",l)},l=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(h){console.warn("Could not parse origin for verification")}const{type:n,data:i,error:a,organizationId:l}=e.data||{};if(l===t)switch(n){case"QRATI_SOCIAL_AUTH_SUCCESS":u(),c.close(),s({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),u(),c.close(),o(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":u(),c.close(),o(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",l,"expected:",t)},h=setInterval(()=>{try{c.closed&&(u(),o(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",l);const d=setTimeout(()=>{u(),c.closed||c.close(),o(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,c??"","https://qrati.com");return t?.user&&t?.token&&(g({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t},[c]),A=a(async()=>O("google"),[O]),I=a(async()=>O("apple"),[O]),C=a(async e=>{try{const t=await lt.post(mt.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":c}}).json();return t.error?{error:t.error}:t}catch(v){return{error:await tr(v,"Failed to send password reset code")}}},[c]),P=a(async(e,t)=>{try{const r=await lt.post(mt.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(v){return{error:await tr(v,"Invalid code, please check your email")}}},[c]),N=a(async(e,t)=>{try{const r=await lt.post(mt.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":c}}).json();return r.error?{error:r.error}:r}catch(v){return{error:v?.message}}},[c]),D=a(async()=>{try{const e=await lt.post(mt.LOGOUT,{headers:{"x-org-id":c,Authorization:`Bearer ${y?.token}`}}).json();return e.error?{error:e.error}:(g(null),localStorage.removeItem("qrati_token"),await f.invalidateQueries({queryKey:[Ft.QRATI_CONNECT_SESSION]}),e)}catch(v){return{error:v?.message}}},[c,y?.token]),q=s(()=>({props:e,initializing:w,sessionId:b?.sessionId,organization:b?.organization,folders:b?.folders,orgRole:b?.orgRole??null,loadingUser:w,user:y,updateUser:E,registerUsingEmail:T,loginWithGoogle:A,loginWithApple:I,loginUsingEmail:S,sendPasswordResetCode:C,verifyPasswordResetCode:P,resetPassword:N,signout:D,error:v,portalContainer:p}),[e,w,b,y,E,T,A,I,S,C,P,N,D,v,p]);if(v){const e=v,t=401===e?.response?.status?"page-not-registered":e?.response?"generic-error":"service-unavailable";/* @__PURE__ */
40
+ return i(n,{fallback:null,children:/* @__PURE__ */i($t,{organizationId:c??"",errorType:t,errorMessage:"generic-error"===t?e.apiMessage:void 0})})}/* @__PURE__ */
41
+ return i(rr.Provider,{value:q,children:/* @__PURE__ */i("div",{ref:m,id:"qrati-connect-container",style:{...Kt(b?.organization,d),fontFamily:b?.organization?.integrationSettings?.fontFamily&&"system"!==b.organization.integrationSettings.fontFamily?"var(--font-family)":"inherit"},className:zt("bg-background text-foreground relative min-h-[80vh]"),children:o})})},or=()=>{const e=c(rr);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{d as $,St as A,K as B,wt as C,ht as D,Et as E,fe as F,M as G,B as H,ue as I,f as J,F as K,ce as L,qt as M,lt as N,Ft as O,pe as P,w as Q,re as R,bt as S,Rt as T,V as U,J as V,$ as W,v as X,R as Y,b as Z,_t as _,Kt as a,ft as b,kt as c,It as d,E as et,Ct as f,Nt as g,At as h,zt as i,q as it,Dt as j,Lt as k,xt as l,gt as m,or as n,O as nt,Bt as o,vt as p,k as q,er as r,L as rt,yt as s,sr as t,y as tt,mt as u,Ot as v,Pt as w,dt as x,Tt as y,Y as z};
@@ -1,5 +1,5 @@
1
- import{E as t,S as e,b as n,f as s,h as r,p as i,t as a,v as o,w as l,y as c}from"./C3uDEVBt.js";import{i as h}from"./BItJQVdK.js";var u=t(null),p=t(null),d=class{entries;index=0;listeners=/* @__PURE__ */new Set;constructor(t="/"){this.entries=[{path:t}]}get location(){return this.entries[this.index]?.path??"/"}get state(){return this.entries[this.index]?.state}push(t,e){this.entries=this.entries.slice(0,this.index+1),this.index=this.entries.push({path:t,state:e})-1,this.notify()}replace(t,e){this.entries[this.index]={path:t,state:e},this.notify()}go(t){const e=this.index+t;e>=0&&e<this.entries.length&&(this.index=e,this.notify())}listen(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.listeners.forEach(t=>t(this.location))}},f=class{listeners=/* @__PURE__ */new Set;get location(){return window.location.hash.replace(/^#/,"")||"/"}get state(){return window.history.state?.__qrati_state}makeUrl(t){return`${window.location.pathname+window.location.search}#${t}`}push(t,e){window.history.pushState({__qrati_state:e},"",this.makeUrl(t)),this.notify()}replace(t,e){window.history.replaceState({__qrati_state:e},"",this.makeUrl(t)),this.notify()}go(t){window.history.go(t)}listen(t){this.listeners.add(t);const e=()=>this.notify();return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),queueMicrotask(()=>t(this.location)),()=>{this.listeners.delete(t),window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}}notify(){this.listeners.forEach(t=>t(this.location))}};function m(){const t=c(p);if(!t)throw new Error("useParams must be used inside a Route");return t.params}function w(){const t=c(u);if(!t)throw new Error("useNavigate must be used inside a Router");const{navigate:e,go:n}=t;return o((t,s)=>{"number"!=typeof t?e(t,s):n(t)},[e,n])}function y(){const t=c(u);if(!t)throw new Error("useLocation must be used inside a Router");return{pathname:t.location,state:t.state,search:"",hash:""}}function v(t,e,n=!0){const s=t.split("/").filter(Boolean),r=function(t){const e=[],n=t.split("/").filter(Boolean);for(const s of n)if("*"===s)e.push({type:"wildcard"});else if(s.startsWith(":")){const t=s.endsWith("?"),n=t?s.slice(1,-1):s.slice(1);e.push({type:"param",name:n,optional:t})}else e.push({type:"static",value:s});return e}(e),i={};let a=0;for(const o of r)if("static"===o.type){if(s[a]!==o.value)return null;a++}else if("param"===o.type){if(a<s.length){try{i[o.name]=decodeURIComponent(s[a])}catch{i[o.name]=s[a]}a++}else if(!o.optional)return null}else if("wildcard"===o.type){i["*"]=s.slice(a).join("/"),a=s.length;break}return n&&a<s.length?null:{params:i}}function g(t,e){return e.startsWith("/")?e:t.endsWith("/")?t+e:`${t}/${e}`}function k(t,e,n=""){for(const s of e){const e=s.path.startsWith("/")?s.path:g(n,s.path);if(s.children&&s.children.length>0){const n=v(t,e,!1);if(n){const r=[{route:s,params:n.params}],i=k(t,s.children,e);if(i)r.push(...i);else{const t=s.children.find(t=>""===t.path);t&&r.push({route:t,params:{}})}return r}}const r=v(t,e,!0);if(r)return[{route:s,params:r.params}]}return null}function E({mode:t,initialPath:e,children:l}){const c=s("memory"===t?new d(e):new f),[h,p]=r(c.current.location),[m,w]=r(c.current.state);n(()=>c.current.listen(t=>{p(t),w(c.current.state)}),[]);const y=o((t,e)=>{const n=c.current;e&&e.replace?n.replace(t,e.state):n.push(t,e?.state)},[]),v=o(t=>{c.current.go(t)},[]),g=i(()=>({location:h,state:m,navigate:y,go:v,mode:t}),[h,m,y,v,t]);/* @__PURE__ */
2
- return a(u.Provider,{value:g,children:l})}function x(t){return null}function _(t){return e(t).filter(t=>t?.type===x).map(t=>({path:t.props.path,element:t.props.element,children:t.props.children?_(t.props.children):void 0}))}function b({children:t}){const{location:n}=c(u),r=s([]),o=e(t).filter(t=>t?.type===x).map(t=>t.props.path).join("\0"),h=s("");o!==h.current&&(h.current=o,r.current=_(t));const d=r.current,f=i(()=>k(n,d),[n,d]),m=i(()=>(f??[]).reduce((t,e)=>({...t,...e.params}),{}),[f]),w=i(()=>{if(!f)return null;let t=null;for(let e=f.length-1;e>=0;e--){const n=f[e].route.element;t=/* @__PURE__ */a(p.Provider,{value:{params:m,outlet:t},children:/* @__PURE__ */a(n,{})})}return t},[f,m]);return f?/* @__PURE__ */a(l,{children:w}):null}function C(){/* @__PURE__ */
3
- return a(l,{children:c(p)?.outlet})}function N({to:t,state:e,replace:n,children:s,className:r,onClick:i,...l}){const h=c(u);/* @__PURE__ */
4
- return a("a",{href:t,onClick:o(s=>{s.preventDefault(),i?.(s),h?.navigate(t,{state:e,replace:n})},[h,t,e,n,i]),className:r,...l,children:s})}function W({to:t,children:e,className:n,activeClassName:s,onClick:r,...l}){const p=c(u),d=i(()=>{if(!p)return!1;const e=p.location;return e===t||!("/"===t||!e.startsWith(`${t}/`))},[p?.location,t]);/* @__PURE__ */
5
- return a("a",{href:t,onClick:o(e=>{e.preventDefault(),r?.(e),p?.navigate(t)},[p,t,r]),className:"function"==typeof n?n({isActive:d}):h(n,d&&s),...l,children:e})}function q({to:t,state:e,replace:s}){const r=w();return n(()=>{queueMicrotask(()=>{r(t,{state:e,replace:s})})},[r,t,e,s]),null}export{x as a,y as c,C as i,w as l,W as n,E as o,q as r,b as s,N as t,m as u};
1
+ import{E as t,S as e,_ as n,f as s,h as r,p as i,t as a,v as o,w as l,y as c}from"./DrrpB4Om.js";import{i as u}from"./CaX2xgrP.js";var h=t(null),p=t(null),d=class{entries;index=0;listeners=/* @__PURE__ */new Set;constructor(t="/"){this.entries=[{path:t}]}get location(){return this.entries[this.index]?.path??"/"}get state(){return this.entries[this.index]?.state}push(t,e){this.entries=this.entries.slice(0,this.index+1),this.index=this.entries.push({path:t,state:e})-1,this.notify()}replace(t,e){this.entries[this.index]={path:t,state:e},this.notify()}go(t){const e=this.index+t;e>=0&&e<this.entries.length&&(this.index=e,this.notify())}listen(t){return this.listeners.add(t),()=>this.listeners.delete(t)}notify(){this.listeners.forEach(t=>t(this.location))}},f=class{listeners=/* @__PURE__ */new Set;get location(){return window.location.hash.replace(/^#/,"")||"/"}get state(){return window.history.state?.__qrati_state}makeUrl(t){return`${window.location.pathname+window.location.search}#${t}`}push(t,e){window.history.pushState({__qrati_state:e},"",this.makeUrl(t)),this.notify()}replace(t,e){window.history.replaceState({__qrati_state:e},"",this.makeUrl(t)),this.notify()}go(t){window.history.go(t)}listen(t){this.listeners.add(t);const e=()=>this.notify();return window.addEventListener("popstate",e),window.addEventListener("hashchange",e),queueMicrotask(()=>t(this.location)),()=>{this.listeners.delete(t),window.removeEventListener("popstate",e),window.removeEventListener("hashchange",e)}}notify(){this.listeners.forEach(t=>t(this.location))}};function m(){const t=c(p);if(!t)throw new Error("useParams must be used inside a Route");return t.params}function w(){const t=c(h);if(!t)throw new Error("useNavigate must be used inside a Router");const{navigate:e,go:n}=t;return o((t,s)=>{"number"!=typeof t?e(t,s):n(t)},[e,n])}function y(){const t=c(h);if(!t)throw new Error("useLocation must be used inside a Router");return{pathname:t.location,state:t.state,search:"",hash:""}}function v(t,e,n=!0){const s=t.split("/").filter(Boolean),r=function(t){const e=[],n=t.split("/").filter(Boolean);for(const s of n)if("*"===s)e.push({type:"wildcard"});else if(s.startsWith(":")){const t=s.endsWith("?"),n=t?s.slice(1,-1):s.slice(1);e.push({type:"param",name:n,optional:t})}else e.push({type:"static",value:s});return e}(e),i={};let a=0;for(const o of r)if("static"===o.type){if(s[a]!==o.value)return null;a++}else if("param"===o.type){if(a<s.length){try{i[o.name]=decodeURIComponent(s[a])}catch{i[o.name]=s[a]}a++}else if(!o.optional)return null}else if("wildcard"===o.type){i["*"]=s.slice(a).join("/"),a=s.length;break}return n&&a<s.length?null:{params:i}}function g(t,e){return e.startsWith("/")?e:t.endsWith("/")?t+e:`${t}/${e}`}function k(t,e,n=""){for(const s of e){const e=s.path.startsWith("/")?s.path:g(n,s.path);if(s.children&&s.children.length>0){const n=v(t,e,!1);if(n){const r=[{route:s,params:n.params}],i=k(t,s.children,e);if(i)r.push(...i);else{const t=s.children.find(t=>""===t.path);t&&r.push({route:t,params:{}})}return r}}const r=v(t,e,!0);if(r)return[{route:s,params:r.params}]}return null}function E({mode:t,initialPath:e,children:l}){const c=s("memory"===t?new d(e):new f),[u,p]=r(c.current.location),[m,w]=r(c.current.state);n(()=>(p(c.current.location),w(c.current.state),c.current.listen(t=>{p(t),w(c.current.state)})),[]);const y=o((t,e)=>{const n=c.current;e&&e.replace?n.replace(t,e.state):n.push(t,e?.state)},[]),v=o(t=>{c.current.go(t)},[]),g=i(()=>({location:u,state:m,navigate:y,go:v,mode:t}),[u,m,y,v,t]);/* @__PURE__ */
2
+ return a(h.Provider,{value:g,children:l})}function _(t){return null}function x(t){return e(t).filter(t=>t?.type===_).map(t=>({path:t.props.path,element:t.props.element,children:t.props.children?x(t.props.children):void 0}))}function C({children:t}){const{location:n}=c(h),r=s([]),o=e(t).filter(t=>t?.type===_).map(t=>t.props.path).join("\0"),u=s("");o!==u.current&&(u.current=o,r.current=x(t));const d=r.current,f=i(()=>k(n,d),[n,d]),m=i(()=>(f??[]).reduce((t,e)=>({...t,...e.params}),{}),[f]),w=i(()=>{if(!f)return null;let t=null;for(let e=f.length-1;e>=0;e--){const n=f[e].route.element;t=/* @__PURE__ */a(p.Provider,{value:{params:m,outlet:t},children:/* @__PURE__ */a(n,{})})}return t},[f,m]);return f?/* @__PURE__ */a(l,{children:w}):null}function N(){/* @__PURE__ */
3
+ return a(l,{children:c(p)?.outlet})}function W({to:t,state:e,replace:n,children:s,className:r,onClick:i,...l}){const u=c(h);/* @__PURE__ */
4
+ return a("a",{href:t,onClick:o(s=>{s.preventDefault(),i?.(s),u?.navigate(t,{state:e,replace:n})},[u,t,e,n,i]),className:r,...l,children:s})}function b({to:t,state:e,replace:n,children:s,className:r,activeClassName:l,onClick:p,...d}){const f=c(h),m=i(()=>{if(!f)return!1;const e=f.location;return e===t||!("/"===t||!e.startsWith(`${t}/`))},[f?.location,t]);/* @__PURE__ */
5
+ return a("a",{href:t,onClick:o(s=>{s.preventDefault(),p?.(s),f?.navigate(t,{state:e,replace:n})},[f,t,e,n,p]),className:"function"==typeof r?r({isActive:m}):u(r,m&&l),...d,children:s})}function q({to:t,state:e,replace:s}){const r=w();return n(()=>{queueMicrotask(()=>{r(t,{state:e,replace:s})})},[r,t,e,s]),null}export{_ as a,y as c,N as i,w as l,b as n,E as o,q as r,C as s,W as t,m as u};
@@ -1 +1 @@
1
- import{G as t,H as e,U as s}from"./BItJQVdK.js";var i=class extends e{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=s({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(/* @__PURE__ */new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,o=!this.#i.canStart();try{if(a)e();else{this.#a({type:"pending",variables:t,isPaused:o}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,i);const e=await(this.options.onMutate?.(t,i));e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:o})}const s=await this.#i.start();return await(this.#s.config.onSuccess?.(s,t,this.state.context,this,i)),await(this.options.onSuccess?.(s,t,this.state.context,i)),await(this.#s.config.onSettled?.(s,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(s,null,t,this.state.context,i)),this.#a({type:"success",data:s}),s}catch(r){try{await(this.#s.config.onError?.(r,t,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onError?.(r,t,this.state.context,i))}catch(n){Promise.reject(n)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onSettled?.(void 0,r,t,this.state.context,i))}catch(n){Promise.reject(n)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}export{a as n,i as t};
1
+ import{G as t,H as e,U as s}from"./CaX2xgrP.js";var i=class extends e{#t;#e;#s;#i;constructor(t){super(),this.#t=t.client,this.mutationId=t.mutationId,this.#s=t.mutationCache,this.#e=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#e.includes(t)||(this.#e.push(t),this.clearGcTimeout(),this.#s.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#e=this.#e.filter(e=>e!==t),this.scheduleGc(),this.#s.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#e.length||("pending"===this.state.status?this.scheduleGc():this.#s.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#a({type:"continue"})},i={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=s({fn:()=>this.options.mutationFn?this.options.mutationFn(t,i):Promise.reject(/* @__PURE__ */new Error("No mutationFn found")),onFail:(t,e)=>{this.#a({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#a({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#s.canRun(this)});const a="pending"===this.state.status,o=!this.#i.canStart();try{if(a)e();else{this.#a({type:"pending",variables:t,isPaused:o}),this.#s.config.onMutate&&await this.#s.config.onMutate(t,this,i);const e=await(this.options.onMutate?.(t,i));e!==this.state.context&&this.#a({type:"pending",context:e,variables:t,isPaused:o})}const s=await this.#i.start();return await(this.#s.config.onSuccess?.(s,t,this.state.context,this,i)),await(this.options.onSuccess?.(s,t,this.state.context,i)),await(this.#s.config.onSettled?.(s,null,this.state.variables,this.state.context,this,i)),await(this.options.onSettled?.(s,null,t,this.state.context,i)),this.#a({type:"success",data:s}),s}catch(r){try{await(this.#s.config.onError?.(r,t,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onError?.(r,t,this.state.context,i))}catch(n){Promise.reject(n)}try{await(this.#s.config.onSettled?.(void 0,r,this.state.variables,this.state.context,this,i))}catch(n){Promise.reject(n)}try{await(this.options.onSettled?.(void 0,r,t,this.state.context,i))}catch(n){Promise.reject(n)}throw this.#a({type:"error",error:r}),r}finally{this.#s.runNext(this)}}#a(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),t.batch(()=>{this.#e.forEach(t=>{t.onMutationUpdate(e)}),this.#s.notify({mutation:this,type:"updated",action:e})})}};function a(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}export{a as n,i as t};
@@ -1,3 +1,3 @@
1
- import{f as e,t,v as n}from"./C3uDEVBt.js";import{N as r,c as o,l as a,n as s,r as i,u as c}from"./BItJQVdK.js";import{n as l,t as d}from"./Bki5T_lb.js";function w({className:e}){/* @__PURE__ */
1
+ import{f as e,t,v as n}from"./DrrpB4Om.js";import{N as r,c as o,l as a,n as s,r as i,u as c}from"./CaX2xgrP.js";import{n as l,t as d}from"./Bki5T_lb.js";function w({className:e}){/* @__PURE__ */
2
2
  return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"M12 7.125v7.8l3.15 1.925l-.825-3.6l2.775-2.4l-3.65-.325zm0 10.15l-4.15 2.5q-.275.175-.575.15t-.525-.2t-.35-.437t-.05-.588l1.1-4.725L3.775 10.8q-.25-.225-.312-.513t.037-.562t.3-.45t.55-.225l4.85-.425l1.875-4.45q.125-.3.388-.45t.537-.15t.537.15t.388.45l1.875 4.45l4.85.425q.35.05.55.225t.3.45t.038.563t-.313.512l-3.675 3.175l1.1 4.725q.075.325-.05.588t-.35.437t-.525.2t-.575-.15z"})})}function u({className:e}){/* @__PURE__ */
3
3
  return t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:e,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */t("path",{fill:"currentColor",d:"M12 20q-3.35 0-5.675-2.325T4 12t2.325-5.675T12 4t5.675 2.325T20 12t-2.325 5.675T12 20m0-2q2.5 0 4.25-1.75T18 12q0-.425-.062-.837t-.188-.813q-.375.075-.75.113t-.75.037q-1.575 0-3-.6T10.7 8.15q-.7 1.425-1.925 2.475T6 12.15q.075 2.45 1.812 4.15T12 18M6.4 9.85q1.1-.575 1.675-1.337T9.2 6.7q-.95.5-1.675 1.313T6.4 9.85m2.388 3.863Q8.5 13.425 8.5 13t.288-.712T9.5 12t.713.288t.287.712t-.288.713T9.5 14t-.712-.288M16.25 8.5h.3q.15 0 .3-.025q-.825-1.125-2.087-1.8T12 6h-.3q-.15 0-.275.025q.975 1.125 2.062 1.8t2.763.675m-2.463 5.213Q13.5 13.425 13.5 13t.288-.712T14.5 12t.713.288t.287.712t-.288.713T14.5 14t-.712-.288M1 5V3q0-.825.588-1.412T3 1h2q.425 0 .713.288T6 2t-.288.713T5 3H3v2q0 .425-.288.713T2 6t-.712-.288T1 5m4 18H3q-.825 0-1.412-.587T1 21v-2q0-.425.288-.712T2 18t.713.288T3 19v2h2q.425 0 .713.288T6 22t-.288.713T5 23m16 0h-2q-.425 0-.712-.288T18 22t.288-.712T19 21h2v-3h2v3q0 .825-.587 1.413T21 23m0-18V3h-2q-.425 0-.712-.288T18 2t.288-.712T19 1h2q.825 0 1.413.588T23 3v2q0 .425-.288.713T22 6t-.712-.288T21 5M9.2 6.7"})})}var m=null,p=!1,g=()=>m||(m=new Promise(e=>{if("undefined"==typeof window)return void e();if(window.googletag=window.googletag||{cmd:[]},document.querySelector('script[src*="gpt.js"]'))return void e();const t=document.createElement("script");t.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",t.async=!0,t.crossOrigin="anonymous",t.onload=()=>e(),t.onerror=()=>e(),document.head.appendChild(t)})),h=()=>{p||(p=!0,window.googletag.enableServices())},T=e=>{try{const t=(window.googletag.pubads().getSlots?.()??[]).find(t=>t.getSlotElementId?.()===e);t&&window.googletag.destroySlots([t])}catch{}},v=async()=>{const e=await i();return"string"==typeof e?e:e?.fingerprint},f=()=>{const t=e(null),{props:i,sessionId:w,user:u}=s(),m=i?.organizationId,p=e(null),g=e(null),h=n(async e=>{if(e&&(t.current||(t.current=await v()),t.current))try{await r.post(c.INCREMENT_EVENT_VIEW,{json:{eventSlug:e,browserFingerprint:t.current},headers:{"x-org-id":m,...u?{Authorization:`Bearer ${u.token}`}:{}}})}catch(n){console.error(n)}},[m,u]),T=n(async(e,n)=>{if(e&&n&&(t.current||(t.current=await v()),t.current))try{await r.post(c.UPDATE_AD_ANALYTICS,{json:{adId:e,type:n,browserFingerprint:t.current},headers:{"x-org-id":m}})}catch(o){console.error(o)}},[m]),f=n(async e=>T(e,o.AD_IMPRESSION),[T]),E=n(async e=>T(e,o.AD_ENGAGEMENT),[T]),I=n((e,t,n)=>{if(T(e,o.AD_CLICK),!n)return;const r=String(n);switch(t){case a.LINK:d(r,["http:","https:"])&&window.open(r,"_blank");break;case a.EMAIL:{const e=l(r);e&&(window.location.href=`mailto:${e}`);break}case a.PHONE:{const e=l(r);e&&(window.location.href=`tel:${e}`);break}case a.SMS:{const e=l(r);e&&(window.location.href=`sms:${e}`);break}case a.WHATSAPP:{const e=l(r);e&&(window.location.href=`https://wa.me/${encodeURIComponent(e)}`);break}case a.MESSENGER:{const e=l(r);e&&(window.location.href=`https://m.me/${encodeURIComponent(e)}`);break}default:d(r,["http:","https:"])&&window.open(r,"_blank")}},[T]),q=n(e=>{p.current&&g.current&&y([{page:p.current,entryTime:g.current,exitTime:Date.now()}]),p.current=e??null,g.current=Date.now()},[]),y=n(async e=>{if(w)try{await r.post(c.UPDATE_SESSION,{headers:{"x-org-id":m},json:{sessionId:w,pageViews:e}})}catch(t){console.error(t)}},[m,w]);return{incrementEventView:h,captureAdImpression:f,captureAdEngagement:E,captureAdClick:I,trackPageView:q,exportPageViewsData:y,trackGamAnalytics:n(async({eventId:e,organizationId:n,type:o,creativeId:a,lineItemId:s,advertiserId:i,isEmpty:l})=>{if(!e||!o)return;if(t.current||(t.current=await v()),!t.current)return;const d=n||m;if(d)try{await r.post(c.UPDATE_GAM_ANALYTICS,{json:{eventId:e,organizationId:d,type:o,browserFingerprint:t.current,...a?{creativeId:a}:{},...s?{lineItemId:s}:{},...i?{advertiserId:i}:{},...void 0!==l?{isEmpty:l}:{}},headers:{"x-org-id":d}})}catch(w){console.error(w)}},[m])}},E=({container:e,onClick:t})=>{let n=!1,r=!1,o=0,a=null;const s=()=>{n=!0,o=Date.now()},i=()=>{n=!1},c=()=>{null!==a&&(window.clearTimeout(a),a=null)},l=()=>{a=window.setTimeout(()=>{const a=document.activeElement,s=a instanceof HTMLIFrameElement&&e.contains(a),i=Date.now()-o<=1500;!r&&(s||n&&i)&&(r=!0,t())},0)};return e.addEventListener("pointerenter",s),e.addEventListener("pointerleave",i),window.addEventListener("blur",l),window.addEventListener("focus",c),()=>{e.removeEventListener("pointerenter",s),e.removeEventListener("pointerleave",i),window.removeEventListener("blur",l),window.removeEventListener("focus",c),null!==a&&window.clearTimeout(a)}};export{g as a,h as i,f as n,u as o,T as r,w as s,E as t};
@@ -1,2 +1,2 @@
1
- import{t as e}from"./C3uDEVBt.js";var r=()=>/* @__PURE__ */e("div",{className:"text-muted-foreground text-center text-sm",children:["Powered by"," ",
1
+ import{t as e}from"./DrrpB4Om.js";var r=()=>/* @__PURE__ */e("div",{className:"text-muted-foreground text-center text-sm",children:["Powered by"," ",
2
2
  /* @__PURE__ */e("a",{href:"https://qrati.com",target:"_blank",rel:"noopener noreferrer",children:/* @__PURE__ */e("strong",{children:"Qrati"})})]});export{r as t};
@@ -0,0 +1,3 @@
1
+ import{t as e}from"./DrrpB4Om.js";function t({className:t}){/* @__PURE__ */
2
+ return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M6 20q-.825 0-1.412-.587T4 18v-2q0-.425.288-.712T5 15t.713.288T6 16v2h12v-2q0-.425.288-.712T19 15t.713.288T20 16v2q0 .825-.587 1.413T18 20zm5-12.15L9.125 9.725q-.3.3-.712.288T7.7 9.7q-.275-.3-.288-.7t.288-.7l3.6-3.6q.15-.15.325-.212T12 4.425t.375.063t.325.212l3.6 3.6q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L13 7.85V15q0 .425-.288.713T12 16t-.712-.288T11 15z"})})}var r=/\.(mp4|mov|avi|mkv|webm|qt)$/i,n=/heic|heif/i,i=/\.(heic|heif)$/i,o=/\.(heic|heif|jpg|jpeg|png|webp|gif)$/i;function a(e){return e.type.startsWith("video/")||r.test(e.name)}function f(e){return e.type.startsWith("image/")||o.test(e.name)}function s(e){return n.test(e.type)||i.test(e.name)}async function c(e){const t=e.type.trim().toLowerCase(),n=e.name.toLowerCase(),a=r.test(n),f=o.test(n),s=i.test(n);if(t&&"application/octet-stream"!==t&&!(t.startsWith("image/")&&a||t.startsWith("video/")&&f||t.startsWith("image/")&&s))return t;try{const t=new Uint8Array(await e.slice(0,12).arrayBuffer());if(82===t[0]&&73===t[1]&&70===t[2]&&70===t[3]){if(87===t[8]&&69===t[9]&&66===t[10]&&80===t[11])return"image/webp";if(65===t[8]&&86===t[9]&&73===t[10]&&32===t[11])return"video/x-msvideo"}if(255===t[0]&&216===t[1]&&255===t[2])return"image/jpeg";if(137===t[0]&&80===t[1]&&78===t[2]&&71===t[3])return"image/png";if(71===t[0]&&73===t[1]&&70===t[2]&&56===t[3])return"image/gif";if(26===t[0]&&69===t[1]&&223===t[2]&&163===t[3])return n.endsWith(".webm")?"video/webm":"video/x-matroska";const r=102===t[4]&&116===t[5]&&121===t[6]&&112===t[7],i=109===t[4]&&111===t[5]&&111===t[6]&&118===t[7],o=109===t[4]&&100===t[5]&&97===t[6]&&116===t[7];if(r||i||o){if(r){const e=String.fromCharCode(t[8]??0,t[9]??0,t[10]??0,t[11]??0).trim().toLowerCase();if("heic"===e||"heix"===e||"mif1"===e)return"image/heic";if("qt "===e)return"video/quicktime"}return a&&(n.endsWith(".mov")||n.endsWith(".qt"))?"video/quicktime":"video/mp4"}}catch{}return t||"application/octet-stream"}var l="image/jpeg",u=/* @__PURE__ */new WeakMap;async function h(e){if(!s(e))return e;const t=u.get(e);if(t)return t;const{loadHeic2any:r}=await import("./DnIueBGr2.js"),n=await(await r())({blob:e,toType:l}),i=Array.isArray(n)?n[0]:n,o=e.name.replace(/\.(heic|heif)$/i,""),a=new File([i],`${o}.jpg`,{type:l});return u.set(e,a),a}async function d(e){if(e instanceof File&&s(e)){const t=await h(e);return URL.createObjectURL(t)}return URL.createObjectURL(e)}function g(e,t){return new Promise(function(r,n){let i;return w(e).then(function(e){try{return i=e,r(new Blob([t.slice(0,2),i,t.slice(2)],{type:"image/jpeg"}))}catch(e){return n(e)}},n)})}var w=e=>new Promise((t,r)=>{const n=new FileReader;n.addEventListener("load",({target:{result:e}})=>{const n=new DataView(e);let i=0;if(65496!==n.getUint16(i))return r("not a valid JPEG");for(i+=2;;){const o=n.getUint16(i);if(65498===o)break;const a=n.getUint16(i+2);if(65505===o&&1165519206===n.getUint32(i+4)){const o=i+10;let f;switch(n.getUint16(o)){case 18761:f=!0;break;case 19789:f=!1;break;default:return r("TIFF header contains invalid endian")}if(42!==n.getUint16(o+2,f))return r("TIFF header contains invalid version");const s=n.getUint32(o+4,f),c=o+s+2+12*n.getUint16(o+s,f);for(let e=o+s+2;e<c;e+=12)if(274==n.getUint16(e,f)){if(3!==n.getUint16(e+2,f))return r("Orientation data type is invalid");if(1!==n.getUint32(e+4,f))return r("Orientation data count is invalid");n.setUint16(e+8,1,f);break}return t(e.slice(i,i+2+a))}i+=2+a}return t(new Blob)}),n.readAsArrayBuffer(e)}),A={},p={get exports(){return A},set exports(e){A=e}};!function(){var e,t,r={};p.exports=r,r.parse=function(e,t){for(var n=r.bin.readUshort,i=r.bin.readUint,o=0,a={},f=new Uint8Array(e),s=f.length-4;101010256!=i(f,s);)s--;o=s,o+=4;var c=n(f,o+=4);n(f,o+=2);var l=i(f,o+=2),u=i(f,o+=4);o+=4,o=u;for(var h=0;h<c;h++){i(f,o),o+=4,o+=4,o+=4,i(f,o+=4),l=i(f,o+=4);var d=i(f,o+=4),g=n(f,o+=4),w=n(f,o+2),A=n(f,o+4);o+=6;var p=i(f,o+=8);o+=4,o+=g+w+A,r._readLocal(f,p,a,l,d,t)}return a},r._readLocal=function(e,t,n,i,o,a){var f=r.bin.readUshort,s=r.bin.readUint;s(e,t),f(e,t+=4),f(e,t+=2);var c=f(e,t+=2);s(e,t+=2),s(e,t+=4),t+=4;var l=f(e,t+=8),u=f(e,t+=2);t+=2;var h=r.bin.readUTF8(e,t,l);if(t+=l,t+=u,a)n[h]={size:o,csize:i};else{var d=new Uint8Array(e.buffer,t);if(0==c)n[h]=new Uint8Array(d.buffer.slice(t,t+i));else{if(8!=c)throw"unknown compression method: "+c;var g=new Uint8Array(o);r.inflateRaw(d,g),n[h]=g}}},r.inflateRaw=function(e,t){return r.F.inflate(e,t)},r.inflate=function(e,t){return e[0],e[1],r.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},r.deflate=function(e,t){t??={level:6};var n=0,i=new Uint8Array(50+Math.floor(1.1*e.length));i[n]=120,i[n+1]=156,n+=2,n=r.F.deflateRaw(e,i,n,t.level);var o=r.adler(e,0,e.length);return i[n+0]=o>>>24&255,i[n+1]=o>>>16&255,i[n+2]=o>>>8&255,i[n+3]=o>>>0&255,new Uint8Array(i.buffer,0,n+4)},r.deflateRaw=function(e,t){t??={level:6};var n=new Uint8Array(50+Math.floor(1.1*e.length)),i=r.F.deflateRaw(e,n,i,t.level);return new Uint8Array(n.buffer,0,i)},r.encode=function(e,t){t??=!1;var n=0,i=r.bin.writeUint,o=r.bin.writeUshort,a={};for(var f in e){var s=!r._noNeed(f)&&!t,c=e[f],l=r.crc.crc(c,0,c.length);a[f]={cpr:s,usize:c.length,crc:l,file:s?r.deflateRaw(c):c}}for(var f in a)n+=a[f].file.length+30+46+2*r.bin.sizeUTF8(f);n+=22;var u=new Uint8Array(n),h=0,d=[];for(var f in a){var g=a[f];d.push(h),h=r._writeHeader(u,h,f,g,0)}var w=0,A=h;for(var f in a)g=a[f],d.push(h),h=r._writeHeader(u,h,f,g,1,d[w++]);var p=h-A;return i(u,h,101010256),h+=4,o(u,h+=4,w),o(u,h+=2,w),i(u,h+=2,p),i(u,h+=4,A),h+=4,h+=2,u.buffer},r._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return-1!="png,jpg,jpeg,zip".indexOf(t)},r._writeHeader=function(e,t,n,i,o,a){var f=r.bin.writeUint,s=r.bin.writeUshort,c=i.file;return f(e,t,0==o?67324752:33639248),t+=4,1==o&&(t+=2),s(e,t,20),s(e,t+=2,0),s(e,t+=2,i.cpr?8:0),f(e,t+=2,0),f(e,t+=4,i.crc),f(e,t+=4,c.length),f(e,t+=4,i.usize),s(e,t+=4,r.bin.sizeUTF8(n)),s(e,t+=2,0),t+=2,1==o&&(t+=2,t+=2,f(e,t+=6,a),t+=4),t+=r.bin.writeUTF8(e,t,n),0==o&&(e.set(c,t),t+=c.length),t},r.crc={table:function(){for(var e=/* @__PURE__ */new Uint32Array(256),t=0;t<256;t++){for(var r=t,n=0;n<8;n++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}return e}(),update:function(e,t,n,i){for(var o=0;o<i;o++)e=r.crc.table[255&(e^t[n+o])]^e>>>8;return e},crc:function(e,t,n){return 4294967295^r.crc.update(4294967295,e,t,n)}},r.adler=function(e,t,r){for(var n=1,i=0,o=t,a=t+r;o<a;){for(var f=Math.min(o+5552,a);o<f;)i+=n+=e[o++];n%=65521,i%=65521}return i<<16|n},r.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,r){e[t]=255&r,e[t+1]=r>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,r){e[t]=255&r,e[t+1]=r>>8&255,e[t+2]=r>>16&255,e[t+3]=r>>24&255},readASCII:function(e,t,r){for(var n="",i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},writeASCII:function(e,t,r){for(var n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,n){for(var i,o="",a=0;a<n;a++)o+="%"+r.bin.pad(e[t+a].toString(16));try{i=decodeURIComponent(o)}catch(i){return r.bin.readASCII(e,t,n)}return i},writeUTF8:function(e,t,r){for(var n=r.length,i=0,o=0;o<n;o++){var a=r.charCodeAt(o);if(4294967168&a)if(4294965248&a)if(4294901760&a){if(4292870144&a)throw"e";e[t+i]=240|a>>18,e[t+i+1]=128|a>>12&63,e[t+i+2]=128|a>>6&63,e[t+i+3]=128|63&a,i+=4}else e[t+i]=224|a>>12,e[t+i+1]=128|a>>6&63,e[t+i+2]=128|63&a,i+=3;else e[t+i]=192|a>>6,e[t+i+1]=128|63&a,i+=2;else e[t+i]=a,i++}return i},sizeUTF8:function(e){for(var t=e.length,r=0,n=0;n<t;n++){var i=e.charCodeAt(n);if(4294967168&i)if(4294965248&i)if(4294901760&i){if(4292870144&i)throw"e";r+=4}else r+=3;else r+=2;else r++}return r}},r.F={},r.F.deflateRaw=function(e,t,n,i){var o=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][i],a=r.F.U,f=r.F._goodIndex;r.F._hash;var s=r.F._putsE,c=0,l=n<<3,u=0,h=e.length;if(0==i){for(;c<h;)s(t,l,c+(E=Math.min(65535,h-c))==h?1:0),l=r.F._copyExact(e,c,E,t,l+8),c+=E;return l>>>3}var d=a.lits,g=a.strt,w=a.prev,A=0,p=0,m=0,v=0,b=0,y=0;for(h>2&&(g[y=r.F._hash(e,0)]=0),c=0;c<h;c++){if(b=y,c+1<h-2){y=r.F._hash(e,c+1);var U=c+1&32767;w[U]=g[y],g[y]=U}if(u<=c){(A>14e3||p>26697)&&h-c>100&&(u<c&&(d[A]=c-u,A+=2,u=c),l=r.F._writeBlock(c==h-1||u==h?1:0,d,A,v,e,m,c-m,t,l),A=p=v=0,m=c);var F=0;c<h-2&&(F=r.F._bestMatch(e,c,w,b,Math.min(o[2],h-c),o[3]));var E=F>>>16,_=65535&F;if(0!=F){_=65535&F;var C=f(E=F>>>16,a.of0);a.lhst[257+C]++;var T=f(_,a.df0);a.dhst[T]++,v+=a.exb[C]+a.dxb[T],d[A]=E<<23|c-u,d[A+1]=_<<16|C<<8|T,A+=2,u=c+E}else a.lhst[e[c]]++;p++}}for(m==c&&0!=e.length||(u<c&&(d[A]=c-u,A+=2,u=c),l=r.F._writeBlock(1,d,A,v,e,m,c-m,t,l),A=0,p=0,A=p=v=0,m=c);7&l;)l++;return l>>>3},r.F._bestMatch=function(e,t,n,i,o,a){var f=32767&t,s=n[f],c=f-s+32768&32767;if(s==f||i!=r.F._hash(e,t-c))return 0;for(var l=0,u=0,h=Math.min(32767,t);c<=h&&0!=--a&&s!=f;){if(0==l||e[t+l]==e[t+l-c]){var d=r.F._howLong(e,t,c);if(d>l){if(u=c,(l=d)>=o)break;c+2<d&&(d=c+2);for(var g=0,w=0;w<d-2;w++){var A=t-c+w+32768&32767,p=A-n[A]+32768&32767;p>g&&(g=p,s=A)}}}c+=(f=s)-(s=n[f])+32768&32767}return l<<16|u},r.F._howLong=function(e,t,r){if(e[t]!=e[t-r]||e[t+1]!=e[t+1-r]||e[t+2]!=e[t+2-r])return 0;var n=t,i=Math.min(e.length,t+258);for(t+=3;t<i&&e[t]==e[t-r];)t++;return t-n},r.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(e,t,n,i,o,a,f,s,c){var l,u,h,d,g,w,A,p,m,v=r.F.U,b=r.F._putsF,y=r.F._putsE;v.lhst[256]++,u=(l=r.F.getTrees())[0],h=l[1],d=l[2],g=l[3],w=l[4],A=l[5],p=l[6],m=l[7];var U=32+(c+3&7?8-(c+3&7):0)+(f<<3),F=i+r.F.contSize(v.fltree,v.lhst)+r.F.contSize(v.fdtree,v.dhst),E=i+r.F.contSize(v.ltree,v.lhst)+r.F.contSize(v.dtree,v.dhst);E+=14+3*A+r.F.contSize(v.itree,v.ihst)+(2*v.ihst[16]+3*v.ihst[17]+7*v.ihst[18]);for(var _=0;_<286;_++)v.lhst[_]=0;for(_=0;_<30;_++)v.dhst[_]=0;for(_=0;_<19;_++)v.ihst[_]=0;var C=U<F&&U<E?0:F<E?1:2;if(b(s,c,e),b(s,c+1,C),c+=3,0==C){for(;7&c;)c++;c=r.F._copyExact(o,a,f,s,c)}else{var T,B;if(1==C&&(T=v.fltree,B=v.fdtree),2==C){r.F.makeCodes(v.ltree,u),r.F.revCodes(v.ltree,u),r.F.makeCodes(v.dtree,h),r.F.revCodes(v.dtree,h),r.F.makeCodes(v.itree,d),r.F.revCodes(v.itree,d),T=v.ltree,B=v.dtree,y(s,c,g-257),y(s,c+=5,w-1),y(s,c+=5,A-4),c+=4;for(var I=0;I<A;I++)y(s,c+3*I,v.itree[1+(v.ordr[I]<<1)]);c+=3*A,c=r.F._codeTiny(p,v.itree,s,c),c=r.F._codeTiny(m,v.itree,s,c)}for(var M=a,x=0;x<n;x+=2){for(var R=t[x],S=R>>>23,Q=M+(8388607&R);M<Q;)c=r.F._writeLit(o[M++],T,s,c);if(0!=S){var k=t[x+1],L=k>>16,H=k>>8&255,O=255&k;y(s,c=r.F._writeLit(257+H,T,s,c),S-v.of0[H]),c+=v.exb[H],b(s,c=r.F._writeLit(O,B,s,c),L-v.df0[O]),c+=v.dxb[O],M+=S}}c=r.F._writeLit(256,T,s,c)}return c},r.F._copyExact=function(e,t,r,n,i){var o=i>>>3;return n[o]=r,n[o+1]=r>>>8,n[o+2]=255-n[o],n[o+3]=255-n[o+1],o+=4,n.set(new Uint8Array(e.buffer,t,r),o),i+(r+4<<3)},r.F.getTrees=function(){for(var e=r.F.U,t=r.F._hufTree(e.lhst,e.ltree,15),n=r.F._hufTree(e.dhst,e.dtree,15),i=[],o=r.F._lenCodes(e.ltree,i),a=[],f=r.F._lenCodes(e.dtree,a),s=0;s<i.length;s+=2)e.ihst[i[s]]++;for(s=0;s<a.length;s+=2)e.ihst[a[s]]++;for(var c=r.F._hufTree(e.ihst,e.itree,7),l=19;l>4&&0==e.itree[1+(e.ordr[l-1]<<1)];)l--;return[t,n,c,o,f,l,i,a]},r.F.getSecond=function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(e[r+1]);return t},r.F.nonZero=function(e){for(var t="",r=0;r<e.length;r+=2)0!=e[r+1]&&(t+=(r>>1)+",");return t},r.F.contSize=function(e,t){for(var r=0,n=0;n<t.length;n++)r+=t[n]*e[1+(n<<1)];return r},r.F._codeTiny=function(e,t,n,i){for(var o=0;o<e.length;o+=2){var a=e[o],f=e[o+1];i=r.F._writeLit(a,t,n,i);var s=16==a?2:17==a?3:7;a>15&&(r.F._putsE(n,i,f,s),i+=s)}return i},r.F._lenCodes=function(e,t){for(var r=e.length;2!=r&&0==e[r-1];)r-=2;for(var n=0;n<r;n+=2){var i=e[n+1],o=n+3<r?e[n+3]:-1,a=n+5<r?e[n+5]:-1,f=0==n?-1:e[n-1];if(0==i&&o==i&&a==i){for(var s=n+5;s+2<r&&e[s+2]==i;)s+=2;(c=Math.min(s+1-n>>>1,138))<11?t.push(17,c-3):t.push(18,c-11),n+=2*c-2}else if(i==f&&o==i&&a==i){for(s=n+5;s+2<r&&e[s+2]==i;)s+=2;var c=Math.min(s+1-n>>>1,6);t.push(16,c-3),n+=2*c-2}else t.push(i,0)}return r>>>1},r.F._hufTree=function(e,t,n){var i=[],o=e.length,a=t.length,f=0;for(f=0;f<a;f+=2)t[f]=0,t[f+1]=0;for(f=0;f<o;f++)0!=e[f]&&i.push({lit:f,f:e[f]});var s=i.length,c=i.slice(0);if(0==s)return 0;if(1==s){var l=i[0].lit;return c=0==l?1:0,t[1+(l<<1)]=1,t[1+(c<<1)]=1,1}i.sort(function(e,t){return e.f-t.f});var u=i[0],h=i[1],d=0,g=1,w=2;for(i[0]={lit:-1,f:u.f+h.f,l:u,r:h,d:0};g!=s-1;)u=d!=g&&(w==s||i[d].f<i[w].f)?i[d++]:i[w++],h=d!=g&&(w==s||i[d].f<i[w].f)?i[d++]:i[w++],i[g++]={lit:-1,f:u.f+h.f,l:u,r:h};var A=r.F.setDepth(i[g-1],0);for(A>n&&(r.F.restrictDepth(c,n,A),A=n),f=0;f<s;f++)t[1+(c[f].lit<<1)]=c[f].d;return A},r.F.setDepth=function(e,t){return-1!=e.lit?(e.d=t,t):Math.max(r.F.setDepth(e.l,t+1),r.F.setDepth(e.r,t+1))},r.F.restrictDepth=function(e,t,r){var n=0,i=1<<r-t,o=0;for(e.sort(function(e,t){return t.d==e.d?e.f-t.f:t.d-e.d}),n=0;n<e.length&&e[n].d>t;n++){var a=e[n].d;e[n].d=t,o+=i-(1<<r-a)}for(o>>>=r-t;o>0;)(a=e[n].d)<t?(e[n].d++,o-=1<<t-a-1):n++;for(;n>=0;n--)e[n].d==t&&o<0&&(e[n].d--,o++);0!=o&&console.log("debt left")},r.F._goodIndex=function(e,t){var r=0;return t[16|r]<=e&&(r|=16),t[8|r]<=e&&(r|=8),t[4|r]<=e&&(r|=4),t[2|r]<=e&&(r|=2),t[1|r]<=e&&(r|=1),r},r.F._writeLit=function(e,t,n,i){return r.F._putsF(n,i,t[e<<1]),i+t[1+(e<<1)]},r.F.inflate=function(e,t){var n=Uint8Array;if(3==e[0]&&0==e[1])return t||new n(0);var i=r.F,o=i._bitsF,a=i._bitsE,f=i._decodeTiny,s=i.makeCodes,c=i.codes2map,l=i._get17,u=i.U,h=null==t;h&&(t=new n(e.length>>>2<<3));for(var d,g,w=0,A=0,p=0,m=0,v=0,b=0,y=0,U=0,F=0;0==w;)if(w=o(e,F,1),A=o(e,F+1,2),F+=3,0!=A){if(h&&(t=r.F._check(t,U+(1<<17))),1==A&&(d=u.flmap,g=u.fdmap,b=511,y=31),2==A){p=a(e,F,5)+257,m=a(e,F+5,5)+1,v=a(e,F+10,4)+4,F+=14;for(var E=0;E<38;E+=2)u.itree[E]=0,u.itree[E+1]=0;var _=1;for(E=0;E<v;E++){var C=a(e,F+3*E,3);u.itree[1+(u.ordr[E]<<1)]=C,C>_&&(_=C)}F+=3*v,s(u.itree,_),c(u.itree,_,u.imap),d=u.lmap,g=u.dmap,F=f(u.imap,(1<<_)-1,p+m,e,F,u.ttree);var T=i._copyOut(u.ttree,0,p,u.ltree);b=(1<<T)-1;var B=i._copyOut(u.ttree,p,m,u.dtree);y=(1<<B)-1,s(u.ltree,T),c(u.ltree,T,d),s(u.dtree,B),c(u.dtree,B,g)}for(;;){var I=d[l(e,F)&b];F+=15&I;var M=I>>>4;if(M>>>8==0)t[U++]=M;else{if(256==M)break;var x=U+M-254;if(M>264){var R=u.ldef[M-257];x=U+(R>>>3)+a(e,F,7&R),F+=7&R}var S=g[l(e,F)&y];F+=15&S;var Q=S>>>4,k=u.ddef[Q],L=(k>>>4)+o(e,F,15&k);for(F+=15&k,h&&(t=r.F._check(t,U+(1<<17)));U<x;)t[U]=t[U++-L],t[U]=t[U++-L],t[U]=t[U++-L],t[U]=t[U++-L];U=x}}}else{7&F&&(F+=8-(7&F));var H=4+(F>>>3),O=e[H-4]|e[H-3]<<8;h&&(t=r.F._check(t,U+O)),t.set(new n(e.buffer,e.byteOffset+H,O),U),F=H+O<<3,U+=O}return t.length==U?t:t.slice(0,U)},r.F._check=function(e,t){var r=e.length;if(t<=r)return e;var n=new Uint8Array(Math.max(r<<1,t));return n.set(e,0),n},r.F._decodeTiny=function(e,t,n,i,o,a){for(var f=r.F._bitsE,s=r.F._get17,c=0;c<n;){var l=e[s(i,o)&t];o+=15&l;var u=l>>>4;if(u<=15)a[c]=u,c++;else{var h=0,d=0;16==u?(d=3+f(i,o,2),o+=2,h=a[c-1]):17==u?(d=3+f(i,o,3),o+=3):18==u&&(d=11+f(i,o,7),o+=7);for(var g=c+d;c<g;)a[c]=h,c++}}return o},r.F._copyOut=function(e,t,r,n){for(var i=0,o=0,a=n.length>>>1;o<r;){var f=e[o+t];n[o<<1]=0,n[1+(o<<1)]=f,f>i&&(i=f),o++}for(;o<a;)n[o<<1]=0,n[1+(o<<1)]=0,o++;return i},r.F.makeCodes=function(e,t){for(var n,i,o,a,f=r.F.U,s=e.length,c=f.bl_count,l=0;l<=t;l++)c[l]=0;for(l=1;l<s;l+=2)c[e[l]]++;var u=f.next_code;for(n=0,c[0]=0,i=1;i<=t;i++)n=n+c[i-1]<<1,u[i]=n;for(o=0;o<s;o+=2)0!=(a=e[o+1])&&(e[o]=u[a],u[a]++)},r.F.codes2map=function(e,t,n){for(var i=e.length,o=r.F.U.rev15,a=0;a<i;a+=2)if(0!=e[a+1])for(var f=a>>1,s=e[a+1],c=f<<4|s,l=t-s,u=e[a]<<l,h=u+(1<<l);u!=h;)n[o[u]>>>15-t]=c,u++},r.F.revCodes=function(e,t){for(var n=r.F.U.rev15,i=15-t,o=0;o<e.length;o+=2)e[o]=n[e[o]<<t-e[o+1]]>>>i},r.F._putsE=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},r.F._putsF=function(e,t,r){r<<=7&t;var n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},r.F._bitsE=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},r.F._bitsF=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},r.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},r.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},r.F.U=(e=Uint16Array,t=Uint32Array,{next_code:new e(16),bl_count:new e(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[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,999,999,999],exb:[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],ldef:new e(32),df0:[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,65535,65535],dxb:[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],ddef:new t(32),flmap:new e(512),fltree:[],fdmap:new e(32),fdtree:[],lmap:new e(32768),ltree:[],ttree:[],dmap:new e(32768),dtree:[],imap:new e(512),itree:[],rev15:new e(32768),lhst:new t(286),dhst:new t(30),ihst:new t(19),lits:new t(15e3),strt:new e(65536),prev:new e(32768)}),function(){for(var e=r.F.U,t=0;t<32768;t++){var n=t;n=(4278255360&(n=(4042322160&(n=(3435973836&(n=(2863311530&n)>>>1|(1431655765&n)<<1))>>>2|(858993459&n)<<2))>>>4|(252645135&n)<<4))>>>8|(16711935&n)<<8,e.rev15[t]=(n>>>16|n<<16)>>>17}function i(e,t,r){for(;0!=t--;)e.push(0,r)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];i(e.fltree,144,8),i(e.fltree,112,9),i(e.fltree,24,7),i(e.fltree,8,8),r.F.makeCodes(e.fltree,9),r.F.codes2map(e.fltree,9,e.flmap),r.F.revCodes(e.fltree,9),i(e.fdtree,32,5),r.F.makeCodes(e.fdtree,5),r.F.codes2map(e.fdtree,5,e.fdmap),r.F.revCodes(e.fdtree,5),i(e.itree,19,0),i(e.ltree,286,0),i(e.dtree,30,0),i(e.ttree,320,0)}()}();var m=function(e,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}})}),Object.freeze(e)}({__proto__:null,default:A},[A]),v=function(){var e={nextZero(e,t){for(;0!=e[t];)t++;return t},readUshort:(e,t)=>e[t]<<8|e[t+1],writeUshort(e,t,r){e[t]=r>>8&255,e[t+1]=255&r},readUint:(e,t)=>16777216*e[t]+(e[t+1]<<16|e[t+2]<<8|e[t+3]),writeUint(e,t,r){e[t]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r},readASCII(e,t,r){let n="";for(let i=0;i<r;i++)n+=String.fromCharCode(e[t+i]);return n},writeASCII(e,t,r){for(let n=0;n<r.length;n++)e[t+n]=r.charCodeAt(n)},readBytes(e,t,r){const n=[];for(let i=0;i<r;i++)n.push(e[t+i]);return n},pad:e=>e.length<2?`0${e}`:e,readUTF8(t,r,n){let i,o="";for(let a=0;a<n;a++)o+=`%${e.pad(t[r+a].toString(16))}`;try{i=decodeURIComponent(o)}catch(i){return e.readASCII(t,r,n)}return i}};function t(t,r,n,i){const a=r*n,f=o(i),s=Math.ceil(r*f/8),c=new Uint8Array(4*a),l=new Uint32Array(c.buffer),{ctype:u}=i,{depth:h}=i,d=e.readUshort;if(6==u){const e=a<<2;if(8==h)for(var g=0;g<e;g+=4)c[g]=t[g],c[g+1]=t[g+1],c[g+2]=t[g+2],c[g+3]=t[g+3];if(16==h)for(g=0;g<e;g++)c[g]=t[g<<1]}else if(2==u){const e=i.tabs.tRNS;if(null==e){if(8==h)for(g=0;g<a;g++){var w=3*g;l[g]=255<<24|t[w+2]<<16|t[w+1]<<8|t[w]}if(16==h)for(g=0;g<a;g++)w=6*g,l[g]=255<<24|t[w+4]<<16|t[w+2]<<8|t[w]}else{var A=e[0];const r=e[1],n=e[2];if(8==h)for(g=0;g<a;g++){var p=g<<2;w=3*g,l[g]=255<<24|t[w+2]<<16|t[w+1]<<8|t[w],t[w]==A&&t[w+1]==r&&t[w+2]==n&&(c[p+3]=0)}if(16==h)for(g=0;g<a;g++)p=g<<2,w=6*g,l[g]=255<<24|t[w+4]<<16|t[w+2]<<8|t[w],d(t,w)==A&&d(t,w+2)==r&&d(t,w+4)==n&&(c[p+3]=0)}}else if(3==u){const e=i.tabs.PLTE,o=i.tabs.tRNS,f=o?o.length:0;if(1==h)for(var m=0;m<n;m++){var v=m*s,b=m*r;for(g=0;g<r;g++){p=b+g<<2;var y=3*(U=t[v+(g>>3)]>>7-(7&g)&1);c[p]=e[y],c[p+1]=e[y+1],c[p+2]=e[y+2],c[p+3]=U<f?o[U]:255}}if(2==h)for(m=0;m<n;m++)for(v=m*s,b=m*r,g=0;g<r;g++)p=b+g<<2,y=3*(U=t[v+(g>>2)]>>6-((3&g)<<1)&3),c[p]=e[y],c[p+1]=e[y+1],c[p+2]=e[y+2],c[p+3]=U<f?o[U]:255;if(4==h)for(m=0;m<n;m++)for(v=m*s,b=m*r,g=0;g<r;g++)p=b+g<<2,y=3*(U=t[v+(g>>1)]>>4-((1&g)<<2)&15),c[p]=e[y],c[p+1]=e[y+1],c[p+2]=e[y+2],c[p+3]=U<f?o[U]:255;if(8==h)for(g=0;g<a;g++){var U;p=g<<2,y=3*(U=t[g]),c[p]=e[y],c[p+1]=e[y+1],c[p+2]=e[y+2],c[p+3]=U<f?o[U]:255}}else if(4==u){if(8==h)for(g=0;g<a;g++){p=g<<2;var F=t[E=g<<1];c[p]=F,c[p+1]=F,c[p+2]=F,c[p+3]=t[E+1]}if(16==h)for(g=0;g<a;g++){var E;p=g<<2,F=t[E=g<<2],c[p]=F,c[p+1]=F,c[p+2]=F,c[p+3]=t[E+2]}}else if(0==u)for(A=i.tabs.tRNS?i.tabs.tRNS:-1,m=0;m<n;m++){const e=m*s,n=m*r;if(1==h)for(var _=0;_<r;_++){var C=(F=255*(t[e+(_>>>3)]>>>7-(7&_)&1))==255*A?0:255;l[n+_]=C<<24|F<<16|F<<8|F}else if(2==h)for(_=0;_<r;_++)C=(F=85*(t[e+(_>>>2)]>>>6-((3&_)<<1)&3))==85*A?0:255,l[n+_]=C<<24|F<<16|F<<8|F;else if(4==h)for(_=0;_<r;_++)C=(F=17*(t[e+(_>>>1)]>>>4-((1&_)<<2)&15))==17*A?0:255,l[n+_]=C<<24|F<<16|F<<8|F;else if(8==h)for(_=0;_<r;_++)C=(F=t[e+_])==A?0:255,l[n+_]=C<<24|F<<16|F<<8|F;else if(16==h)for(_=0;_<r;_++)F=t[e+(_<<1)],C=d(t,e+(_<<1))==A?0:255,l[n+_]=C<<24|F<<16|F<<8|F}return c}function r(e,t,r,f){const s=o(e),c=Math.ceil(r*s/8),l=new Uint8Array((c+1+e.interlace)*f);return t=e.tabs.CgBI?i(t,l):n(t,l),0==e.interlace?t=a(t,e,0,r,f):1==e.interlace&&(t=function(e,t){const r=t.width,n=t.height,i=o(t),f=i>>3,s=Math.ceil(r*i/8),c=new Uint8Array(n*s);let l=0;const u=[0,0,4,0,2,0,1],h=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],g=[8,8,4,4,2,2,1];let w=0;for(;w<7;){const o=d[w],p=g[w];let m=0,v=0,b=u[w];for(;b<n;)b+=o,v++;let y=h[w];for(;y<r;)y+=p,m++;const U=Math.ceil(m*i/8);a(e,t,l,m,v);let F=0,E=u[w];for(;E<n;){let t=h[w],n=l+F*U<<3;for(;t<r;){var A;if(1==i&&(A=(A=e[n>>3])>>7-(7&n)&1,c[E*s+(t>>3)]|=A<<7-(7&t)),2==i&&(A=(A=e[n>>3])>>6-(7&n)&3,c[E*s+(t>>2)]|=A<<6-((3&t)<<1)),4==i&&(A=(A=e[n>>3])>>4-(7&n)&15,c[E*s+(t>>1)]|=A<<4-((1&t)<<2)),i>=8){const r=E*s+t*f;for(let t=0;t<f;t++)c[r+t]=e[(n>>3)+t]}n+=i,t+=p}F++,E+=o}m*v!=0&&(l+=v*(1+U)),w+=1}return c}(t,e)),t}function n(e,t){return i(new Uint8Array(e.buffer,2,e.length-6),t)}var i=function(){const e={H:{}};return e.H.N=function(t,r){const n=Uint8Array;let i,o,a=0,f=0,s=0,c=0,l=0,u=0,h=0,d=0,g=0;if(3==t[0]&&0==t[1])return r||new n(0);const w=e.H,A=w.b,p=w.e,m=w.R,v=w.n,b=w.A,y=w.Z,U=w.m,F=null==r;for(F&&(r=new n(t.length>>>2<<5));0==a;)if(a=A(t,g,1),f=A(t,g+1,2),g+=3,0!=f){if(F&&(r=e.H.W(r,d+(1<<17))),1==f&&(i=U.J,o=U.h,u=511,h=31),2==f){s=p(t,g,5)+257,c=p(t,g+5,5)+1,l=p(t,g+10,4)+4,g+=14;let e=1;for(var E=0;E<38;E+=2)U.Q[E]=0,U.Q[E+1]=0;for(E=0;E<l;E++){const r=p(t,g+3*E,3);U.Q[1+(U.X[E]<<1)]=r,r>e&&(e=r)}g+=3*l,v(U.Q,e),b(U.Q,e,U.u),i=U.w,o=U.d,g=m(U.u,(1<<e)-1,s+c,t,g,U.v);const r=w.V(U.v,0,s,U.C);u=(1<<r)-1;const n=w.V(U.v,s,c,U.D);h=(1<<n)-1,v(U.C,r),b(U.C,r,i),v(U.D,n),b(U.D,n,o)}for(;;){const e=i[y(t,g)&u];g+=15&e;const n=e>>>4;if(n>>>8==0)r[d++]=n;else{if(256==n)break;{let e=d+n-254;if(n>264){const r=U.q[n-257];e=d+(r>>>3)+p(t,g,7&r),g+=7&r}const i=o[y(t,g)&h];g+=15&i;const a=i>>>4,f=U.c[a],s=(f>>>4)+A(t,g,15&f);for(g+=15&f;d<e;)r[d]=r[d++-s],r[d]=r[d++-s],r[d]=r[d++-s],r[d]=r[d++-s];d=e}}}}else{7&g&&(g+=8-(7&g));const i=4+(g>>>3),o=t[i-4]|t[i-3]<<8;F&&(r=e.H.W(r,d+o)),r.set(new n(t.buffer,t.byteOffset+i,o),d),g=i+o<<3,d+=o}return r.length==d?r:r.slice(0,d)},e.H.W=function(e,t){const r=e.length;if(t<=r)return e;const n=new Uint8Array(r<<1);return n.set(e,0),n},e.H.R=function(t,r,n,i,o,a){const f=e.H.e,s=e.H.Z;let c=0;for(;c<n;){const e=t[s(i,o)&r];o+=15&e;const n=e>>>4;if(n<=15)a[c]=n,c++;else{let e=0,t=0;16==n?(t=3+f(i,o,2),o+=2,e=a[c-1]):17==n?(t=3+f(i,o,3),o+=3):18==n&&(t=11+f(i,o,7),o+=7);const r=c+t;for(;c<r;)a[c]=e,c++}}return o},e.H.V=function(e,t,r,n){let i=0,o=0;const a=n.length>>>1;for(;o<r;){const r=e[o+t];n[o<<1]=0,n[1+(o<<1)]=r,r>i&&(i=r),o++}for(;o<a;)n[o<<1]=0,n[1+(o<<1)]=0,o++;return i},e.H.n=function(t,r){const n=e.H.m,i=t.length;let o,a,f,s;const c=n.j;for(var l=0;l<=r;l++)c[l]=0;for(l=1;l<i;l+=2)c[t[l]]++;const u=n.K;for(o=0,c[0]=0,a=1;a<=r;a++)o=o+c[a-1]<<1,u[a]=o;for(f=0;f<i;f+=2)s=t[f+1],0!=s&&(t[f]=u[s],u[s]++)},e.H.A=function(t,r,n){const i=t.length,o=e.H.m.r;for(let e=0;e<i;e+=2)if(0!=t[e+1]){const i=e>>1,a=t[e+1],f=i<<4|a,s=r-a;let c=t[e]<<s;const l=c+(1<<s);for(;c!=l;)n[o[c]>>>15-r]=f,c++}},e.H.l=function(t,r){const n=e.H.m.r,i=15-r;for(let e=0;e<t.length;e+=2)t[e]=n[t[e]<<r-t[e+1]]>>>i},e.H.M=function(e,t,r){r<<=7&t;const n=t>>>3;e[n]|=r,e[n+1]|=r>>>8},e.H.I=function(e,t,r){r<<=7&t;const n=t>>>3;e[n]|=r,e[n+1]|=r>>>8,e[n+2]|=r>>>16},e.H.e=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<r)-1},e.H.b=function(e,t,r){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<r)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},e.H.i=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},e.H.m=function(){const e=Uint16Array,t=Uint32Array;return{K:new e(16),j:new e(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[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,999,999,999],T:[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],q:new e(32),p:[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,65535,65535],z:[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],c:new t(32),J:new e(512),_:[],h:new e(32),$:[],w:new e(32768),C:[],v:[],d:new e(32768),D:[],u:new e(512),Q:[],r:new e(32768),s:new t(286),Y:new t(30),a:new t(19),t:new t(15e3),k:new e(65536),g:new e(32768)}}(),function(){const t=e.H.m;for(var r=0;r<32768;r++){let e=r;e=(2863311530&e)>>>1|(1431655765&e)<<1,e=(3435973836&e)>>>2|(858993459&e)<<2,e=(4042322160&e)>>>4|(252645135&e)<<4,e=(4278255360&e)>>>8|(16711935&e)<<8,t.r[r]=(e>>>16|e<<16)>>>17}function n(e,t,r){for(;0!=t--;)e.push(0,r)}for(r=0;r<32;r++)t.q[r]=t.S[r]<<3|t.T[r],t.c[r]=t.p[r]<<4|t.z[r];n(t._,144,8),n(t._,112,9),n(t._,24,7),n(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),n(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),n(t.Q,19,0),n(t.C,286,0),n(t.D,30,0),n(t.v,320,0)}(),e.H.N}();function o(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth}function a(e,t,r,n,i){let a=o(t);const s=Math.ceil(n*a/8);let c,l;a=Math.ceil(a/8);let u=e[r],h=0;if(u>1&&(e[r]=[0,0,1][u-2]),3==u)for(h=a;h<s;h++)e[h+1]=e[h+1]+(e[h+1-a]>>>1)&255;for(let o=0;o<i;o++)if(c=r+o*s,l=c+o+1,u=e[l-1],h=0,0==u)for(;h<s;h++)e[c+h]=e[l+h];else if(1==u){for(;h<a;h++)e[c+h]=e[l+h];for(;h<s;h++)e[c+h]=e[l+h]+e[c+h-a]}else if(2==u)for(;h<s;h++)e[c+h]=e[l+h]+e[c+h-s];else if(3==u){for(;h<a;h++)e[c+h]=e[l+h]+(e[c+h-s]>>>1);for(;h<s;h++)e[c+h]=e[l+h]+(e[c+h-s]+e[c+h-a]>>>1)}else{for(;h<a;h++)e[c+h]=e[l+h]+f(0,e[c+h-s],0);for(;h<s;h++)e[c+h]=e[l+h]+f(e[c+h-a],e[c+h-s],e[c+h-a-s])}return e}function f(e,t,r){const n=e+t-r,i=n-e,o=n-t,a=n-r;return i*i<=o*o&&i*i<=a*a?e:o*o<=a*a?t:r}function s(t,r,n){n.width=e.readUint(t,r),r+=4,n.height=e.readUint(t,r),r+=4,n.depth=t[r],r++,n.ctype=t[r],r++,n.compress=t[r],r++,n.filter=t[r],r++,n.interlace=t[r],r++}function c(e,t,r,n,i,o,a,f,s){const c=Math.min(t,i),l=Math.min(r,o);let u=0,h=0;for(let y=0;y<l;y++)for(let r=0;r<c;r++)if(a>=0&&f>=0?(u=y*t+r<<2,h=(f+y)*i+a+r<<2):(u=(-f+y)*t-a+r<<2,h=y*i+r<<2),0==s)n[h]=e[u],n[h+1]=e[u+1],n[h+2]=e[u+2],n[h+3]=e[u+3];else if(1==s){var d=e[u+3]*(1/255),g=e[u]*d,w=e[u+1]*d,A=e[u+2]*d,p=n[h+3]*(1/255),m=n[h]*p,v=n[h+1]*p,b=n[h+2]*p;const t=1-d,r=d+p*t,i=0==r?0:1/r;n[h+3]=255*r,n[h+0]=(g+m*t)*i,n[h+1]=(w+v*t)*i,n[h+2]=(A+b*t)*i}else if(2==s)d=e[u+3],g=e[u],w=e[u+1],A=e[u+2],p=n[h+3],m=n[h],v=n[h+1],b=n[h+2],d==p&&g==m&&w==v&&A==b?(n[h]=0,n[h+1]=0,n[h+2]=0,n[h+3]=0):(n[h]=g,n[h+1]=w,n[h+2]=A,n[h+3]=d);else if(3==s){if(d=e[u+3],g=e[u],w=e[u+1],A=e[u+2],p=n[h+3],m=n[h],v=n[h+1],b=n[h+2],d==p&&g==m&&w==v&&A==b)continue;if(d<220&&p>20)return!1}return!0}return{decode:function(t){const o=new Uint8Array(t);let a=8;const f=e,c=f.readUshort,l=f.readUint,u={tabs:{},frames:[]},h=new Uint8Array(o.length);let d,g=0,w=0;const A=[137,80,78,71,13,10,26,10];for(var p=0;p<8;p++)if(o[p]!=A[p])throw"The input is not a PNG file!";for(;a<o.length;){const t=f.readUint(o,a);a+=4;const A=f.readASCII(o,a,4);if(a+=4,"IHDR"==A)s(o,a,u);else if("iCCP"==A){for(var m=a;0!=o[m];)m++;f.readASCII(o,a,m-a),o[m+1];const r=o.slice(m+2,a+t);let s=null;try{s=n(r)}catch(e){s=i(r)}u.tabs[A]=s}else if("CgBI"==A)u.tabs[A]=o.slice(a,a+4);else if("IDAT"==A){for(p=0;p<t;p++)h[g+p]=o[a+p];g+=t}else if("acTL"==A)u.tabs[A]={num_frames:l(o,a),num_plays:l(o,a+4)},d=new Uint8Array(o.length);else if("fcTL"==A){0!=w&&((E=u.frames[u.frames.length-1]).data=r(u,d.slice(0,w),E.rect.width,E.rect.height),w=0);const e={x:l(o,a+12),y:l(o,a+16),width:l(o,a+4),height:l(o,a+8)};let t=c(o,a+22);t=c(o,a+20)/(0==t?100:t);const n={rect:e,delay:Math.round(1e3*t),dispose:o[a+24],blend:o[a+25]};u.frames.push(n)}else if("fdAT"==A){for(p=0;p<t-4;p++)d[w+p]=o[a+p+4];w+=t-4}else if("pHYs"==A)u.tabs[A]=[f.readUint(o,a),f.readUint(o,a+4),o[a+8]];else if("cHRM"==A)for(u.tabs[A]=[],p=0;p<8;p++)u.tabs[A].push(f.readUint(o,a+4*p));else if("tEXt"==A||"zTXt"==A){u.tabs[A]??(u.tabs[A]={});var v=f.nextZero(o,a),b=f.readASCII(o,a,v-a),y=a+t-v-1;if("tEXt"==A)F=f.readASCII(o,v+1,y);else{var U=n(o.slice(v+2,v+2+y));F=f.readUTF8(U,0,U.length)}u.tabs[A][b]=F}else if("iTXt"==A){u.tabs[A]??(u.tabs[A]={}),v=0,m=a,v=f.nextZero(o,m),b=f.readASCII(o,m,v-m);const e=o[m=v+1];var F;o[m+1],m+=2,v=f.nextZero(o,m),f.readASCII(o,m,v-m),m=v+1,v=f.nextZero(o,m),f.readUTF8(o,m,v-m),y=t-((m=v+1)-a),0==e?F=f.readUTF8(o,m,y):(U=n(o.slice(m,m+y)),F=f.readUTF8(U,0,U.length)),u.tabs[A][b]=F}else if("PLTE"==A)u.tabs[A]=f.readBytes(o,a,t);else if("hIST"==A){const e=u.tabs.PLTE.length/3;for(u.tabs[A]=[],p=0;p<e;p++)u.tabs[A].push(c(o,a+2*p))}else if("tRNS"==A)3==u.ctype?u.tabs[A]=f.readBytes(o,a,t):0==u.ctype?u.tabs[A]=c(o,a):2==u.ctype&&(u.tabs[A]=[c(o,a),c(o,a+2),c(o,a+4)]);else if("gAMA"==A)u.tabs[A]=f.readUint(o,a)/1e5;else if("sRGB"==A)u.tabs[A]=o[a];else if("bKGD"==A)0==u.ctype||4==u.ctype?u.tabs[A]=[c(o,a)]:2==u.ctype||6==u.ctype?u.tabs[A]=[c(o,a),c(o,a+2),c(o,a+4)]:3==u.ctype&&(u.tabs[A]=o[a]);else if("IEND"==A)break;a+=t,f.readUint(o,a),a+=4}var E;return 0!=w&&((E=u.frames[u.frames.length-1]).data=r(u,d.slice(0,w),E.rect.width,E.rect.height)),u.data=r(u,h,u.width,u.height),delete u.compress,delete u.interlace,delete u.filter,u},toRGBA8:function(e){const r=e.width,n=e.height;if(null==e.tabs.acTL)return[t(e.data,r,n,e).buffer];const i=[];e.frames[0].data??(e.frames[0].data=e.data);const o=r*n*4,a=new Uint8Array(o),f=new Uint8Array(o),s=new Uint8Array(o);for(let u=0;u<e.frames.length;u++){const h=e.frames[u],d=h.rect.x,g=h.rect.y,w=h.rect.width,A=h.rect.height,p=t(h.data,w,A,e);if(0!=u)for(var l=0;l<o;l++)s[l]=a[l];if(0==h.blend?c(p,w,A,a,r,n,d,g,0):1==h.blend&&c(p,w,A,a,r,n,d,g,1),i.push(a.buffer.slice(0)),0==h.dispose);else if(1==h.dispose)c(f,w,A,a,r,n,d,g,0);else if(2==h.dispose)for(l=0;l<o;l++)a[l]=s[l]}return i},_paeth:f,_copyTile:c,_bin:e}}();!function(){const{_copyTile:e}=v,{_bin:t}=v,r=v._paeth;var n={table:function(){const e=/* @__PURE__ */new Uint32Array(256);for(let t=0;t<256;t++){let r=t;for(let e=0;e<8;e++)1&r?r=3988292384^r>>>1:r>>>=1;e[t]=r}return e}(),update(e,t,r,i){for(let o=0;o<i;o++)e=n.table[255&(e^t[r+o])]^e>>>8;return e},crc:(e,t,r)=>4294967295^n.update(4294967295,e,t,r)};function i(e,t,r,n){t[r]+=e[0]*n>>4,t[r+1]+=e[1]*n>>4,t[r+2]+=e[2]*n>>4,t[r+3]+=e[3]*n>>4}function o(e){return Math.max(0,Math.min(255,e))}function a(e,t){const r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],o=e[3]-t[3];return r*r+n*n+i*i+o*o}function f(e,t,r,n,f,s,c){c??=1;const l=n.length,u=[];for(var h=0;h<l;h++){const e=n[h];u.push([e>>>0&255,e>>>8&255,e>>>16&255,e>>>24&255])}for(h=0;h<l;h++){let e=4294967295;for(var d=0,g=0;g<l;g++){var w=a(u[h],u[g]);g!=h&&w<e&&(e=w,d=g)}}const A=new Uint32Array(f.buffer),p=new Int16Array(t*r*4),m=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<m.length;h++)m[h]=255*((m[h]+.5)/16-.5);for(let b=0;b<r;b++)for(let f=0;f<t;f++){var v;h=4*(b*t+f),2!=c?v=[o(e[h]+p[h]),o(e[h+1]+p[h+1]),o(e[h+2]+p[h+2]),o(e[h+3]+p[h+3])]:(w=m[4*(3&b)+(3&f)],v=[o(e[h]+w),o(e[h+1]+w),o(e[h+2]+w),o(e[h+3]+w)]),d=0;let y=16777215;for(g=0;g<l;g++){const e=a(v,u[g]);e<y&&(y=e,d=g)}const U=u[d],F=[v[0]-U[0],v[1]-U[1],v[2]-U[2],v[3]-U[3]];1==c&&(f!=t-1&&i(F,p,h+4,7),b!=r-1&&(0!=f&&i(F,p,h+4*t-4,3),i(F,p,h+4*t,5),f!=t-1&&i(F,p,h+4*t+4,1))),s[h>>2]=d,A[h>>2]=n[d]}}function s(e,r,i,o,a){a??={};const{crc:f}=n,s=t.writeUint,c=t.writeUshort,l=t.writeASCII;let u=8;const h=e.frames.length>1;let d,g=!1,w=33+(h?20:0);if(null!=a.sRGB&&(w+=13),null!=a.pHYs&&(w+=21),null!=a.iCCP&&(d=pako.deflate(a.iCCP),w+=21+d.length+4),3==e.ctype){for(var A=e.plte.length,p=0;p<A;p++)e.plte[p]>>>24!=255&&(g=!0);w+=8+3*A+4+(g?8+1*A+4:0)}for(var m=0;m<e.frames.length;m++)h&&(w+=38),w+=(U=e.frames[m]).cimg.length+12,0!=m&&(w+=4);w+=12;const v=new Uint8Array(w),b=[137,80,78,71,13,10,26,10];for(p=0;p<8;p++)v[p]=b[p];if(s(v,u,13),u+=4,l(v,u,"IHDR"),u+=4,s(v,u,r),u+=4,s(v,u,i),u+=4,v[u]=e.depth,u++,v[u]=e.ctype,u++,v[u]=0,u++,v[u]=0,u++,v[u]=0,u++,s(v,u,f(v,u-17,17)),u+=4,null!=a.sRGB&&(s(v,u,1),u+=4,l(v,u,"sRGB"),u+=4,v[u]=a.sRGB,u++,s(v,u,f(v,u-5,5)),u+=4),null!=a.iCCP){const e=13+d.length;s(v,u,e),u+=4,l(v,u,"iCCP"),u+=4,l(v,u,"ICC profile"),u+=11,u+=2,v.set(d,u),u+=d.length,s(v,u,f(v,u-(e+4),e+4)),u+=4}if(null!=a.pHYs&&(s(v,u,9),u+=4,l(v,u,"pHYs"),u+=4,s(v,u,a.pHYs[0]),u+=4,s(v,u,a.pHYs[1]),u+=4,v[u]=a.pHYs[2],u++,s(v,u,f(v,u-13,13)),u+=4),h&&(s(v,u,8),u+=4,l(v,u,"acTL"),u+=4,s(v,u,e.frames.length),u+=4,s(v,u,null!=a.loop?a.loop:0),u+=4,s(v,u,f(v,u-12,12)),u+=4),3==e.ctype){for(s(v,u,3*(A=e.plte.length)),u+=4,l(v,u,"PLTE"),u+=4,p=0;p<A;p++){const t=3*p,r=e.plte[p],n=255&r,i=r>>>8&255,o=r>>>16&255;v[u+t+0]=n,v[u+t+1]=i,v[u+t+2]=o}if(u+=3*A,s(v,u,f(v,u-3*A-4,3*A+4)),u+=4,g){for(s(v,u,A),u+=4,l(v,u,"tRNS"),u+=4,p=0;p<A;p++)v[u+p]=e.plte[p]>>>24&255;u+=A,s(v,u,f(v,u-A-4,A+4)),u+=4}}let y=0;for(m=0;m<e.frames.length;m++){var U=e.frames[m];h&&(s(v,u,26),u+=4,l(v,u,"fcTL"),u+=4,s(v,u,y++),u+=4,s(v,u,U.rect.width),u+=4,s(v,u,U.rect.height),u+=4,s(v,u,U.rect.x),u+=4,s(v,u,U.rect.y),u+=4,c(v,u,o[m]),u+=2,c(v,u,1e3),u+=2,v[u]=U.dispose,u++,v[u]=U.blend,u++,s(v,u,f(v,u-30,30)),u+=4);const t=U.cimg;s(v,u,(A=t.length)+(0==m?0:4)),u+=4;const r=u;l(v,u,0==m?"IDAT":"fdAT"),u+=4,0!=m&&(s(v,u,y++),u+=4),v.set(t,u),u+=A,s(v,u,f(v,r,u-r)),u+=4}return s(v,u,0),u+=4,l(v,u,"IEND"),u+=4,s(v,u,f(v,u-4,4)),u+=4,v.buffer}function c(e,t,r){for(let n=0;n<e.frames.length;n++){const i=e.frames[n];i.rect.width;const o=i.rect.height,a=new Uint8Array(o*i.bpl+o);i.cimg=d(i.img,o,i.bpp,i.bpl,a,t,r)}}function l(t,r,n,i,o){const a=o[0],s=o[1],c=o[2],l=o[3],d=o[4],g=o[5];let A=6,p=8,m=255;for(var v=0;v<t.length;v++){const e=new Uint8Array(t[v]);for(var b=e.length,y=0;y<b;y+=4)m&=e[y+3]}const U=255!=m,F=function(t,r,n,i,o,a){const f=[];for(var s=0;s<t.length;s++){const u=new Uint8Array(t[s]),d=new Uint32Array(u.buffer);var c;let w=0,A=0,p=r,m=n,v=i?1:0;if(0!=s){const b=a||i||1==s||0!=f[s-2].dispose?1:2;let y=0,U=1e9;for(let e=0;e<b;e++){var l=new Uint8Array(t[s-1-e]);const i=new Uint32Array(t[s-1-e]);let a=r,f=n,c=-1,u=-1;for(let e=0;e<n;e++)for(let t=0;t<r;t++)d[g=e*r+t]!=i[g]&&(t<a&&(a=t),t>c&&(c=t),e<f&&(f=e),e>u&&(u=e));-1==c&&(a=f=c=u=0),o&&(!(1&~a)&&a--,!(1&~f)&&f--);const h=(c-a+1)*(u-f+1);h<U&&(U=h,y=e,w=a,A=f,p=c-a+1,m=u-f+1)}l=new Uint8Array(t[s-1-y]),1==y&&(f[s-1].dispose=2),c=new Uint8Array(p*m*4),e(l,r,n,c,p,m,-w,-A,0),v=e(u,r,n,c,p,m,-w,-A,3)?1:0,1==v?h(u,r,n,c,{x:w,y:A,width:p,height:m}):e(u,r,n,c,p,m,-w,-A,0)}else c=u.slice(0);f.push({rect:{x:w,y:A,width:p,height:m},img:c,blend:v,dispose:0})}if(i)for(s=0;s<f.length;s++){if(1==(w=f[s]).blend)continue;const e=w.rect,i=f[s-1].rect,a=Math.min(e.x,i.x),c=Math.min(e.y,i.y),l={x:a,y:c,width:Math.max(e.x+e.width,i.x+i.width)-a,height:Math.max(e.y+e.height,i.y+i.height)-c};f[s-1].dispose=1,s-1!=0&&u(t,r,n,f,s-1,l,o),u(t,r,n,f,s,l,o)}let d=0;if(1!=t.length)for(var g=0;g<f.length;g++){var w;d+=(w=f[g]).rect.width*w.rect.height}return f}(t,r,n,a,s,c),E={},_=[],C=[];if(0!=i){const e=[];for(y=0;y<F.length;y++)e.push(F[y].img.buffer);const t=w(function(e){let t=0;for(var r=0;r<e.length;r++)t+=e[r].byteLength;const n=new Uint8Array(t);let i=0;for(r=0;r<e.length;r++){const t=new Uint8Array(e[r]),o=t.length;for(let e=0;e<o;e+=4){let r=t[e],o=t[e+1],a=t[e+2];const f=t[e+3];0==f&&(r=o=a=0),n[i+e]=r,n[i+e+1]=o,n[i+e+2]=a,n[i+e+3]=f}i+=o}return n.buffer}(e),i);for(y=0;y<t.plte.length;y++)_.push(t.plte[y].est.rgba);let r=0;for(y=0;y<F.length;y++){const e=(B=F[y]).img.length;var T=new Uint8Array(t.inds.buffer,r>>2,e>>2);C.push(T);const n=new Uint8Array(t.abuf,r,e);g&&f(B.img,B.rect.width,B.rect.height,_,n,T),B.img.set(n),r+=e}}else for(v=0;v<F.length;v++){var B=F[v];const e=new Uint32Array(B.img.buffer);var I=B.rect.width;for(b=e.length,T=new Uint8Array(b),C.push(T),y=0;y<b;y++){const t=e[y];if(0!=y&&t==e[y-1])T[y]=T[y-1];else if(y>I&&t==e[y-I])T[y]=T[y-I];else{let e=E[t];if(null==e&&(E[t]=e=_.length,_.push(t),_.length>=300))break;T[y]=e}}}const M=_.length;for(M<=256&&0==d&&(p=M<=2?1:M<=4?2:M<=16?4:8,p=Math.max(p,l)),v=0;v<F.length;v++){(B=F[v]).rect.x,B.rect.y,I=B.rect.width;const e=B.rect.height;let t=B.img;new Uint32Array(t.buffer);let r=4*I,n=4;if(M<=256&&0==d){r=Math.ceil(p*I/8);var x=new Uint8Array(r*e);const i=C[v];for(let t=0;t<e;t++){y=t*r;const e=t*I;if(8==p)for(var R=0;R<I;R++)x[y+R]=i[e+R];else if(4==p)for(R=0;R<I;R++)x[y+(R>>1)]|=i[e+R]<<4-4*(1&R);else if(2==p)for(R=0;R<I;R++)x[y+(R>>2)]|=i[e+R]<<6-2*(3&R);else if(1==p)for(R=0;R<I;R++)x[y+(R>>3)]|=i[e+R]<<7-1*(7&R)}t=x,A=3,n=1}else if(0==U&&1==F.length){x=new Uint8Array(I*e*3);const i=I*e;for(y=0;y<i;y++){const e=3*y,r=4*y;x[e]=t[r],x[e+1]=t[r+1],x[e+2]=t[r+2]}t=x,A=2,n=3,r=3*I}B.img=t,B.bpl=r,B.bpp=n}return{ctype:A,depth:p,plte:_,frames:F}}function u(t,r,n,i,o,a,f){const s=Uint8Array,c=Uint32Array,l=new s(t[o-1]),u=new c(t[o-1]),d=o+1<t.length?new s(t[o+1]):null,g=new s(t[o]),w=new c(g.buffer);let A=r,p=n,m=-1,v=-1;for(let e=0;e<a.height;e++)for(let t=0;t<a.width;t++){const n=a.x+t,f=a.y+e,s=f*r+n,c=w[s];0==c||0==i[o-1].dispose&&u[s]==c&&(null==d||0!=d[4*s+3])||(n<A&&(A=n),n>m&&(m=n),f<p&&(p=f),f>v&&(v=f))}-1==m&&(A=p=m=v=0),f&&(!(1&~A)&&A--,!(1&~p)&&p--),a={x:A,y:p,width:m-A+1,height:v-p+1};const b=i[o];b.rect=a,b.blend=1,b.img=new Uint8Array(a.width*a.height*4),0==i[o-1].dispose?(e(l,r,n,b.img,a.width,a.height,-a.x,-a.y,0),h(g,r,n,b.img,a)):e(g,r,n,b.img,a.width,a.height,-a.x,-a.y,0)}function h(t,r,n,i,o){e(t,r,n,i,o.width,o.height,-o.x,-o.y,2)}function d(e,t,r,n,i,o,a){const f=[];let s,c=[0,1,2,3,4];-1!=o?c=[o]:(t*n>5e5||1==r)&&(c=[0]),a&&(s={level:0});const l=m;for(var u=0;u<c.length;u++){for(let o=0;o<t;o++)g(i,e,o,n,r,c[u]);f.push(l.deflate(i,s))}let h,d=1e9;for(u=0;u<f.length;u++)f[u].length<d&&(h=u,d=f[u].length);return f[h]}function g(e,t,n,i,o,a){const f=n*i;let s=f+n;if(e[s]=a,s++,0==a)if(i<500)for(var c=0;c<i;c++)e[s+c]=t[f+c];else e.set(new Uint8Array(t.buffer,f,i),s);else if(1==a){for(c=0;c<o;c++)e[s+c]=t[f+c];for(c=o;c<i;c++)e[s+c]=t[f+c]-t[f+c-o]+256&255}else if(0==n){for(c=0;c<o;c++)e[s+c]=t[f+c];if(2==a)for(c=o;c<i;c++)e[s+c]=t[f+c];if(3==a)for(c=o;c<i;c++)e[s+c]=t[f+c]-(t[f+c-o]>>1)+256&255;if(4==a)for(c=o;c<i;c++)e[s+c]=t[f+c]-r(t[f+c-o],0,0)+256&255}else{if(2==a)for(c=0;c<i;c++)e[s+c]=t[f+c]+256-t[f+c-i]&255;if(3==a){for(c=0;c<o;c++)e[s+c]=t[f+c]+256-(t[f+c-i]>>1)&255;for(c=o;c<i;c++)e[s+c]=t[f+c]+256-(t[f+c-i]+t[f+c-o]>>1)&255}if(4==a){for(c=0;c<o;c++)e[s+c]=t[f+c]+256-r(0,t[f+c-i],0)&255;for(c=o;c<i;c++)e[s+c]=t[f+c]+256-r(t[f+c-o],t[f+c-i],t[f+c-o-i])&255}}}function w(e,t){const r=new Uint8Array(e),n=r.slice(0),i=new Uint32Array(n.buffer),o=A(n,t),a=o[0],f=o[1],s=r.length,c=new Uint8Array(s>>2);let l;if(r.length<2e7)for(var u=0;u<s;u+=4)l=p(a,h=r[u]*(1/255),d=r[u+1]*(1/255),g=r[u+2]*(1/255),w=r[u+3]*(1/255)),c[u>>2]=l.ind,i[u>>2]=l.est.rgba;else for(u=0;u<s;u+=4){var h=r[u]*(1/255),d=r[u+1]*(1/255),g=r[u+2]*(1/255),w=r[u+3]*(1/255);for(l=a;l.left;)l=b(l.est,h,d,g,w)<=0?l.left:l.right;c[u>>2]=l.ind,i[u>>2]=l.est.rgba}return{abuf:n.buffer,inds:c,plte:f}}function A(e,t,r){r??=1e-4;const n=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=F(e,i.i0,i.i1),i.est=E(i.bst);const o=[i];for(;o.length<t;){let t=0,i=0;for(var a=0;a<o.length;a++)o[a].est.L>t&&(t=o[a].est.L,i=a);if(t<r)break;const f=o[i],s=y(e,n,f.i0,f.i1,f.est.e,f.est.eMq255);if(f.i0>=s||f.i1<=s){f.est.L=0;continue}const c={i0:f.i0,i1:s,bst:null,est:null,tdst:0,left:null,right:null};c.bst=F(e,c.i0,c.i1),c.est=E(c.bst);const l={i0:s,i1:f.i1,bst:null,est:null,tdst:0,left:null,right:null};for(l.bst={R:[],m:[],N:f.bst.N-c.bst.N},a=0;a<16;a++)l.bst.R[a]=f.bst.R[a]-c.bst.R[a];for(a=0;a<4;a++)l.bst.m[a]=f.bst.m[a]-c.bst.m[a];l.est=E(l.bst),f.left=c,f.right=l,o[i]=c,o.push(l)}for(o.sort((e,t)=>t.bst.N-e.bst.N),a=0;a<o.length;a++)o[a].ind=a;return[i,o]}function p(e,t,r,n,i){if(null==e.left)return e.tdst=function(e,t,r,n,i){const o=t-e[0],a=r-e[1],f=n-e[2],s=i-e[3];return o*o+a*a+f*f+s*s}(e.est.q,t,r,n,i),e;const o=b(e.est,t,r,n,i);let a=e.left,f=e.right;o>0&&(a=e.right,f=e.left);const s=p(a,t,r,n,i);if(s.tdst<=o*o)return s;const c=p(f,t,r,n,i);return c.tdst<s.tdst?c:s}function b(e,t,r,n,i){const{e:o}=e;return o[0]*t+o[1]*r+o[2]*n+o[3]*i-e.eMq}function y(e,t,r,n,i,o){for(n-=4;r<n;){for(;U(e,r,i)<=o;)r+=4;for(;U(e,n,i)>o;)n-=4;if(r>=n)break;const a=t[r>>2];t[r>>2]=t[n>>2],t[n>>2]=a,r+=4,n-=4}for(;U(e,r,i)>o;)r-=4;return r+4}function U(e,t,r){return e[t]*r[0]+e[t+1]*r[1]+e[t+2]*r[2]+e[t+3]*r[3]}function F(e,t,r){const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],o=r-t>>2;for(let a=t;a<r;a+=4){const t=e[a]*(1/255),r=e[a+1]*(1/255),o=e[a+2]*(1/255),f=e[a+3]*(1/255);i[0]+=t,i[1]+=r,i[2]+=o,i[3]+=f,n[0]+=t*t,n[1]+=t*r,n[2]+=t*o,n[3]+=t*f,n[5]+=r*r,n[6]+=r*o,n[7]+=r*f,n[10]+=o*o,n[11]+=o*f,n[15]+=f*f}return n[4]=n[1],n[8]=n[2],n[9]=n[6],n[12]=n[3],n[13]=n[7],n[14]=n[11],{R:n,m:i,N:o}}function E(e){const{R:t}=e,{m:r}=e,{N:n}=e,i=r[0],o=r[1],a=r[2],f=r[3],s=0==n?0:1/n,c=[t[0]-i*i*s,t[1]-i*o*s,t[2]-i*a*s,t[3]-i*f*s,t[4]-o*i*s,t[5]-o*o*s,t[6]-o*a*s,t[7]-o*f*s,t[8]-a*i*s,t[9]-a*o*s,t[10]-a*a*s,t[11]-a*f*s,t[12]-f*i*s,t[13]-f*o*s,t[14]-f*a*s,t[15]-f*f*s],l=c,u=_;let h=[Math.random(),Math.random(),Math.random(),Math.random()],d=0,g=0;if(0!=n)for(let A=0;A<16&&(h=u.multVec(l,h),g=Math.sqrt(u.dot(h,h)),h=u.sml(1/g,h),!(0!=A&&Math.abs(g-d)<1e-9));A++)d=g;const w=[i*s,o*s,a*s,f*s];return{Cov:c,q:w,e:h,L:d,eMq255:u.dot(u.sml(255,w),h),eMq:u.dot(h,w),rgba:(Math.round(255*w[3])<<24|Math.round(255*w[2])<<16|Math.round(255*w[1])<<8|Math.round(255*w[0]))>>>0}}var _={multVec:(e,t)=>[e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],e[4]*t[0]+e[5]*t[1]+e[6]*t[2]+e[7]*t[3],e[8]*t[0]+e[9]*t[1]+e[10]*t[2]+e[11]*t[3],e[12]*t[0]+e[13]*t[1]+e[14]*t[2]+e[15]*t[3]],dot:(e,t)=>e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3],sml:(e,t)=>[e*t[0],e*t[1],e*t[2],e*t[3]]};v.encode=function(e,t,r,n,i,o,a){n??=0,a??=!1;const f=l(e,t,r,n,[!1,!1,!1,0,a,!1]);return c(f,-1),s(f,t,r,i,o)},v.encodeLL=function(e,t,r,n,i,o,a,f){const l={ctype:0+(1==n?0:2)+(0==i?0:4),depth:o,frames:[]},u=(n+i)*o,h=u*t;for(let s=0;s<e.length;s++)l.frames.push({rect:{x:0,y:0,width:t,height:r},img:new Uint8Array(e[s]),blend:0,dispose:1,bpp:Math.ceil(u/8),bpl:Math.ceil(h/8)});return c(l,0,!0),s(l,t,r,a,f)},v.encode.compress=l,v.encode.dither=f,v.quantize=w,v.quantize.getKDtree=A,v.quantize.getNearest=p}();var b,y={toArrayBuffer(e,t){const r=e.width,n=e.height,i=r<<2,o=e.getContext("2d").getImageData(0,0,r,n),a=new Uint32Array(o.data.buffer),f=(32*r+31)/32<<2,s=f*n,c=122+s,l=new ArrayBuffer(c),u=new DataView(l),h=1<<20;let d,g,w,A,p=h,m=0,v=0,b=0;function U(e){u.setUint16(v,e,!0),v+=2}function F(e){u.setUint32(v,e,!0),v+=4}function E(e){v+=e}U(19778),F(c),E(4),F(122),F(108),F(r),F(-n>>>0),U(1),U(32),F(3),F(s),F(2835),F(2835),E(8),F(16711680),F(65280),F(255),F(4278190080),F(1466527264),function e(){for(;m<n&&p>0;){for(A=122+m*f,d=0;d<i;)p--,g=a[b++],w=g>>>24,u.setUint32(A+d,g<<8|w),d+=4;m++}b<a.length?(p=h,setTimeout(e,y._dly)):t(l)}()},toBlob(e,t){this.toArrayBuffer(e,e=>{t(new Blob([e],{type:"image/bmp"}))})},_dly:9},U={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},F={[U.CHROME]:16384,[U.FIREFOX]:11180,[U.DESKTOP_SAFARI]:16384,[U.IE]:8192,[U.IOS]:4096,[U.ETC]:8192},E="undefined"!=typeof window,_="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,C=E&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),T=(E||_)&&(C&&C.getOriginalSymbol(window,"File")||"undefined"!=typeof File&&File),B=(E||_)&&(C&&C.getOriginalSymbol(window,"FileReader")||"undefined"!=typeof FileReader&&FileReader);function I(e,t,r=Date.now()){return new Promise(n=>{const i=e.split(","),o=i[0].match(/:(.*?);/)[1],a=globalThis.atob(i[1]);let f=a.length;const s=new Uint8Array(f);for(;f--;)s[f]=a.charCodeAt(f);const c=new Blob([s],{type:o});c.name=t,c.lastModified=r,n(c)})}function M(e){return new Promise((t,r)=>{const n=new B;n.onload=()=>t(n.result),n.onerror=e=>r(e),n.readAsDataURL(e)})}function x(e){return new Promise((t,r)=>{const n=new Image;n.onload=()=>t(n),n.onerror=e=>r(e),n.src=e})}function R(){if(void 0!==R.cachedResult)return R.cachedResult;let e=U.ETC;const{userAgent:t}=navigator;return/Chrom(e|ium)/i.test(t)?e=U.CHROME:/iP(ad|od|hone)/i.test(t)&&/WebKit/i.test(t)?e=U.IOS:/Safari/i.test(t)?e=U.DESKTOP_SAFARI:/Firefox/i.test(t)?e=U.FIREFOX:(/MSIE/i.test(t)||1==!!document.documentMode)&&(e=U.IE),R.cachedResult=e,R.cachedResult}function S(e,t){const r=F[R()];let n=e,i=t,o=n*i;const a=n>i?i/n:n/i;for(;o>r*r;){const e=(r+n)/2,t=(r+i)/2;e<t?(i=t,n=t*a):(i=e*a,n=e),o=n*i}return{width:n,height:i}}function Q(e,t){let r,n;try{if(r=new OffscreenCanvas(e,t),n=r.getContext("2d"),null===n)throw new Error("getContext of OffscreenCanvas returns null")}catch(e){r=document.createElement("canvas"),n=r.getContext("2d")}return r.width=e,r.height=t,[r,n]}function k(e,t){const{width:r,height:n}=S(e.width,e.height),[i,o]=Q(r,n);return t&&/jpe?g/.test(t)&&(o.fillStyle="white",o.fillRect(0,0,i.width,i.height)),o.drawImage(e,0,0,i.width,i.height),i}function L(){return void 0!==L.cachedResult||(L.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"undefined"!=typeof document&&"ontouchend"in document),L.cachedResult}function H(e,t={}){return new Promise(function(r,n){let i,o;var a=function(){try{return o=k(i,t.fileType||e.type),r([i,o])}catch(e){return n(e)}},f=function(t){try{var r=function(e){try{throw e}catch(e){return n(e)}};try{let t;return M(e).then(function(e){try{return t=e,x(t).then(function(e){try{return i=e,function(){try{return a()}catch(e){return n(e)}}()}catch(e){return r(e)}},r)}catch(e){return r(e)}},r)}catch(e){r(e)}}catch(e){return n(e)}};try{if(L()||[U.DESKTOP_SAFARI,U.MOBILE_SAFARI].includes(R()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(e).then(function(e){try{return i=e,a()}catch(e){return f()}},f)}catch(e){f()}})}function O(e,t,r,n,i=1){return new Promise(function(o,a){let f;if("image/png"===t){let c,l,u;return c=e.getContext("2d"),({data:l}=c.getImageData(0,0,e.width,e.height)),u=v.encode([l.buffer],e.width,e.height,4096*i),f=new Blob([u],{type:t}),f.name=r,f.lastModified=n,s.call(this)}{if("image/bmp"===t)return new Promise(t=>y.toBlob(e,t)).then(function(e){try{return f=e,f.name=r,f.lastModified=n,h.call(this)}catch(e){return a(e)}}.bind(this),a);{if("function"==typeof OffscreenCanvas&&e instanceof OffscreenCanvas)return e.convertToBlob({type:t,quality:i}).then(function(e){try{return f=e,f.name=r,f.lastModified=n,d.call(this)}catch(e){return a(e)}}.bind(this),a);{let g;return g=e.toDataURL(t,i),I(g,r,n).then(function(e){try{return f=e,d.call(this)}catch(e){return a(e)}}.bind(this),a)}function d(){return h.call(this)}}function h(){return s.call(this)}}function s(){return o(f)}})}function P(e){e.width=0,e.height=0}function q(){return new Promise(function(e,t){let r,n,i,o;return void 0!==q.cachedResult?e(q.cachedResult):I("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then(function(a){try{return r=a,H(r).then(function(a){try{return n=a[1],O(n,r.type,r.name,r.lastModified).then(function(r){try{return i=r,P(n),H(i).then(function(r){try{return o=r[0],q.cachedResult=1===o.width&&2===o.height,e(q.cachedResult)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)}catch(e){return t(e)}},t)})}function D(e){return new Promise((t,r)=>{const n=new B;n.onload=e=>{const r=new DataView(e.target.result);if(65496!=r.getUint16(0,!1))return t(-2);const n=r.byteLength;let i=2;for(;i<n;){if(r.getUint16(i+2,!1)<=8)return t(-1);const e=r.getUint16(i,!1);if(i+=2,65505==e){if(1165519206!=r.getUint32(i+=2,!1))return t(-1);const e=18761==r.getUint16(i+=6,!1);i+=r.getUint32(i+4,e);const n=r.getUint16(i,e);i+=2;for(let o=0;o<n;o++)if(274==r.getUint16(i+12*o,e))return t(r.getUint16(i+12*o+8,e))}else{if(65280&~e)break;i+=r.getUint16(i,!1)}}return t(-1)},n.onerror=e=>r(e),n.readAsArrayBuffer(e)})}function z(e,t){const{width:r}=e,{height:n}=e,{maxWidthOrHeight:i}=t;let o,a=e;return isFinite(i)&&(r>i||n>i)&&([a,o]=Q(r,n),r>n?(a.width=i,a.height=n/r*i):(a.width=r/n*i,a.height=i),o.drawImage(e,0,0,a.width,a.height),P(e)),a}function N(e,t){const{width:r}=e,{height:n}=e,[i,o]=Q(r,n);switch(t>4&&t<9?(i.width=n,i.height=r):(i.width=r,i.height=n),t){case 2:o.transform(-1,0,0,1,r,0);break;case 3:o.transform(-1,0,0,-1,r,n);break;case 4:o.transform(1,0,0,-1,0,n);break;case 5:o.transform(0,1,1,0,0,0);break;case 6:o.transform(0,1,-1,0,n,0);break;case 7:o.transform(0,-1,-1,0,n,r);break;case 8:o.transform(0,-1,1,0,0,r)}return o.drawImage(e,0,0,r,n),P(e),i}function W(e,t,r=0){return new Promise(function(n,i){let o,a,f,s,c,l,u,h,d,g,w,A,p,m,v,b,y,U,F,E;function _(e=5){if(t.signal&&t.signal.aborted)throw t.signal.reason;o+=e,t.onProgress(Math.min(o,100))}function C(e){if(t.signal&&t.signal.aborted)throw t.signal.reason;o=Math.min(Math.max(e,o),100),t.onProgress(o)}return o=r,a=t.maxIteration||10,f=1024*t.maxSizeMB*1024,_(),H(e,t).then(function(r){try{return[,s]=r,_(),c=z(s,t),_(),new Promise(function(r,n){var i;if(!(i=t.exifOrientation))return D(e).then(function(e){try{return i=e,o.call(this)}catch(e){return n(e)}}.bind(this),n);function o(){return r(i)}return o.call(this)}).then(function(r){try{return l=r,_(),q().then(function(r){try{return u=r?c:N(c,l),_(),h=t.initialQuality||1,d=t.fileType||e.type,O(u,d,e.name,e.lastModified,h).then(function(r){try{{if(g=r,_(),w=g.size>f,A=g.size>e.size,!w&&!A)return C(100),n(g);var o;function T(){if(a--&&(v>f||v>p)){let t,r;return t=E?.95*F.width:F.width,r=E?.95*F.height:F.height,[y,U]=Q(t,r),U.drawImage(F,0,0,t,r),h*="image/png"===d?.85:.95,O(y,d,e.name,e.lastModified,h).then(function(e){try{return b=e,P(F),F=y,v=b.size,C(Math.min(99,Math.floor((m-v)/(m-f)*100))),T}catch(e){return i(e)}},i)}return[1]}return p=e.size,m=g.size,v=m,F=u,E=!t.alwaysKeepResolution&&w,(o=function(e){for(;e;){if(e.then)return void e.then(o,i);try{if(e.pop){if(e.length)return e.pop()?B.call(this):e;e=T}else e=e.call(this)}catch(e){return i(e)}}}.bind(this))(T);function B(){return P(F),P(y),P(c),P(u),P(s),C(100),n(b)}}}catch(l){return i(l)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)}catch(e){return i(e)}}.bind(this),i)})}function j(e,t){return new Promise((r,n)=>{b||(b=function(e){const t=[];return t.push(e),URL.createObjectURL(new Blob(t))}("\nlet scriptImported = false\nself.addEventListener('message', async (e) => {\n const { file, id, imageCompressionLibUrl, options } = e.data\n options.onProgress = (progress) => self.postMessage({ progress, id })\n try {\n if (!scriptImported) {\n // console.log('[worker] importScripts', imageCompressionLibUrl)\n self.importScripts(imageCompressionLibUrl)\n scriptImported = true\n }\n // console.log('[worker] self', self)\n const compressedFile = await imageCompression(file, options)\n self.postMessage({ file: compressedFile, id })\n } catch (e) {\n // console.error('[worker] error', e)\n self.postMessage({ error: e.message + '\\n' + e.stack, id })\n }\n})\n"));const i=new Worker(b);i.addEventListener("message",function(e){if(t.signal&&t.signal.aborted)i.terminate();else if(void 0===e.data.progress){if(e.data.error)return n(new Error(e.data.error)),void i.terminate();r(e.data.file),i.terminate()}else t.onProgress(e.data.progress)}),i.addEventListener("error",n),t.signal&&t.signal.addEventListener("abort",()=>{n(t.signal.reason),i.terminate()}),i.postMessage({file:e,imageCompressionLibUrl:t.libURL,options:{...t,onProgress:void 0,signal:void 0}})})}function G(e,t){return new Promise(function(r,n){let i,o,a,f,s,c;if(i={...t},a=0,({onProgress:f}=i),i.maxSizeMB=i.maxSizeMB||Number.POSITIVE_INFINITY,s="boolean"!=typeof i.useWebWorker||i.useWebWorker,delete i.useWebWorker,i.onProgress=e=>{a=e,"function"==typeof f&&f(a)},!(e instanceof Blob||e instanceof T))return n(/* @__PURE__ */new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return n(/* @__PURE__ */new Error("The file given is not an image"));if(c="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope,!s||"function"!=typeof Worker||c)return W(e,i).then(function(e){try{return o=e,h.call(this)}catch(e){return n(e)}}.bind(this),n);var l=function(){try{return h.call(this)}catch(e){return n(e)}}.bind(this),u=function(t){try{return W(e,i).then(function(e){try{return o=e,l()}catch(e){return n(e)}},n)}catch(e){return n(e)}};try{return i.libURL=i.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",j(e,i).then(function(e){try{return o=e,l()}catch(e){return u()}},u)}catch(e){u()}function h(){try{o.name=e.name,o.lastModified=e.lastModified}catch(e){}try{i.preserveExif&&"image/jpeg"===e.type&&(!i.fileType||i.fileType&&i.fileType===e.type)&&(o=g(e,o))}catch(e){}return r(o)}})}function K({className:t}){/* @__PURE__ */
3
+ return e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",className:t,"aria-hidden":"true",focusable:"false",children:/* @__PURE__ */e("path",{fill:"currentColor",d:"M12 20q-3.35 0-5.675-2.325T4 12t2.325-5.675T12 4q1.725 0 3.3.712T18 6.75V5q0-.425.288-.712T19 4t.713.288T20 5v5q0 .425-.288.713T19 11h-5q-.425 0-.712-.288T13 10t.288-.712T14 9h3.2q-.8-1.4-2.187-2.2T12 6Q9.5 6 7.75 7.75T6 12t1.75 4.25T12 18q1.7 0 3.113-.862t2.187-2.313q.2-.35.563-.487t.737-.013q.4.125.575.525t-.025.75q-1.025 2-2.925 3.2T12 20"})})}G.getDataUrlFromFile=M,G.getFilefromDataUrl=I,G.loadImage=x,G.drawImageInCanvas=k,G.drawFileInCanvas=H,G.canvasToFile=O,G.getExifOrientation=D,G.handleMaxWidthOrHeight=z,G.followExifOrientation=N,G.cleanupCanvasMemory=P,G.isAutoOrientationInBrowser=q,G.approximateBelowMaximumCanvasSizeOfBrowser=S,G.copyExifWithoutOrientation=g,G.getBrowserName=R,G.version="2.0.2";export{f as a,t as c,h as i,G as n,a as o,d as r,c as s,K as t};
@@ -1,3 +1,3 @@
1
- import{t}from"./C3uDEVBt.js";import{i as a,n as e}from"./BItJQVdK.js";import{t as i}from"./Cb1JRT_1.js";var r=({title:r,description:s,iconSvg:o,className:l})=>{const{props:n,organization:c}=e(),m=n?.emptyStateImage;/* @__PURE__ */
1
+ import{t}from"./DrrpB4Om.js";import{i as a,n as e}from"./CaX2xgrP.js";import{t as i}from"./CATr-3VW.js";var r=({title:r,description:s,iconSvg:o,className:l})=>{const{props:n,organization:c}=e(),m=n?.emptyStateImage;/* @__PURE__ */
2
2
  return t("div",{className:a("mx-auto flex w-full max-w-md flex-col items-center justify-center gap-8",l),children:[c?.integrationSettings?.showLogo?/* @__PURE__ */t("img",{className:"h-44 w-auto",src:c?.logoUrl||"/images/qrati-logo.svg",alt:r}):m?/* @__PURE__ */t("img",{className:"h-44 w-auto",src:m,alt:r}):o?/* @__PURE__ */t("div",{className:"text-primary h-44 w-auto",children:o}):null,/* @__PURE__ */t("div",{className:"space-y-2",children:[
3
3
  /* @__PURE__ */t(i,{variant:"h4",align:"center",children:r}),"string"==typeof s&&/* @__PURE__ */t(i,{variant:"body2",color:"muted",align:"center",children:s}),"string"!=typeof s&&s]})]})};export{r as t};
@@ -1,2 +1,2 @@
1
- import{E as r,p as n,t as o,v as a,y as s}from"./C3uDEVBt.js";var t={loading:"Loading...",error:"Error",not_found:"Translation not found"},e=r({locale:"en",translations:t,isLoading:!1,error:null}),i=()=>{const r=s(e);if(!r)throw new Error("useI18n must be used within an I18nProvider");const{translations:n,isLoading:o,error:i}=r;return{t:a((r,a)=>o?t.loading:i?t.error:n[r]||a||r,[n,o,i])}},l=i,d=({children:r,locale:a="en",translations:s})=>{const i=n(()=>({locale:a,translations:{...t,...s||{}},isLoading:!1,error:null}),[a,s]);/* @__PURE__ */
1
+ import{E as r,p as n,t as o,v as a,y as s}from"./DrrpB4Om.js";var t={loading:"Loading...",error:"Error",not_found:"Translation not found"},e=r({locale:"en",translations:t,isLoading:!1,error:null}),i=()=>{const r=s(e);if(!r)throw new Error("useI18n must be used within an I18nProvider");const{translations:n,isLoading:o,error:i}=r;return{t:a((r,a)=>o?t.loading:i?t.error:n[r]||a||r,[n,o,i])}},l=i,d=({children:r,locale:a="en",translations:s})=>{const i=n(()=>({locale:a,translations:{...t,...s||{}},isLoading:!1,error:null}),[a,s]);/* @__PURE__ */
2
2
  return o(e.Provider,{value:i,children:r})};export{i as n,l as r,d as t};
@@ -1 +1 @@
1
- import{t as r}from"./C3uDEVBt.js";import{i as a}from"./BItJQVdK.js";var s=({className:s,rounded:e=!1,...o})=>/* @__PURE__ */r("div",{className:a("bg-border animate-pulse",e?"rounded-full":"rounded",s),...o});export{s as t};
1
+ import{t as r}from"./DrrpB4Om.js";import{i as a}from"./CaX2xgrP.js";var s=({className:s,rounded:e=!1,...o})=>/* @__PURE__ */r("div",{className:a("bg-border animate-pulse",e?"rounded-full":"rounded",s),...o});export{s as t};