9drive 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +389 -0
- package/backend/dist/app.js +113 -0
- package/backend/dist/config/env.js +75 -0
- package/backend/dist/config/prisma.js +30 -0
- package/backend/dist/middleware/api-key.middleware.js +38 -0
- package/backend/dist/middleware/auth.middleware.js +21 -0
- package/backend/dist/middleware/error.middleware.js +7 -0
- package/backend/dist/modules/api-keys/api-key.routes.js +90 -0
- package/backend/dist/modules/audit-logs/audit-log.routes.js +20 -0
- package/backend/dist/modules/auth/auth.routes.js +201 -0
- package/backend/dist/modules/cdn/cdn.routes.js +105 -0
- package/backend/dist/modules/connected-accounts/connected-account.routes.js +313 -0
- package/backend/dist/modules/files/file.routes.js +1013 -0
- package/backend/dist/modules/files/stream-file.js +10 -0
- package/backend/dist/modules/files/stream-google-file.js +79 -0
- package/backend/dist/modules/folders/folder.routes.js +546 -0
- package/backend/dist/modules/google/google.service.js +485 -0
- package/backend/dist/modules/invites/invite.routes.js +127 -0
- package/backend/dist/modules/provider-configs/provider-config.routes.js +53 -0
- package/backend/dist/modules/public/public.routes.js +44 -0
- package/backend/dist/modules/public-api/public-api.routes.js +8 -0
- package/backend/dist/modules/s3/s3.service.js +104 -0
- package/backend/dist/modules/storage/storage.routes.js +108 -0
- package/backend/dist/modules/system/system.routes.js +663 -0
- package/backend/dist/modules/uploads/upload.routes.js +569 -0
- package/backend/dist/scripts/debug-query.js +19 -0
- package/backend/dist/scripts/seed-google-config-if-present.js +49 -0
- package/backend/dist/scripts/seed-google-config.js +40 -0
- package/backend/dist/scripts/test-api-upload.js +37 -0
- package/backend/dist/scripts/test-external-upload.js +181 -0
- package/backend/dist/scripts/test-s3-connection.js +33 -0
- package/backend/dist/server.js +7 -0
- package/backend/dist/utils/audit.js +20 -0
- package/backend/dist/utils/crypto.js +33 -0
- package/backend/dist/utils/jwt.js +15 -0
- package/backend/dist/utils/password.js +14 -0
- package/backend/prisma/generated/sqlite-client/client.d.ts +1 -0
- package/backend/prisma/generated/sqlite-client/client.js +5 -0
- package/backend/prisma/generated/sqlite-client/default.d.ts +1 -0
- package/backend/prisma/generated/sqlite-client/default.js +5 -0
- package/backend/prisma/generated/sqlite-client/edge.d.ts +1 -0
- package/backend/prisma/generated/sqlite-client/edge.js +436 -0
- package/backend/prisma/generated/sqlite-client/index-browser.js +422 -0
- package/backend/prisma/generated/sqlite-client/index.d.ts +35178 -0
- package/backend/prisma/generated/sqlite-client/index.js +457 -0
- package/backend/prisma/generated/sqlite-client/package.json +183 -0
- package/backend/prisma/generated/sqlite-client/query_engine-windows.dll.node +0 -0
- package/backend/prisma/generated/sqlite-client/query_engine_bg.js +2 -0
- package/backend/prisma/generated/sqlite-client/query_engine_bg.wasm +0 -0
- package/backend/prisma/generated/sqlite-client/runtime/edge-esm.js +35 -0
- package/backend/prisma/generated/sqlite-client/runtime/edge.js +35 -0
- package/backend/prisma/generated/sqlite-client/runtime/index-browser.d.ts +370 -0
- package/backend/prisma/generated/sqlite-client/runtime/index-browser.js +17 -0
- package/backend/prisma/generated/sqlite-client/runtime/library.d.ts +3982 -0
- package/backend/prisma/generated/sqlite-client/runtime/library.js +147 -0
- package/backend/prisma/generated/sqlite-client/runtime/react-native.js +84 -0
- package/backend/prisma/generated/sqlite-client/runtime/wasm-compiler-edge.js +85 -0
- package/backend/prisma/generated/sqlite-client/runtime/wasm-engine-edge.js +38 -0
- package/backend/prisma/generated/sqlite-client/schema.prisma +354 -0
- package/backend/prisma/generated/sqlite-client/wasm-edge-light-loader.mjs +5 -0
- package/backend/prisma/generated/sqlite-client/wasm-worker-loader.mjs +5 -0
- package/backend/prisma/generated/sqlite-client/wasm.d.ts +1 -0
- package/backend/prisma/generated/sqlite-client/wasm.js +443 -0
- package/backend/prisma/migrations/20260604084325_init/migration.sql +191 -0
- package/backend/prisma/migrations/20260604090020_global_provider_config/migration.sql +8 -0
- package/backend/prisma/migrations/20260604091957_virtual_folders/migration.sql +32 -0
- package/backend/prisma/migrations/20260604095418_nested_folders/migration.sql +8 -0
- package/backend/prisma/migrations/20260604095705_file_shares/migration.sql +22 -0
- package/backend/prisma/migrations/20260604100802_file_preview_tokens/migration.sql +20 -0
- package/backend/prisma/migrations/20260604120000_add_file_share_token/migration.sql +3 -0
- package/backend/prisma/migrations/20260604130000_workspace_invites/migration.sql +17 -0
- package/backend/prisma/migrations/20260604133000_invite_targets/migration.sql +9 -0
- package/backend/prisma/migrations/20260605090000_query_indexes/migration.sql +12 -0
- package/backend/prisma/migrations/20260605100000_folder_icons/migration.sql +1 -0
- package/backend/prisma/migrations/20260605110000_google_auth_handoff/migration.sql +22 -0
- package/backend/prisma/migrations/20260611120000_s3_storage_support/migration.sql +31 -0
- package/backend/prisma/migrations/20260611130000_upload_routing_policy/migration.sql +14 -0
- package/backend/prisma/migrations/20260611140000_api_keys/migration.sql +21 -0
- package/backend/prisma/migrations/20260630030000_upload_session_resumable_fields/migration.sql +9 -0
- package/backend/prisma/migrations/migration_lock.toml +3 -0
- package/backend/prisma/schema.prisma +353 -0
- package/backend/prisma/schema.sqlite.prisma +354 -0
- package/backend/public/assets/index-B4ifIM_G.js +135 -0
- package/backend/public/assets/index-DwOPZrmt.css +2 -0
- package/backend/public/assets/ort-wasm-simd-threaded.jsep-D5Jk56-t.wasm +0 -0
- package/backend/public/assets/ort.bundle.min-CpXgll2e.js +2746 -0
- package/backend/public/assets/ort.bundle.min-OfoG_cy9.mjs +2817 -0
- package/backend/public/assets/ort.webgpu.bundle.min-C1vdBqT7.js +2746 -0
- package/backend/public/assets/ort.webgpu.bundle.min-CEayb2S6.mjs +2817 -0
- package/backend/public/assets/pdf.worker.min-Dswkl-cV.mjs +29 -0
- package/backend/public/favicon.ico +74 -0
- package/backend/public/favicon.svg +74 -0
- package/backend/public/icons.svg +24 -0
- package/backend/public/index.html +34 -0
- package/backend/public/manifest.webmanifest +1 -0
- package/backend/public/maskable-icon.svg +22 -0
- package/backend/public/pwa-192x192.svg +22 -0
- package/backend/public/pwa-512x512.svg +22 -0
- package/backend/public/registerSW.js +1 -0
- package/backend/public/sw.js +1 -0
- package/backend/public/workbox-9c191d2f.js +1 -0
- package/bin/9drive.js +320 -0
- package/package.json +60 -0
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),l=(e=>typeof require<`u`?require:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof require<`u`?require:e)[t]}):e)(function(e){if(typeof require<`u`)return require.apply(this,arguments);throw Error('Calling `require` for "'+e+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var u=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function j(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function M(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function N(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,N(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+j(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),N(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+j(a,u),c+=N(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+j(a,u++),c+=N(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return N(M(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function P(e,t,n){if(e==null)return e;var r=[],i=0;return N(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function F(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var I=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},L={map:P,forEach:function(e,t,n){P(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return P(e,function(){t++}),t},toArray:function(e){return P(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=L,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return E(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return E(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=O,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:F}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,I)}catch(e){I(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.7`})),d=o(((e,t)=>{t.exports=u()})),f=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),p=o(((e,t)=>{t.exports=f()})),m=o((e=>{var t=d();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.7`})),h=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=m()})),g=o((e=>{var t=p(),n=d(),r=h();function i(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function c(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(o(e)!==e)throw Error(i(188))}function u(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var m=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R={pending:!1,data:null,method:null,action:null},ee=[],te=-1;function ne(e){return{current:e}}function re(e){0>te||(e.current=ee[te],ee[te]=null,te--)}function z(e,t){te++,ee[te]=e.current,e.current=t}var ie=ne(null),ae=ne(null),oe=ne(null),se=ne(null);function ce(e,t){switch(z(oe,t),z(ae,e),z(ie,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?qd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=qd(t),e=Jd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}re(ie),z(ie,e)}function le(){re(ie),re(ae),re(oe)}function ue(e){e.memoizedState!==null&&z(se,e);var t=ie.current,n=Jd(t,e.type);t!==n&&(z(ae,e),z(ie,n))}function de(e){ae.current===e&&(re(ie),re(ae)),se.current===e&&(re(se),ip._currentValue=R)}var fe,B;function pe(e){if(fe===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||``,B=-1<e.stack.indexOf(`
|
|
2
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
3
|
+
`+fe+e+B}var me=!1;function he(e,t){if(!e||me)return``;me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
4
|
+
`),l=s.split(`
|
|
5
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
6
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?pe(n):``}function ge(e,t){switch(e.tag){case 26:case 27:case 5:return pe(e.type);case 16:return pe(`Lazy`);case 13:return e.child!==t&&t!==null?pe(`Suspense Fallback`):pe(`Suspense`);case 19:return pe(`SuspenseList`);case 0:case 15:return he(e.type,!1);case 11:return he(e.type.render,!1);case 1:return he(e.type,!0);case 31:return pe(`Activity`);default:return``}}function _e(e){try{var t=``,n=null;do t+=ge(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
7
|
+
Error generating stack: `+e.message+`
|
|
8
|
+
`+e.stack}}var ve=Object.prototype.hasOwnProperty,ye=t.unstable_scheduleCallback,V=t.unstable_cancelCallback,H=t.unstable_shouldYield,be=t.unstable_requestPaint,xe=t.unstable_now,Se=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,we=t.unstable_UserBlockingPriority,Te=t.unstable_NormalPriority,Ee=t.unstable_LowPriority,De=t.unstable_IdlePriority,Oe=t.log,ke=t.unstable_setDisableYieldValue,Ae=null,je=null;function Me(e){if(typeof Oe==`function`&&ke(e),je&&typeof je.setStrictMode==`function`)try{je.setStrictMode(Ae,e)}catch{}}var Ne=Math.clz32?Math.clz32:Ie,Pe=Math.log,Fe=Math.LN2;function Ie(e){return e>>>=0,e===0?32:31-(Pe(e)/Fe|0)|0}var Le=256,Re=262144,ze=4194304;function Be(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ve(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Be(n))):i=Be(o):i=Be(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Be(n))):i=Be(o)):i=Be(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function He(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ue(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function We(){var e=ze;return ze<<=1,!(ze&62914560)&&(ze=4194304),e}function Ge(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ke(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function qe(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ne(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Je(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Je(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ne(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ye(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ne(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Xe(e,t){var n=t&-t;return n=n&42?1:Ze(n),(n&(e.suspendedLanes|t))===0?n:0}function Ze(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Qe(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function $e(){var e=L.p;return e===0?(e=window.event,e===void 0?32:bp(e.type)):e}function et(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var tt=Math.random().toString(36).slice(2),nt=`__reactFiber$`+tt,rt=`__reactProps$`+tt,it=`__reactContainer$`+tt,at=`__reactEvents$`+tt,ot=`__reactListeners$`+tt,st=`__reactHandles$`+tt,ct=`__reactResources$`+tt,lt=`__reactMarker$`+tt;function ut(e){delete e[nt],delete e[rt],delete e[at],delete e[ot],delete e[st]}function dt(e){var t=e[nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[it]||n[nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=_f(e);e!==null;){if(n=e[nt])return n;e=_f(e)}return t}e=n,n=e.parentNode}return null}function ft(e){if(e=e[nt]||e[it]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function pt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function mt(e){var t=e[ct];return t||=e[ct]={hoistableStyles:new Map,hoistableScripts:new Map},t}function ht(e){e[lt]=!0}var gt=new Set,_t={};function vt(e,t){yt(e,t),yt(e+`Capture`,t)}function yt(e,t){for(_t[e]=t,e=0;e<t.length;e++)gt.add(t[e])}var bt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),xt={},St={};function Ct(e){return ve.call(St,e)?!0:ve.call(xt,e)?!1:bt.test(e)?St[e]=!0:(xt[e]=!0,!1)}function wt(e,t,n){if(Ct(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}function Tt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Et(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Dt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Ot(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function kt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function At(e){if(!e._valueTracker){var t=Ot(e)?`checked`:`value`;e._valueTracker=kt(e,t,``+e[t])}}function jt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Ot(e)?e.checked?`true`:`false`:e.value),e=r,e===n?!1:(t.setValue(e),!0)}function Mt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Nt=/[\n"\\]/g;function Pt(e){return e.replace(Nt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ft(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Dt(t)):e.value!==``+Dt(t)&&(e.value=``+Dt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Lt(e,o,Dt(n)):Lt(e,o,Dt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Dt(s):e.removeAttribute(`name`)}function It(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){At(e);return}n=n==null?``:``+Dt(n),t=t==null?n:``+Dt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),At(e)}function Lt(e,t,n){t===`number`&&Mt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Rt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Dt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function zt(e,t,n){if(t!=null&&(t=``+Dt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Dt(n)}function Bt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(F(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Dt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),At(e)}function Vt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ht=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Ut(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ht.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Wt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Ut(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Ut(e,o,t[o])}function Gt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var Kt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),qt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Jt(e){return qt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Yt(){}var Xt=null;function Zt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qt=null,$t=null;function en(e){var t=ft(e);if(t&&(e=t.stateNode)){var n=e[rt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ft(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Pt(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[rt]||null;if(!a)throw Error(i(90));Ft(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&jt(r)}break a;case`textarea`:zt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Rt(e,!!n.multiple,t,!1)}}}var tn=!1;function nn(e,t,n){if(tn)return e(t,n);tn=!0;try{return e(t)}finally{if(tn=!1,(Qt!==null||$t!==null)&&(Tu(),Qt&&(t=Qt,e=$t,$t=Qt=null,en(t),e)))for(t=0;t<e.length;t++)en(e[t])}}function rn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[rt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=!(e===`button`||e===`input`||e===`select`||e===`textarea`)),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var an=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),on=!1;if(an)try{var sn={};Object.defineProperty(sn,"passive",{get:function(){on=!0}}),window.addEventListener(`test`,sn,sn),window.removeEventListener(`test`,sn,sn)}catch{on=!1}var cn=null,ln=null,un=null;function dn(){if(un)return un;var e,t=ln,n=t.length,r,i=`value`in cn?cn.value:cn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return un=i.slice(e,1<r?1-r:void 0)}function fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function pn(){return!0}function mn(){return!1}function hn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?pn:mn,this.isPropagationStopped=mn,this}return m(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=pn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=pn)},persist:function(){},isPersistent:pn}),t}var gn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},_n=hn(gn),vn=m({},gn,{view:0,detail:0}),yn=hn(vn),bn,xn,Sn,Cn=m({},vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Sn&&(Sn&&e.type===`mousemove`?(bn=e.screenX-Sn.screenX,xn=e.screenY-Sn.screenY):xn=bn=0,Sn=e),bn)},movementY:function(e){return`movementY`in e?e.movementY:xn}}),wn=hn(Cn),Tn=hn(m({},Cn,{dataTransfer:0})),En=hn(m({},vn,{relatedTarget:0})),Dn=hn(m({},gn,{animationName:0,elapsedTime:0,pseudoElement:0})),On=hn(m({},gn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),kn=hn(m({},gn,{data:0})),An={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},jn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Mn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Nn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Mn[e])?!!t[e]:!1}function Pn(){return Nn}var Fn=hn(m({},vn,{key:function(e){if(e.key){var t=An[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?jn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pn,charCode:function(e){return e.type===`keypress`?fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),In=hn(m({},Cn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Ln=hn(m({},vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pn})),Rn=hn(m({},gn,{propertyName:0,elapsedTime:0,pseudoElement:0})),zn=hn(m({},Cn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Bn=hn(m({},gn,{newState:0,oldState:0})),Vn=[9,13,27,32],Hn=an&&`CompositionEvent`in window,Un=null;an&&`documentMode`in document&&(Un=document.documentMode);var Wn=an&&`TextEvent`in window&&!Un,Gn=an&&(!Hn||Un&&8<Un&&11>=Un),Kn=` `,qn=!1;function Jn(e,t){switch(e){case`keyup`:return Vn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Yn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Xn=!1;function Zn(e,t){switch(e){case`compositionend`:return Yn(t);case`keypress`:return t.which===32?(qn=!0,Kn):null;case`textInput`:return e=t.data,e===Kn&&qn?null:e;default:return null}}function Qn(e,t){if(Xn)return e===`compositionend`||!Hn&&Jn(e,t)?(e=dn(),un=ln=cn=null,Xn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Gn&&t.locale!==`ko`?null:t.data;default:return null}}var $n={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function er(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!$n[e.type]:t===`textarea`}function tr(e,t,n,r){Qt?$t?$t.push(r):$t=[r]:Qt=r,t=Md(t,`onChange`),0<t.length&&(n=new _n(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var nr=null,U=null;function rr(e){wd(e,0)}function ir(e){if(jt(pt(e)))return e}function ar(e,t){if(e===`change`)return t}var or=!1;if(an){var sr;if(an){var cr=`oninput`in document;if(!cr){var lr=document.createElement(`div`);lr.setAttribute(`oninput`,`return;`),cr=typeof lr.oninput==`function`}sr=cr}else sr=!1;or=sr&&(!document.documentMode||9<document.documentMode)}function ur(){nr&&(nr.detachEvent(`onpropertychange`,dr),U=nr=null)}function dr(e){if(e.propertyName===`value`&&ir(U)){var t=[];tr(t,U,e,Zt(e)),nn(rr,t)}}function fr(e,t,n){e===`focusin`?(ur(),nr=t,U=n,nr.attachEvent(`onpropertychange`,dr)):e===`focusout`&&ur()}function pr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return ir(U)}function mr(e,t){if(e===`click`)return ir(t)}function hr(e,t){if(e===`input`||e===`change`)return ir(t)}function gr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var _r=typeof Object.is==`function`?Object.is:gr;function vr(e,t){if(_r(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ve.call(t,i)||!_r(e[i],t[i]))return!1}return!0}function yr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function br(e,t){var n=yr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=yr(n)}}function xr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Sr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Mt(e.document)}return t}function Cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var wr=an&&`documentMode`in document&&11>=document.documentMode,Tr=null,Er=null,Dr=null,Or=!1;function kr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Or||Tr==null||Tr!==Mt(r)||(r=Tr,`selectionStart`in r&&Cr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Dr&&vr(Dr,r)||(Dr=r,r=Md(Er,`onSelect`),0<r.length&&(t=new _n(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Tr)))}function Ar(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var jr={animationend:Ar(`Animation`,`AnimationEnd`),animationiteration:Ar(`Animation`,`AnimationIteration`),animationstart:Ar(`Animation`,`AnimationStart`),transitionrun:Ar(`Transition`,`TransitionRun`),transitionstart:Ar(`Transition`,`TransitionStart`),transitioncancel:Ar(`Transition`,`TransitionCancel`),transitionend:Ar(`Transition`,`TransitionEnd`)},Mr={},Nr={};an&&(Nr=document.createElement(`div`).style,`AnimationEvent`in window||(delete jr.animationend.animation,delete jr.animationiteration.animation,delete jr.animationstart.animation),`TransitionEvent`in window||delete jr.transitionend.transition);function Pr(e){if(Mr[e])return Mr[e];if(!jr[e])return e;var t=jr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Nr)return Mr[e]=t[n];return e}var Fr=Pr(`animationend`),Ir=Pr(`animationiteration`),Lr=Pr(`animationstart`),Rr=Pr(`transitionrun`),zr=Pr(`transitionstart`),Br=Pr(`transitioncancel`),Vr=Pr(`transitionend`),Hr=new Map,Ur=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Ur.push(`scrollEnd`);function Wr(e,t){Hr.set(e,t),vt(t,[e])}var Gr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Kr=[],qr=0,Jr=0;function Yr(){for(var e=qr,t=Jr=qr=0;t<e;){var n=Kr[t];Kr[t++]=null;var r=Kr[t];Kr[t++]=null;var i=Kr[t];Kr[t++]=null;var a=Kr[t];if(Kr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&$r(n,i,a)}}function Xr(e,t,n,r){Kr[qr++]=e,Kr[qr++]=t,Kr[qr++]=n,Kr[qr++]=r,Jr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Zr(e,t,n,r){return Xr(e,t,n,r),ei(e)}function Qr(e,t){return Xr(e,null,null,t),ei(e)}function $r(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ne(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ei(e){if(50<gu)throw gu=0,_u=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ti={};function ni(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(e,t,n,r){return new ni(e,t,n,r)}function ii(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ai(e,t){var n=e.alternate;return n===null?(n=ri(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function oi(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function si(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)ii(e)&&(s=1);else if(typeof e==`string`)s=Yf(e,n,ie.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ri(31,n,t,a),e.elementType=k,e.lanes=o,e;case y:return ci(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ri(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ri(13,n,t,a),e.elementType=T,e.lanes=o,e;case E:return e=ri(19,n,t,a),e.elementType=E,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ri(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function ci(e,t,n,r){return e=ri(7,e,r,t),e.lanes=n,e}function li(e,t,n){return e=ri(6,e,null,t),e.lanes=n,e}function ui(e){var t=ri(18,null,null,0);return t.stateNode=e,t}function di(e,t,n){return t=ri(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var fi=new WeakMap;function pi(e,t){if(typeof e==`object`&&e){var n=fi.get(e);return n===void 0?(t={value:e,source:t,stack:_e(t)},fi.set(e,t),t):n}return{value:e,source:t,stack:_e(t)}}var mi=[],hi=0,gi=null,_i=0,vi=[],yi=0,bi=null,xi=1,Si=``;function Ci(e,t){mi[hi++]=_i,mi[hi++]=gi,gi=e,_i=t}function wi(e,t,n){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,bi=e;var r=xi;e=Si;var i=32-Ne(r)-1;r&=~(1<<i),n+=1;var a=32-Ne(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xi=1<<32-Ne(t)+i|n<<i|r,Si=a+e}else xi=1<<a|n<<i|r,Si=e}function Ti(e){e.return!==null&&(Ci(e,1),wi(e,1,0))}function Ei(e){for(;e===gi;)gi=mi[--hi],mi[hi]=null,_i=mi[--hi],mi[hi]=null;for(;e===bi;)bi=vi[--yi],vi[yi]=null,Si=vi[--yi],vi[yi]=null,xi=vi[--yi],vi[yi]=null}function Di(e,t){vi[yi++]=xi,vi[yi++]=Si,vi[yi++]=bi,xi=t.id,Si=t.overflow,bi=e}var Oi=null,ki=null,Ai=!1,ji=null,Mi=!1,Ni=Error(i(519));function Pi(e){throw Bi(pi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Ni}function Fi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[nt]=e,t[rt]=r,n){case`dialog`:Td(`cancel`,t),Td(`close`,t);break;case`iframe`:case`object`:case`embed`:Td(`load`,t);break;case`video`:case`audio`:for(n=0;n<Sd.length;n++)Td(Sd[n],t);break;case`source`:Td(`error`,t);break;case`img`:case`image`:case`link`:Td(`error`,t),Td(`load`,t);break;case`details`:Td(`toggle`,t);break;case`input`:Td(`invalid`,t),It(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Td(`invalid`,t);break;case`textarea`:Td(`invalid`,t),Bt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Rd(t.textContent,n)?(r.popover!=null&&(Td(`beforetoggle`,t),Td(`toggle`,t)),r.onScroll!=null&&Td(`scroll`,t),r.onScrollEnd!=null&&Td(`scrollend`,t),r.onClick!=null&&(t.onclick=Yt),t=!0):t=!1,t||Pi(e,!0)}function Ii(e){for(Oi=e.return;Oi;)switch(Oi.tag){case 5:case 31:case 13:Mi=!1;return;case 27:case 3:Mi=!0;return;default:Oi=Oi.return}}function Li(e){if(e!==Oi)return!1;if(!Ai)return Ii(e),Ai=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!==`form`&&n!==`button`)||Yd(e.type,e.memoizedProps)),n=!n),n&&ki&&Pi(e),Ii(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=gf(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));ki=gf(e)}else t===27?(t=ki,rf(e.type)?(e=hf,hf=null,ki=e):ki=t):ki=Oi?mf(e.stateNode.nextSibling):null;return!0}function Ri(){ki=Oi=null,Ai=!1}function zi(){var e=ji;return e!==null&&(nu===null?nu=e:nu.push.apply(nu,e),ji=null),e}function Bi(e){ji===null?ji=[e]:ji.push(e)}var Vi=ne(null),Hi=null,Ui=null;function Wi(e,t,n){z(Vi,t._currentValue),t._currentValue=n}function Gi(e){e._currentValue=Vi.current,re(Vi)}function Ki(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function qi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Ki(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Ki(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Ji(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;_r(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===se.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[ip]:e.push(ip))}a=a.return}e!==null&&qi(t,e,n,r),t.flags|=262144}function Yi(e){for(e=e.firstContext;e!==null;){if(!_r(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Xi(e){Hi=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Zi(e){return $i(Hi,e)}function Qi(e,t){return Hi===null&&Xi(e),$i(e,t)}function $i(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Ui===null){if(e===null)throw Error(i(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return n}var ea=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ta=t.unstable_scheduleCallback,na=t.unstable_NormalPriority,ra={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ia(){return{controller:new ea,data:new Map,refCount:0}}function aa(e){e.refCount--,e.refCount===0&&ta(na,function(){e.controller.abort()})}var oa=null,sa=0,ca=0,la=null;function ua(e,t){if(oa===null){var n=oa=[];sa=0,ca=_d(),la={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return sa++,t.then(da,da),t}function da(){if(--sa===0&&oa!==null){la!==null&&(la.status=`fulfilled`);var e=oa;oa=null,ca=0,la=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function fa(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var pa=I.S;I.S=function(e,t){au=xe(),typeof t==`object`&&t&&typeof t.then==`function`&&ua(e,t),pa!==null&&pa(e,t)};var ma=ne(null);function ha(){var e=ma.current;return e===null?Bl.pooledCache:e}function ga(e,t){t===null?z(ma,ma.current):z(ma,t.pool)}function _a(){var e=ha();return e===null?null:{parent:ra._currentValue,pool:e}}var va=Error(i(460)),ya=Error(i(474)),ba=Error(i(542)),xa={then:function(){}};function Sa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ca(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Yt,Yt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e;default:if(typeof t.status==`string`)t.then(Yt,Yt);else{if(e=Bl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,Da(e),e}throw Ta=t,va}}function wa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Ta=e,va):e}}var Ta=null;function Ea(){if(Ta===null)throw Error(i(459));var e=Ta;return Ta=null,e}function Da(e){if(e===va||e===ba)throw Error(i(483))}var Oa=null,ka=0;function Aa(e){var t=ka;return ka+=1,Oa===null&&(Oa=[]),Ca(Oa,e,t)}function ja(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ma(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Na(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=ai(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=li(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===O&&wa(i)===t.type)?(t=a(t,n.props),ja(t,n),t.return=e,t):(t=si(n.type,n.key,n.props,null,e.mode,r),ja(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=di(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=ci(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=li(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=si(t.type,t.key,t.props,null,e.mode,n),ja(n,t),n.return=e,n;case v:return t=di(t,e.mode,n),t.return=e,t;case O:return t=wa(t),f(e,t,n)}if(F(t)||M(t))return t=ci(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Aa(t),n);if(t.$$typeof===C)return f(e,Qi(e,t),n);Ma(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=wa(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Aa(n),r);if(n.$$typeof===C)return p(e,t,Qi(e,n),r);Ma(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=wa(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Aa(r),i);if(r.$$typeof===C)return m(e,t,n,Qi(t,r),i);Ma(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Ai&&Ci(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return Ai&&Ci(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Ai&&Ci(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Ai&&Ci(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Ai&&Ci(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Ai&&Ci(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&wa(l)===r.type){n(e,r.sibling),c=a(r,o.props),ja(c,o),c.return=e,e=c;break a}n(e,r);break}else t(e,r);r=r.sibling}o.type===y?(c=ci(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=si(o.type,o.key,o.props,null,e.mode,c),ja(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l)if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}else{n(e,r);break}else t(e,r);r=r.sibling}c=di(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=wa(o),b(e,r,o,c)}if(F(o))return h(e,r,o,c);if(M(o)){if(l=M(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Aa(o),c);if(o.$$typeof===C)return b(e,r,Qi(e,o),c);Ma(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=li(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ka=0;var i=b(e,t,n,r);return Oa=null,i}catch(t){if(t===va||t===ba)throw t;var a=ri(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Pa=Na(!0),Fa=Na(!1),Ia=!1;function La(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ra(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function za(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ba(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ei(e),$r(e,null,n),t}return Xr(e,r,t,n),ei(e)}function Va(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}function Ha(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ua=!1;function Wa(){if(Ua){var e=la;if(e!==null)throw e}}function Ga(e,t,n,r){Ua=!1;var i=e.updateQueue;Ia=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Hl&f)===f:(r&f)===f){f!==0&&f===ca&&(Ua=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=m({},d,f);break a;case 2:Ia=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Xl|=o,e.lanes=o,e.memoizedState=d}}function Ka(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function qa(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ka(n[e],t)}var Ja=ne(null),Ya=ne(0);function Xa(e,t){e=Jl,z(Ya,e),z(Ja,t),Jl=e|t.baseLanes}function Za(){z(Ya,Jl),z(Ja,Ja.current)}function Qa(){Jl=Ya.current,re(Ja),re(Ya)}var $a=ne(null),eo=null;function to(e){var t=e.alternate;z(oo,oo.current&1),z($a,e),eo===null&&(t===null||Ja.current!==null||t.memoizedState!==null)&&(eo=e)}function no(e){z(oo,oo.current),z($a,e),eo===null&&(eo=e)}function ro(e){e.tag===22?(z(oo,oo.current),z($a,e),eo===null&&(eo=e)):io(e)}function io(){z(oo,oo.current),z($a,$a.current)}function ao(e){re($a),eo===e&&(eo=null),re(oo)}var oo=ne(0);function so(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||df(n)||ff(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var co=0,lo=null,uo=null,fo=null,po=!1,mo=!1,ho=!1,go=0,_o=0,vo=null,yo=0;function bo(){throw Error(i(321))}function xo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!_r(e[n],t[n]))return!1;return!0}function So(e,t,n,r,i,a){return co=a,lo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Ls:Rs,ho=!1,a=n(r,i),ho=!1,mo&&(a=W(t,n,r,i)),Co(e),a}function Co(e){I.H=Is;var t=uo!==null&&uo.next!==null;if(co=0,fo=uo=lo=null,po=!1,_o=0,vo=null,t)throw Error(i(300));e===null||tc||(e=e.dependencies,e!==null&&Yi(e)&&(tc=!0))}function W(e,t,n,r){lo=e;var a=0;do{if(mo&&(vo=null),_o=0,mo=!1,25<=a)throw Error(i(301));if(a+=1,fo=uo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}I.H=zs,o=t(n,r)}while(mo);return o}function wo(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?jo(t):t,e=e.useState()[0],(uo===null?null:uo.memoizedState)!==e&&(lo.flags|=1024),t}function To(){var e=go!==0;return go=0,e}function Eo(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Do(e){if(po){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}po=!1}co=0,fo=uo=lo=null,mo=!1,_o=go=0,vo=null}function Oo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fo===null?lo.memoizedState=fo=e:fo=fo.next=e,fo}function ko(){if(uo===null){var e=lo.alternate;e=e===null?null:e.memoizedState}else e=uo.next;var t=fo===null?lo.memoizedState:fo.next;if(t!==null)fo=t,uo=e;else{if(e===null)throw lo.alternate===null?Error(i(467)):Error(i(310));uo=e,e={memoizedState:uo.memoizedState,baseState:uo.baseState,baseQueue:uo.baseQueue,queue:uo.queue,next:null},fo===null?lo.memoizedState=fo=e:fo=fo.next=e}return fo}function Ao(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function jo(e){var t=_o;return _o+=1,vo===null&&(vo=[]),e=Ca(vo,e,t),t=lo,(fo===null?t.memoizedState:fo.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Ls:Rs),e}function Mo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return jo(e);if(e.$$typeof===C)return Zi(e)}throw Error(i(438,String(e)))}function No(e){var t=null,n=lo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=lo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Ao(),lo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Po(e,t){return typeof t==`function`?t(e):t}function Fo(e){return Io(ko(),uo,e)}function Io(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(co&f)===f:(Hl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ca&&(d=!0);else if((co&p)===p){u=u.next,p===ca&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,lo.lanes|=p,Xl|=p;f=u.action,ho&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,lo.lanes|=f,Xl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!_r(o,e.memoizedState)&&(tc=!0,d&&(n=la,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Lo(e){var t=ko(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);_r(o,t.memoizedState)||(tc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ro(e,t,n){var r=lo,a=ko(),o=Ai;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!_r((uo||a).memoizedState,n);if(s&&(a.memoizedState=n,tc=!0),a=a.queue,cs(Vo.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||fo!==null&&fo.memoizedState.tag&1){if(r.flags|=2048,rs(9,{destroy:void 0},Bo.bind(null,r,a,n,t),null),Bl===null)throw Error(i(349));o||co&127||zo(r,t,n)}return n}function zo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=lo.updateQueue,t===null?(t=Ao(),lo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Bo(e,t,n,r){t.value=n,t.getSnapshot=r,Ho(t)&&Uo(e)}function Vo(e,t,n){return n(function(){Ho(t)&&Uo(e)})}function Ho(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!_r(e,n)}catch{return!0}}function Uo(e){var t=Qr(e,2);t!==null&&bu(t,e,2)}function Wo(e){var t=Oo();if(typeof e==`function`){var n=e;if(e=n(),ho){Me(!0);try{n()}finally{Me(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:e},t}function Go(e,t,n,r){return e.baseState=n,Io(e,uo,typeof r==`function`?r:Po)}function Ko(e,t,n,r,a){if(Ns(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};I.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,qo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function qo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Jo(e,t,s)}catch(n){Xo(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Jo(e,t,a)}catch(n){Xo(e,t,n)}}function Jo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Yo(e,t,n)},function(n){return Xo(e,t,n)}):Yo(e,t,n)}function Yo(e,t,n){t.status=`fulfilled`,t.value=n,Zo(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,qo(e,n)))}function Xo(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Zo(t),t=t.next;while(t!==r)}e.action=null}function Zo(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Qo(e,t){return t}function $o(e,t){if(Ai){var n=Bl.formState;if(n!==null){a:{var r=lo;if(Ai){if(ki){b:{for(var i=ki,a=Mi;i.nodeType!==8;){if(!a){i=null;break b}if(i=mf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ki=mf(i.nextSibling),r=i.data===`F!`;break a}}Pi(r)}r=!1}r&&(t=n[0])}}return n=Oo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qo,lastRenderedState:t},n.queue=r,n=As.bind(null,lo,r),r.dispatch=n,r=Wo(!1),a=Ms.bind(null,lo,!1,r.queue),r=Oo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ko.bind(null,lo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function es(e){return ts(ko(),uo,e)}function ts(e,t,n){if(t=Io(e,t,Qo)[0],e=Fo(Po)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=jo(t)}catch(e){throw e===va?ba:e}else r=t;t=ko();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(lo.flags|=2048,rs(9,{destroy:void 0},ns.bind(null,i,n),null)),[r,a,e]}function ns(e,t){e.action=t}function G(e){var t=ko(),n=uo;if(n!==null)return ts(t,n,e);ko(),t=t.memoizedState,n=ko();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function rs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=lo.updateQueue,t===null&&(t=Ao(),lo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function is(){return ko().memoizedState}function as(e,t,n,r){var i=Oo();lo.flags|=e,i.memoizedState=rs(1|t,{destroy:void 0},n,r===void 0?null:r)}function os(e,t,n,r){var i=ko();r=r===void 0?null:r;var a=i.memoizedState.inst;uo!==null&&r!==null&&xo(r,uo.memoizedState.deps)?i.memoizedState=rs(t,a,n,r):(lo.flags|=e,i.memoizedState=rs(1|t,a,n,r))}function ss(e,t){as(8390656,8,e,t)}function cs(e,t){os(2048,8,e,t)}function ls(e){lo.flags|=4;var t=lo.updateQueue;if(t===null)t=Ao(),lo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function us(e){var t=ko().memoizedState;return ls({ref:t,nextImpl:e}),function(){if(zl&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function ds(e,t){return os(4,2,e,t)}function fs(e,t){return os(4,4,e,t)}function ps(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ms(e,t,n){n=n==null?null:n.concat([e]),os(4,4,ps.bind(null,t,e),n)}function hs(){}function gs(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&xo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function _s(e,t){var n=ko();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&xo(t,r[1]))return r[0];if(r=e(),ho){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r}function vs(e,t,n){return n===void 0||co&1073741824&&!(Hl&261930)?e.memoizedState=t:(e.memoizedState=n,e=yu(),lo.lanes|=e,Xl|=e,n)}function ys(e,t,n,r){return _r(n,t)?n:Ja.current===null?!(co&42)||co&1073741824&&!(Hl&261930)?(tc=!0,e.memoizedState=n):(e=yu(),lo.lanes|=e,Xl|=e,t):(e=vs(e,n,r),_r(e,t)||(tc=!0),e)}function bs(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,Ms(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?js(e,t,fa(c,r),vu(e)):js(e,t,r,vu(e))}catch(n){js(e,t,{then:function(){},status:`rejected`,reason:n},vu())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function xs(){}function Ss(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Cs(e).queue;bs(e,a,t,R,n===null?xs:function(){return ws(e),n(r)})}function Cs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:R,baseState:R,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:R},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Po,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ws(e){var t=Cs(e);t.next===null&&(t=e.alternate.memoizedState),js(e,t.next.queue,{},vu())}function Ts(){return Zi(ip)}function Es(){return ko().memoizedState}function Ds(){return ko().memoizedState}function Os(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=vu();e=za(n);var r=Ba(t,e,n);r!==null&&(bu(r,t,n),Va(r,t,n)),t={cache:ia()},e.payload=t;return}t=t.return}}function ks(e,t,n){var r=vu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ns(e)?Ps(t,n):(n=Zr(e,t,n,r),n!==null&&(bu(n,e,r),Fs(n,t,r)))}function As(e,t,n){js(e,t,n,vu())}function js(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ns(e))Ps(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,_r(s,o))return Xr(e,t,i,0),Bl===null&&Yr(),!1}catch{}if(n=Zr(e,t,i,r),n!==null)return bu(n,e,r),Fs(n,t,r),!0}return!1}function Ms(e,t,n,r){if(r={lane:2,revertLane:_d(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ns(e)){if(t)throw Error(i(479))}else t=Zr(e,n,r,2),t!==null&&bu(t,e,2)}function Ns(e){var t=e.alternate;return e===lo||t!==null&&t===lo}function Ps(e,t){mo=po=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Fs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ye(e,n)}}var Is={readContext:Zi,use:Mo,useCallback:bo,useContext:bo,useEffect:bo,useImperativeHandle:bo,useLayoutEffect:bo,useInsertionEffect:bo,useMemo:bo,useReducer:bo,useRef:bo,useState:bo,useDebugValue:bo,useDeferredValue:bo,useTransition:bo,useSyncExternalStore:bo,useId:bo,useHostTransitionStatus:bo,useFormState:bo,useActionState:bo,useOptimistic:bo,useMemoCache:bo,useCacheRefresh:bo};Is.useEffectEvent=bo;var Ls={readContext:Zi,use:Mo,useCallback:function(e,t){return Oo().memoizedState=[e,t===void 0?null:t],e},useContext:Zi,useEffect:ss,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),as(4194308,4,ps.bind(null,t,e),n)},useLayoutEffect:function(e,t){return as(4194308,4,e,t)},useInsertionEffect:function(e,t){as(4,2,e,t)},useMemo:function(e,t){var n=Oo();t=t===void 0?null:t;var r=e();if(ho){Me(!0);try{e()}finally{Me(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Oo();if(n!==void 0){var i=n(t);if(ho){Me(!0);try{n(t)}finally{Me(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=ks.bind(null,lo,e),[r.memoizedState,e]},useRef:function(e){var t=Oo();return e={current:e},t.memoizedState=e},useState:function(e){e=Wo(e);var t=e.queue,n=As.bind(null,lo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:hs,useDeferredValue:function(e,t){return vs(Oo(),e,t)},useTransition:function(){var e=Wo(!1);return e=bs.bind(null,lo,e.queue,!0,!1),Oo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=lo,a=Oo();if(Ai){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Bl===null)throw Error(i(349));Hl&127||zo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ss(Vo.bind(null,r,o,e),[e]),r.flags|=2048,rs(9,{destroy:void 0},Bo.bind(null,r,o,n,t),null),n},useId:function(){var e=Oo(),t=Bl.identifierPrefix;if(Ai){var n=Si,r=xi;n=(r&~(1<<32-Ne(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=go++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=yo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:Ts,useFormState:$o,useActionState:$o,useOptimistic:function(e){var t=Oo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ms.bind(null,lo,!0,n),n.dispatch=t,[e,t]},useMemoCache:No,useCacheRefresh:function(){return Oo().memoizedState=Os.bind(null,lo)},useEffectEvent:function(e){var t=Oo(),n={impl:e};return t.memoizedState=n,function(){if(zl&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Rs={readContext:Zi,use:Mo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Fo,useRef:is,useState:function(){return Fo(Po)},useDebugValue:hs,useDeferredValue:function(e,t){return ys(ko(),uo.memoizedState,e,t)},useTransition:function(){var e=Fo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Es,useHostTransitionStatus:Ts,useFormState:es,useActionState:es,useOptimistic:function(e,t){return Go(ko(),uo,e,t)},useMemoCache:No,useCacheRefresh:Ds};Rs.useEffectEvent=us;var zs={readContext:Zi,use:Mo,useCallback:gs,useContext:Zi,useEffect:cs,useImperativeHandle:ms,useInsertionEffect:ds,useLayoutEffect:fs,useMemo:_s,useReducer:Lo,useRef:is,useState:function(){return Lo(Po)},useDebugValue:hs,useDeferredValue:function(e,t){var n=ko();return uo===null?vs(n,e,t):ys(n,uo.memoizedState,e,t)},useTransition:function(){var e=Lo(Po)[0],t=ko().memoizedState;return[typeof e==`boolean`?e:jo(e),t]},useSyncExternalStore:Ro,useId:Es,useHostTransitionStatus:Ts,useFormState:G,useActionState:G,useOptimistic:function(e,t){var n=ko();return uo===null?(n.baseState=e,[e,n.queue.dispatch]):Go(n,uo,e,t)},useMemoCache:No,useCacheRefresh:Ds};zs.useEffectEvent=us;function Bs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:m({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Vs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=vu(),i=za(r);i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(bu(t,e,r),Va(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=vu(),i=za(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ba(e,i,r),t!==null&&(bu(t,e,r),Va(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=vu(),r=za(n);r.tag=2,t!=null&&(r.callback=t),t=Ba(e,r,n),t!==null&&(bu(t,e,n),Va(t,e,n))}};function Hs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!vr(n,r)||!vr(i,a):!0}function Us(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Vs.enqueueReplaceState(t,t.state,null)}function Ws(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=m({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Gs(e){Gr(e)}function Ks(e){console.error(e)}function qs(e){Gr(e)}function Js(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Ys(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Xs(e,t,n){return n=za(n),n.tag=3,n.payload={element:null},n.callback=function(){Js(e,t)},n}function Zs(e){return e=za(e),e.tag=3,e}function Qs(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Ys(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Ys(t,n,r),typeof i!=`function`&&(cu===null?cu=new Set([this]):cu.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function $s(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ji(t,n,a,!0),n=$a.current,n!==null){switch(n.tag){case 31:case 13:return eo===null?Mu():n.alternate===null&&Yl===0&&(Yl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Zu(e,r,a)),!1;case 22:return n.flags|=65536,r===xa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Zu(e,r,a)),!1}throw Error(i(435,n.tag))}return Zu(e,r,a),Mu(),!1}if(Ai)return t=$a.current,t===null?(r!==Ni&&(t=Error(i(423),{cause:r}),Bi(pi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=pi(r,n),a=Xs(e.stateNode,r,a),Ha(e,a),Yl!==4&&(Yl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Ni&&(e=Error(i(422),{cause:r}),Bi(pi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=pi(o,n),tu===null?tu=[o]:tu.push(o),Yl!==4&&(Yl=2),t===null)return!0;r=pi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Xs(n.stateNode,r,e),Ha(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(cu===null||!cu.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=Zs(a),Qs(a,e,n,r),Ha(n,a),!1}n=n.return}while(n!==null);return!1}var ec=Error(i(461)),tc=!1;function nc(e,t,n,r){t.child=e===null?Fa(t,null,n,r):Pa(t,e.child,n,r)}function rc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Xi(t),r=So(e,t,n,o,a,i),s=To(),e!==null&&!tc?(Eo(e,t,i),Dc(e,t,i)):(Ai&&s&&Ti(t),t.flags|=1,nc(e,t,r,i),t.child)}function ic(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!ii(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,ac(e,t,a,r,i)):(e=si(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Oc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?vr:n,n(o,r)&&e.ref===t.ref)return Dc(e,t,i)}return t.flags|=1,e=ai(a,r),e.ref=t.ref,e.return=t,t.child=e}function ac(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(vr(a,r)&&e.ref===t.ref)if(tc=!1,t.pendingProps=r=a,Oc(e,i))e.flags&131072&&(tc=!0);else return t.lanes=e.lanes,Dc(e,t,i)}return pc(e,t,n,r,i)}function oc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return cc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ga(t,a===null?null:a.cachePool),a===null?Za():Xa(t,a),ro(t);else return r=t.lanes=536870912,cc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ga(t,null),Za(),io(t)):(ga(t,a.cachePool),Xa(t,a),io(t),t.memoizedState=null);return nc(e,t,i,n),t.child}function sc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function cc(e,t,n,r,i){var a=ha();return a=a===null?null:{parent:ra._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ga(t,null),Za(),ro(t),e!==null&&Ji(e,t,r,!0),t.childLanes=i,null}function lc(e,t){return t=Sc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function uc(e,t,n){return Pa(t,e.child,null,n),e=lc(t,t.pendingProps),e.flags|=2,ao(t),t.memoizedState=null,e}function dc(e,t,n){var r=t.pendingProps,a=(t.flags&128)!=0;if(t.flags&=-129,e===null){if(Ai){if(r.mode===`hidden`)return e=lc(t,r),t.lanes=536870912,sc(null,e);if(no(t),(e=ki)?(e=uf(e,Mi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return t.lanes=536870912,null}return lc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(no(t),a)if(t.flags&256)t.flags&=-257,t=uc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558));else if(tc||Ji(e,t,n,!1),a=(n&e.childLanes)!==0,tc||a){if(r=Bl,r!==null&&(s=Xe(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Qr(e,s),bu(r,e,s),ec;Mu(),t=uc(e,t,n)}else e=o.treeContext,ki=mf(s.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=lc(t,r),t.flags|=4096;return t}return e=ai(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function fc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function pc(e,t,n,r,i){return Xi(t),n=So(e,t,n,r,void 0,i),r=To(),e!==null&&!tc?(Eo(e,t,i),Dc(e,t,i)):(Ai&&r&&Ti(t),t.flags|=1,nc(e,t,n,i),t.child)}function mc(e,t,n,r,i,a){return Xi(t),t.updateQueue=null,n=W(t,r,n,i),Co(e),r=To(),e!==null&&!tc?(Eo(e,t,a),Dc(e,t,a)):(Ai&&r&&Ti(t),t.flags|=1,nc(e,t,n,a),t.child)}function hc(e,t,n,r,i){if(Xi(t),t.stateNode===null){var a=ti,o=n.contextType;typeof o==`object`&&o&&(a=Zi(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Vs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},La(t),o=n.contextType,a.context=typeof o==`object`&&o?Zi(o):ti,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Bs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Vs.enqueueReplaceState(a,a.state,null),Ga(t,r,a,i),Wa(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ws(n,s);a.props=c;var l=a.context,u=n.contextType;o=ti,typeof u==`object`&&u&&(o=Zi(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Us(t,a,r,o),Ia=!1;var f=t.memoizedState;a.state=f,Ga(t,r,a,i),Wa(),l=t.memoizedState,s||f!==l||Ia?(typeof d==`function`&&(Bs(t,n,d,r),l=t.memoizedState),(c=Ia||Hs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ra(e,t),o=t.memoizedProps,u=Ws(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ti,typeof l==`object`&&l&&(c=Zi(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Us(t,a,r,c),Ia=!1,f=t.memoizedState,a.state=f,Ga(t,r,a,i),Wa();var p=t.memoizedState;o!==d||f!==p||Ia||e!==null&&e.dependencies!==null&&Yi(e.dependencies)?(typeof s==`function`&&(Bs(t,n,s,r),p=t.memoizedState),(u=Ia||Hs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Yi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,fc(e,t),r=(t.flags&128)!=0,a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):nc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Dc(e,t,i),e}function gc(e,t,n,r){return Ri(),t.flags|=256,nc(e,t,n,r),t.child}var _c={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vc(e){return{baseLanes:e,cachePool:_a()}}function yc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=$l),e}function bc(e,t,n){var r=t.pendingProps,a=!1,o=(t.flags&128)!=0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(oo.current&2)!=0),s&&(a=!0,t.flags&=-129),s=(t.flags&32)!=0,t.flags&=-33,e===null){if(Ai){if(a?to(t):io(t),(e=ki)?(e=uf(e,Mi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:bi===null?null:{id:xi,overflow:Si},retryLane:536870912,hydrationErrors:null},n=ui(e),n.return=t,t.child=n,Oi=t,ki=null)):e=null,e===null)throw Pi(t);return ff(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(io(t),a=t.mode,c=Sc({mode:`hidden`,children:c},a),r=ci(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(null,r)):(to(t),xc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(to(t),t.flags&=-257,t=Cc(e,t,n)):t.memoizedState===null?(io(t),c=r.fallback,a=t.mode,r=Sc({mode:`visible`,children:r.children},a),c=ci(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Pa(t,e.child,null,n),r=t.child,r.memoizedState=vc(n),r.childLanes=yc(e,s,n),t.memoizedState=_c,t=sc(null,r)):(io(t),t.child=e.child,t.flags|=128,t=null);else if(to(t),ff(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Bi({value:r,source:null,stack:null}),t=Cc(e,t,n)}else if(tc||Ji(e,t,n,!1),s=(n&e.childLanes)!==0,tc||s){if(s=Bl,s!==null&&(r=Xe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,Qr(e,r),bu(s,e,r),ec;df(c)||Mu(),t=Cc(e,t,n)}else df(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ki=mf(c.nextSibling),Oi=t,Ai=!0,ji=null,Mi=!1,e!==null&&Di(t,e),t=xc(t,r.children),t.flags|=4096);return t}return a?(io(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=ai(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ci(c,a,n,null),c.flags|=2):c=ai(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,sc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=vc(n):(a=c.cachePool,a===null?a=_a():(l=ra._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=yc(e,s,n),t.memoizedState=_c,sc(e.child,r)):(to(t),n=e.child,e=n.sibling,n=ai(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function xc(e,t){return t=Sc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Sc(e,t){return e=ri(22,e,null,t),e.lanes=0,e}function Cc(e,t,n){return Pa(t,e.child,null,n),e=xc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function wc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ki(e.return,t,n)}function Tc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function Ec(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=oo.current,s=(o&2)!=0;if(s?(o=o&1|2,t.flags|=128):o&=1,z(oo,o),nc(e,t,r,n),r=Ai?_i:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&wc(e,n,t);else if(e.tag===19)wc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&so(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Tc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&so(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Tc(t,!0,n,null,a,r);break;case`together`:Tc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Dc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Xl|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(Ji(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=ai(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ai(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Oc(e,t){return(e.lanes&t)===0?(e=e.dependencies,!!(e!==null&&Yi(e))):!0}function kc(e,t,n){switch(t.tag){case 3:ce(t,t.stateNode.containerInfo),Wi(t,ra,e.memoizedState.cache),Ri();break;case 27:case 5:ue(t);break;case 4:ce(t,t.stateNode.containerInfo);break;case 10:Wi(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,no(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(to(t),e=Dc(e,t,n),e===null?null:e.sibling):bc(e,t,n):(to(t),t.flags|=128,null);to(t);break;case 19:var i=(e.flags&128)!=0;if(r=(n&t.childLanes)!==0,r||=(Ji(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return Ec(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),z(oo,oo.current),r)break;return null;case 22:return t.lanes=0,oc(e,t,n,t.pendingProps);case 24:Wi(t,ra,e.memoizedState.cache)}return Dc(e,t,n)}function Ac(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)tc=!0;else{if(!Oc(e,n)&&!(t.flags&128))return tc=!1,kc(e,t,n);tc=!!(e.flags&131072)}else tc=!1,Ai&&t.flags&1048576&&wi(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=wa(t.elementType),t.type=e,typeof e==`function`)ii(e)?(r=Ws(e,r),t.tag=1,t=hc(null,t,e,r,n)):(t.tag=0,t=pc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=rc(null,t,e,r,n);break a}else if(a===D){t.tag=14,t=ic(null,t,e,r,n);break a}}throw t=P(e)||e,Error(i(306,t,``))}}return t;case 0:return pc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ws(r,t.pendingProps),hc(e,t,r,a,n);case 3:a:{if(ce(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ra(e,t),Ga(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Wi(t,ra,r),r!==o.cache&&qi(t,[ra],n,!0),Wa(),r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=gc(e,t,r,n);break a}else if(r!==a){a=pi(Error(i(424)),t),Bi(a),t=gc(e,t,r,n);break a}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ki=mf(e.firstChild),Oi=t,Ai=!0,ji=null,Mi=!0,n=Fa(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Ri(),r===a){t=Dc(e,t,n);break a}nc(e,t,r,n)}t=t.child}return t;case 26:return fc(e,t),e===null?(n=Ff(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ai||(n=t.type,e=t.pendingProps,r=Kd(oe.current).createElement(n),r[nt]=t,r[rt]=e,Bd(r,n,e),ht(r),t.stateNode=r):t.memoizedState=Ff(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ue(t),e===null&&Ai&&(r=t.stateNode=vf(t.type,t.pendingProps,oe.current),Oi=t,Mi=!0,a=ki,rf(t.type)?(hf=a,ki=mf(r.firstChild)):ki=a),nc(e,t,t.pendingProps.children,n),fc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ai&&((a=r=ki)&&(r=cf(r,t.type,t.pendingProps,Mi),r===null?a=!1:(t.stateNode=r,Oi=t,ki=mf(r.firstChild),Mi=!1,a=!0)),a||Pi(t)),ue(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Yd(a,o)?r=null:s!==null&&Yd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=So(e,t,wo,null,null,n),ip._currentValue=a),fc(e,t),nc(e,t,r,n),t.child;case 6:return e===null&&Ai&&((e=n=ki)&&(n=lf(n,t.pendingProps,Mi),n===null?e=!1:(t.stateNode=n,Oi=t,ki=null,e=!0)),e||Pi(t)),null;case 13:return bc(e,t,n);case 4:return ce(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):nc(e,t,r,n),t.child;case 11:return rc(e,t,t.type,t.pendingProps,n);case 7:return nc(e,t,t.pendingProps,n),t.child;case 8:return nc(e,t,t.pendingProps.children,n),t.child;case 12:return nc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Wi(t,t.type,r.value),nc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,Xi(t),a=Zi(a),r=r(a),t.flags|=1,nc(e,t,r,n),t.child;case 14:return ic(e,t,t.type,t.pendingProps,n);case 15:return ac(e,t,t.type,t.pendingProps,n);case 19:return Ec(e,t,n);case 31:return dc(e,t,n);case 22:return oc(e,t,n,t.pendingProps);case 24:return Xi(t),r=Zi(ra),e===null?(a=ha(),a===null&&(a=Bl,o=ia(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},La(t),Wi(t,ra,a)):((e.lanes&n)!==0&&(Ra(e,t),Ga(t,null,null,n),Wa()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Wi(t,ra,r),r!==a.cache&&qi(t,[ra],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Wi(t,ra,r))),nc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function jc(e){e.flags|=4}function Mc(e,t,n,r,i){if((t=(e.mode&32)!=0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(ku())e.flags|=8192;else throw Ta=xa,ya}else e.flags&=-16777217}function Nc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Xf(t))if(ku())e.flags|=8192;else throw Ta=xa,ya}function Pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:We(),e.lanes|=t,eu|=t)}function Fc(e,t){if(!Ai)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ic(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Lc(e,t,n){var r=t.pendingProps;switch(Ei(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ic(t),null;case 1:return Ic(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Gi(ra),le(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Li(t)?jc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zi())),Ic(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(jc(t),o===null?(Ic(t),Mc(t,a,null,r,n)):(Ic(t),Nc(t,o))):o?o===e.memoizedState?(Ic(t),t.flags&=-16777217):(jc(t),Ic(t),Nc(t,o)):(e=e.memoizedProps,e!==r&&jc(t),Ic(t),Mc(t,a,e,r,n)),null;case 27:if(de(t),n=oe.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}e=ie.current,Li(t)?Fi(t,e):(e=vf(a,r,n),t.stateNode=e,jc(t))}return Ic(t),null;case 5:if(de(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Ic(t),null}if(o=ie.current,Li(t))Fi(t,o);else{var s=Kd(oe.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[nt]=t,o[rt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Bd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&jc(t)}}return Ic(t),Mc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&jc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=oe.current,Li(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Oi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Rd(e.nodeValue,n)),e||Pi(t,!0)}else e=Kd(e).createTextNode(r),e[nt]=t,t.stateNode=e}return Ic(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Li(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[nt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),e=!1}else n=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(ao(t),t):(ao(t),null);if(t.flags&128)throw Error(i(558))}return Ic(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Li(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[nt]=t}else Ri(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ic(t),a=!1}else a=zi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(ao(t),t):(ao(t),null)}return ao(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Pc(t,t.updateQueue),Ic(t),null);case 4:return le(),e===null&&Od(t.stateNode.containerInfo),Ic(t),null;case 10:return Gi(t.type),Ic(t),null;case 19:if(re(oo),r=t.memoizedState,r===null)return Ic(t),null;if(a=(t.flags&128)!=0,o=r.rendering,o===null)if(a)Fc(r,!1);else{if(Yl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=so(e),o!==null){for(t.flags|=128,Fc(r,!1),e=o.updateQueue,t.updateQueue=e,Pc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)oi(n,e),n=n.sibling;return z(oo,oo.current&1|2),Ai&&Ci(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&xe()>ou&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304)}else{if(!a)if(e=so(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Pc(t,e),Fc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Ai)return Ic(t),null}else 2*xe()-r.renderingStartTime>ou&&n!==536870912&&(t.flags|=128,a=!0,Fc(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Ic(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=xe(),e.sibling=null,n=oo.current,z(oo,a?n&1|2:n&1),Ai&&Ci(t,r.treeForkCount),e);case 22:case 23:return ao(t),Qa(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ic(t),t.subtreeFlags&6&&(t.flags|=8192)):Ic(t),n=t.updateQueue,n!==null&&Pc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&re(ma),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Gi(ra),Ic(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Rc(e,t){switch(Ei(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Gi(ra),le(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return de(t),null;case 31:if(t.memoizedState!==null){if(ao(t),t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ao(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ri()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return re(oo),null;case 4:return le(),null;case 10:return Gi(t.type),null;case 22:case 23:return ao(t),Qa(),e!==null&&re(ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Gi(ra),null;case 25:return null;default:return null}}function zc(e,t){switch(Ei(t),t.tag){case 3:Gi(ra),le();break;case 26:case 27:case 5:de(t);break;case 4:le();break;case 31:t.memoizedState!==null&&ao(t);break;case 13:ao(t);break;case 19:re(oo);break;case 10:Gi(t.type);break;case 22:case 23:ao(t),Qa(),e!==null&&re(ma);break;case 24:Gi(ra)}}function Bc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Xu(t,t.return,e)}}function Vc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Xu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Xu(t,t.return,e)}}function Hc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{qa(t,n)}catch(t){Xu(e,e.return,t)}}}function Uc(e,t,n){n.props=Ws(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Xu(e,t,n)}}function Wc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Xu(e,t,n)}}function Gc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null)if(typeof r==`function`)try{r()}catch(n){Xu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Xu(e,t,n)}else n.current=null}function Kc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Xu(e,e.return,t)}}function qc(e,t,n){try{var r=e.stateNode;Vd(r,e.type,n,t),r[rt]=t}catch(t){Xu(e,e.return,t)}}function Jc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&rf(e.type)||e.tag===4}function Yc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&rf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yt));else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Xc(e,t,n),e=e.sibling;e!==null;)Xc(e,t,n),e=e.sibling}function Zc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&rf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Zc(e,t,n),e=e.sibling;e!==null;)Zc(e,t,n),e=e.sibling}function Qc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Bd(t,r,n),t[nt]=e,t[rt]=n}catch(t){Xu(e,e.return,t)}}var $c=!1,el=!1,tl=!1,nl=typeof WeakSet==`function`?WeakSet:Set,rl=null;function il(e,t){if(e=e.containerInfo,Wd=pp,e=Sr(e),Cr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Gd={focusedElem:e,selectionRange:n},pp=!1,rl=t;rl!==null;)if(t=rl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,rl=e;else for(;rl!==null;){switch(t=rl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ws(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Xu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)sf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:sf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,rl=e;break}rl=t.return}}function al(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Bc(5,n);break;case 1:if(bl(e,n),r&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Xu(n,n.return,e)}else{var i=Ws(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Xu(n,n.return,e)}}r&64&&Hc(n),r&512&&Wc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{qa(e,t)}catch(e){Xu(n,n.return,e)}}break;case 27:t===null&&r&4&&Qc(n);case 26:case 5:bl(e,n),t===null&&r&4&&Kc(n),r&512&&Wc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=ed.bind(null,n),pf(e,n))));break;case 22:if(r=n.memoizedState!==null||$c,!r){t=t!==null&&t.memoizedState!==null||el,i=$c;var a=el;$c=r,(el=t)&&!a?Sl(e,n,(n.subtreeFlags&8772)!=0):bl(e,n),$c=i,el=a}break;case 30:break;default:bl(e,n)}}function ol(e){var t=e.alternate;t!==null&&(e.alternate=null,ol(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ut(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var sl=null,cl=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(je&&typeof je.onCommitFiberUnmount==`function`)try{je.onCommitFiberUnmount(Ae,n)}catch{}switch(n.tag){case 26:el||Gc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:el||Gc(n,t);var r=sl,i=cl;rf(n.type)&&(sl=n.stateNode,cl=!1),ll(e,t,n),yf(n.stateNode),sl=r,cl=i;break;case 5:el||Gc(n,t);case 6:if(r=sl,i=cl,sl=null,ll(e,t,n),sl=r,cl=i,sl!==null)if(cl)try{(sl.nodeType===9?sl.body:sl.nodeName===`HTML`?sl.ownerDocument.body:sl).removeChild(n.stateNode)}catch(e){Xu(n,t,e)}else try{sl.removeChild(n.stateNode)}catch(e){Xu(n,t,e)}break;case 18:sl!==null&&(cl?(e=sl,af(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),zp(e)):af(sl,n.stateNode));break;case 4:r=sl,i=cl,sl=n.stateNode.containerInfo,cl=!0,ll(e,t,n),sl=r,cl=i;break;case 0:case 11:case 14:case 15:Vc(2,n,t),el||Vc(4,n,t),ll(e,t,n);break;case 1:el||(Gc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Uc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:el=(r=el)||n.memoizedState!==null,ll(e,t,n),el=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{zp(e)}catch(e){Xu(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{zp(e)}catch(e){Xu(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new nl),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new nl),t;default:throw Error(i(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=td.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(rf(c.type)){sl=c.stateNode,cl=!1;break a}break;case 5:sl=c.stateNode,cl=!1;break a;case 3:case 4:sl=c.stateNode.containerInfo,cl=!0;break a}c=c.return}if(sl===null)throw Error(i(160));ul(o,s,a),sl=null,cl=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Vc(3,e,e.return),Bc(3,e),Vc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&64&&$c&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null)if(r===null)if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[lt]||o[nt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Bd(o,r,n),o[nt]=e,ht(o),r=o;break a;case`link`:var s=qf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=qf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Bd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[nt]=e,ht(o),r=o}e.stateNode=r}else Jf(a,e.type,e.stateNode);else e.stateNode=Hf(a,r,e.memoizedProps);else o===r?r===null&&e.stateNode!==null&&qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Jf(a,e.type,e.stateNode):Hf(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),n!==null&&r&4&&qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(el||n===null||Gc(n,n.return)),e.flags&32){a=e.stateNode;try{Vt(a,``)}catch(t){Xu(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(tl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Xu(e,e.return,t)}}break;case 3:if(Kf=null,a=gl,gl=Sf(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{zp(t.containerInfo)}catch(t){Xu(e,e.return,t)}tl&&(tl=!1,yl(e));break;case 4:r=gl,gl=Sf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(iu=xe()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=$c,d=el;if($c=u||a,el=d||l,hl(t,e),el=d,$c=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||$c||el||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Xu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){Xu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?of(m,!0):of(l.stateNode,!1)}catch(e){Xu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jc(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;Zc(e,Yc(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Vt(o,``),n.flags&=-33),Zc(e,Yc(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;Xc(e,Yc(e),s);break;default:throw Error(i(161))}}catch(t){Xu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)al(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Vc(4,t,t.return),xl(t);break;case 1:Gc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Uc(t,t.return,n),xl(t);break;case 27:yf(t.stateNode);case 26:case 5:Gc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=(t.subtreeFlags&8772)!=0,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Bc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Xu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ka(c[i],s)}catch(e){Xu(r,r.return,e)}}n&&o&64&&Hc(a),Wc(a,a.return);break;case 27:Qc(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Kc(a),Wc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Wc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&aa(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Bc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&aa(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Xu(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,(t.subtreeFlags&10256)!=0||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=(t.subtreeFlags&10256)!=0||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Bc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Zf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=Sf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Vc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];rl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Vc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;rl!==null;){var n=rl;switch(n.tag){case 0:case 11:case 15:Vc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:aa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,rl=r;else a:for(n=e;rl!==null;){r=rl;var i=r.sibling,a=r.return;if(ol(r),r===n){rl=null;break a}if(i!==null){i.return=a,rl=i;break a}rl=a}}}var Ll={getCacheForType:function(e){var t=Zi(ra),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Zi(ra).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,zl=0,Bl=null,Vl=null,Hl=0,Ul=0,Wl=null,Gl=!1,Kl=!1,ql=!1,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=0,tu=null,nu=null,ru=!1,iu=0,au=0,ou=1/0,su=null,cu=null,lu=0,uu=null,du=null,fu=0,pu=0,mu=null,hu=null,gu=0,_u=null;function vu(){return zl&2&&Hl!==0?Hl&-Hl:I.T===null?$e():_d()}function yu(){if($l===0)if(!(Hl&536870912)||Ai){var e=Re;Re<<=1,!(Re&3932160)&&(Re=262144),$l=e}else $l=536870912;return e=$a.current,e!==null&&(e.flags|=32),$l}function bu(e,t,n){(e===Bl&&(Ul===2||Ul===9)||e.cancelPendingCommit!==null)&&(Du(e,0),wu(e,Hl,$l,!1)),Ke(e,n),(!(zl&2)||e!==Bl)&&(e===Bl&&(!(zl&2)&&(Zl|=n),Yl===4&&wu(e,Hl,$l,!1)),ld(e))}function xu(e,t,n){if(zl&6)throw Error(i(327));var r=!n&&(t&127)==0&&(t&e.expiredLanes)===0||He(e,t),a=r?Fu(e,t):Nu(e,t,!0),o=r;do{if(a===0){Kl&&!r&&wu(e,t,0,!1);break}else{if(n=e.current.alternate,o&&!Cu(n)){a=Nu(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=tu;var l=c.current.memoizedState.isDehydrated;if(l&&(Du(c,s).flags|=256),s=Nu(c,s,!1),s!==2){if(ql&&!l){c.errorRecoveryDisabledLanes|=o,Zl|=o,a=4;break a}o=nu,nu=a,o!==null&&(nu===null?nu=o:nu.push.apply(nu,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){Du(e,0),wu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:wu(r,t,$l,!Gl);break a;case 2:nu=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=iu+300-xe(),10<a)){if(wu(r,t,$l,!Gl),Ve(r,0,!0)!==0)break a;fu=t,r.timeoutHandle=Qd(Su.bind(null,r,n,nu,su,ru,t,$l,Zl,eu,Gl,o,`Throttled`,-0,0),a);break a}Su(r,n,nu,su,ru,t,$l,Zl,eu,Gl,o,null,-0,0)}}break}while(1);ld(e)}function Su(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Yt},jl(t,a,d);var m=(a&62914560)===a?iu-xe():(a&4194048)===a?au-xe():0;if(m=$f(d,m),m!==null){fu=a,e.cancelPendingCommit=m(Hu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),wu(e,a,o,!l);return}}Hu(e,t,a,n,r,i,o,s,c)}function Cu(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!_r(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function wu(e,t,n,r){t&=~Ql,t&=~Zl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ne(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Je(e,n,t)}function Tu(){return zl&6?!0:(ud(0,!1),!1)}function Eu(){if(Vl!==null){if(Ul===0)var e=Vl.return;else e=Vl,Ui=Hi=null,Do(e),Oa=null,ka=0,e=Vl;for(;e!==null;)zc(e.alternate,e),e=e.return;Vl=null}}function Du(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,$d(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),fu=0,Eu(),Bl=e,Vl=n=ai(e.current,null),Hl=t,Ul=0,Wl=null,Gl=!1,Kl=He(e,t),ql=!1,eu=$l=Ql=Zl=Xl=Yl=0,nu=tu=null,ru=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ne(r),a=1<<i;t|=e[i],r&=~a}return Jl=t,Yr(),n}function Ou(e,t){lo=null,I.H=Is,t===va||t===ba?(t=Ea(),Ul=3):t===ya?(t=Ea(),Ul=4):Ul=t===ec?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Wl=t,Vl===null&&(Yl=1,Js(e,pi(t,e.current)))}function ku(){var e=$a.current;return e===null?!0:(Hl&4194048)===Hl?eo===null:(Hl&62914560)===Hl||Hl&536870912?e===eo:!1}function Au(){var e=I.H;return I.H=Is,e===null?Is:e}function ju(){var e=I.A;return I.A=Ll,e}function Mu(){Yl=4,Gl||(Hl&4194048)!==Hl&&$a.current!==null||(Kl=!0),!(Xl&134217727)&&!(Zl&134217727)||Bl===null||wu(Bl,Hl,$l,!1)}function Nu(e,t,n){var r=zl;zl|=2;var i=Au(),a=ju();(Bl!==e||Hl!==t)&&(su=null,Du(e,t)),t=!1;var o=Yl;a:do try{if(Ul!==0&&Vl!==null){var s=Vl,c=Wl;switch(Ul){case 8:Eu(),o=6;break a;case 3:case 2:case 9:case 6:$a.current===null&&(t=!0);var l=Ul;if(Ul=0,Wl=null,zu(e,s,c,l),n&&Kl){o=0;break a}break;default:l=Ul,Ul=0,Wl=null,zu(e,s,c,l)}}Pu(),o=Yl;break}catch(t){Ou(e,t)}while(1);return t&&e.shellSuspendCounter++,Ui=Hi=null,zl=r,I.H=i,I.A=a,Vl===null&&(Bl=null,Hl=0,Yr()),o}function Pu(){for(;Vl!==null;)Lu(Vl)}function Fu(e,t){var n=zl;zl|=2;var r=Au(),a=ju();Bl!==e||Hl!==t?(su=null,ou=xe()+500,Du(e,t)):Kl=He(e,t);a:do try{if(Ul!==0&&Vl!==null){t=Vl;var o=Wl;b:switch(Ul){case 1:Ul=0,Wl=null,zu(e,t,o,1);break;case 2:case 9:if(Sa(o)){Ul=0,Wl=null,Ru(t);break}t=function(){Ul!==2&&Ul!==9||Bl!==e||(Ul=7),ld(e)},o.then(t,t);break a;case 3:Ul=7;break a;case 4:Ul=5;break a;case 7:Sa(o)?(Ul=0,Wl=null,Ru(t)):(Ul=0,Wl=null,zu(e,t,o,7));break;case 5:var s=null;switch(Vl.tag){case 26:s=Vl.memoizedState;case 5:case 27:var c=Vl;if(s?Xf(s):c.stateNode.complete){Ul=0,Wl=null;var l=c.sibling;if(l!==null)Vl=l;else{var u=c.return;u===null?Vl=null:(Vl=u,Bu(u))}break b}}Ul=0,Wl=null,zu(e,t,o,5);break;case 6:Ul=0,Wl=null,zu(e,t,o,6);break;case 8:Eu(),Yl=6;break a;default:throw Error(i(462))}}Iu();break}catch(t){Ou(e,t)}while(1);return Ui=Hi=null,I.H=r,I.A=a,zl=n,Vl===null?(Bl=null,Hl=0,Yr(),Yl):0}function Iu(){for(;Vl!==null&&!H();)Lu(Vl)}function Lu(e){var t=Ac(e.alternate,e,Jl);e.memoizedProps=e.pendingProps,t===null?Bu(e):Vl=t}function Ru(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=mc(n,t,t.pendingProps,t.type,void 0,Hl);break;case 11:t=mc(n,t,t.pendingProps,t.type.render,t.ref,Hl);break;case 5:Do(t);default:zc(n,t),t=Vl=oi(t,Jl),t=Ac(n,t,Jl)}e.memoizedProps=e.pendingProps,t===null?Bu(e):Vl=t}function zu(e,t,n,r){Ui=Hi=null,Do(t),Oa=null,ka=0;var i=t.return;try{if($s(e,i,t,n,Hl)){Yl=1,Js(e,pi(n,e.current)),Vl=null;return}}catch(t){if(i!==null)throw Vl=i,t;Yl=1,Js(e,pi(n,e.current)),Vl=null;return}t.flags&32768?(Ai||r===1?e=!0:Kl||Hl&536870912?e=!1:(Gl=e=!0,(r===2||r===9||r===3||r===6)&&(r=$a.current,r!==null&&r.tag===13&&(r.flags|=16384))),Vu(t,e)):Bu(t)}function Bu(e){var t=e;do{if(t.flags&32768){Vu(t,Gl);return}e=t.return;var n=Lc(t.alternate,t,Jl);if(n!==null){Vl=n;return}if(t=t.sibling,t!==null){Vl=t;return}Vl=t=e}while(t!==null);Yl===0&&(Yl=5)}function Vu(e,t){do{var n=Rc(e.alternate,e);if(n!==null){n.flags&=32767,Vl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Vl=e;return}Vl=e=n}while(e!==null);Yl=6,Vl=null}function Hu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do qu();while(lu!==0);if(zl&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=Jr,qe(e,n,o,s,c,l),e===Bl&&(Vl=Bl=null,Hl=0),du=t,uu=e,fu=n,pu=o,mu=a,hu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,nd(Te,function(){return Ju(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!=0,t.subtreeFlags&13878||r){r=I.T,I.T=null,a=L.p,L.p=2,s=zl,zl|=4;try{il(e,t,n)}finally{zl=s,L.p=a,I.T=r}}lu=1,Uu(),Wu(),Gu()}}function Uu(){if(lu===1){lu=0;var e=uu,t=du,n=(t.flags&13878)!=0;if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=zl;zl|=4;try{_l(t,e);var a=Gd,o=Sr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&xr(s.ownerDocument.documentElement,s)){if(c!==null&&Cr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=br(s,h),v=br(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}pp=!!Wd,Gd=Wd=null}finally{zl=i,L.p=r,I.T=n}}e.current=t,lu=2}}function Wu(){if(lu===2){lu=0;var e=uu,t=du,n=(t.flags&8772)!=0;if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=zl;zl|=4;try{al(e,t.alternate,t)}finally{zl=i,L.p=r,I.T=n}}lu=3}}function Gu(){if(lu===4||lu===3){lu=0,be();var e=uu,t=du,n=fu,r=hu;t.subtreeFlags&10256||t.flags&10256?lu=5:(lu=0,du=uu=null,Ku(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(cu=null),Qe(n),t=t.stateNode,je&&typeof je.onCommitFiberRoot==`function`)try{je.onCommitFiberRoot(Ae,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{I.T=t,L.p=i}}fu&3&&qu(),ld(e),i=e.pendingLanes,n&261930&&i&42?e===_u?gu++:(gu=0,_u=e):gu=0,ud(0,!1)}}function Ku(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,aa(t)))}function qu(){return Uu(),Wu(),Gu(),Ju()}function Ju(){if(lu!==5)return!1;var e=uu,t=pu;pu=0;var n=Qe(fu),r=I.T,a=L.p;try{L.p=32>n?32:n,I.T=null,n=mu,mu=null;var o=uu,s=fu;if(lu=0,du=uu=null,fu=0,zl&6)throw Error(i(331));var c=zl;if(zl|=4,Pl(o.current),El(o,o.current,s,n),zl=c,ud(0,!1),je&&typeof je.onPostCommitFiberRoot==`function`)try{je.onPostCommitFiberRoot(Ae,o)}catch{}return!0}finally{L.p=a,I.T=r,Ku(e,t)}}function Yu(e,t,n){t=pi(n,t),t=Xs(e.stateNode,t,2),e=Ba(e,t,2),e!==null&&(Ke(e,2),ld(e))}function Xu(e,t,n){if(e.tag===3)Yu(e,e,n);else for(;t!==null;){if(t.tag===3){Yu(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(cu===null||!cu.has(r))){e=pi(n,e),n=Zs(2),r=Ba(t,n,2),r!==null&&(Qs(n,r,t,e),Ke(r,2),ld(r));break}}t=t.return}}function Zu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(ql=!0,i.add(n),e=Qu.bind(null,e,t,n),t.then(e,e))}function Qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Bl===e&&(Hl&n)===n&&(Yl===4||Yl===3&&(Hl&62914560)===Hl&&300>xe()-iu?!(zl&2)&&Du(e,0):Ql|=n,eu===Hl&&(eu=0)),ld(e)}function $u(e,t){t===0&&(t=We()),e=Qr(e,t),e!==null&&(Ke(e,t),ld(e))}function ed(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),$u(e,n)}function td(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),$u(e,n)}function nd(e,t){return ye(e,t)}var rd=null,id=null,ad=!1,od=!1,sd=!1,cd=0;function ld(e){e!==id&&e.next===null&&(id===null?rd=id=e:id=id.next=e),od=!0,ad||(ad=!0,gd())}function ud(e,t){if(!sd&&od){sd=!0;do for(var n=!1,r=rd;r!==null;){if(!t)if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ne(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,hd(r,a))}else a=Hl,a=Ve(r,r===Bl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||He(r,a)||(n=!0,hd(r,a));r=r.next}while(n);sd=!1}}function dd(){fd()}function fd(){od=ad=!1;var e=0;cd!==0&&Zd()&&(e=cd);for(var t=xe(),n=null,r=rd;r!==null;){var i=r.next,a=pd(r,t);a===0?(r.next=null,n===null?rd=i:n.next=i,i===null&&(id=n)):(n=r,(e!==0||a&3)&&(od=!0)),r=i}lu!==0&&lu!==5||ud(e,!1),cd!==0&&(cd=0)}function pd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ne(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ue(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=Bl,n=Hl,n=Ve(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Ul===2||Ul===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&V(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||He(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&V(r),Qe(n)){case 2:case 8:n=we;break;case 32:n=Te;break;case 268435456:n=De;break;default:n=Te}return r=md.bind(null,e),n=ye(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&V(r),e.callbackPriority=2,e.callbackNode=null,2}function md(e,t){if(lu!==0&&lu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(qu()&&e.callbackNode!==n)return null;var r=Hl;return r=Ve(e,e===Bl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(xu(e,r,t),pd(e,xe()),e.callbackNode!=null&&e.callbackNode===n?md.bind(null,e):null)}function hd(e,t){if(qu())return null;xu(e,t,!0)}function gd(){tf(function(){zl&6?ye(Ce,dd):fd()})}function _d(){if(cd===0){var e=ca;e===0&&(e=Le,Le<<=1,!(Le&261888)&&(Le=256)),cd=e}return cd}function vd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Jt(``+e)}function yd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function K(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=vd((i[rt]||null).action),o=r.submitter;o&&(t=(t=o[rt]||null)?vd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new _n(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(cd!==0){var e=o?yd(i,o):new FormData(i);Ss(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?yd(i,o):new FormData(i),Ss(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var bd=0;bd<Ur.length;bd++){var xd=Ur[bd];Wr(xd.toLowerCase(),`on`+(xd[0].toUpperCase()+xd.slice(1)))}Wr(Fr,`onAnimationEnd`),Wr(Ir,`onAnimationIteration`),Wr(Lr,`onAnimationStart`),Wr(`dblclick`,`onDoubleClick`),Wr(`focusin`,`onFocus`),Wr(`focusout`,`onBlur`),Wr(Rr,`onTransitionRun`),Wr(zr,`onTransitionStart`),Wr(Br,`onTransitionCancel`),Wr(Vr,`onTransitionEnd`),yt(`onMouseEnter`,[`mouseout`,`mouseover`]),yt(`onMouseLeave`,[`mouseout`,`mouseover`]),yt(`onPointerEnter`,[`pointerout`,`pointerover`]),yt(`onPointerLeave`,[`pointerout`,`pointerover`]),vt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),vt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),vt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),vt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),vt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Sd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Cd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Sd));function wd(e,t){t=(t&4)!=0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Gr(e)}i.currentTarget=null,a=c}}}}function Td(e,t){var n=t[at];n===void 0&&(n=t[at]=new Set);var r=e+`__bubble`;n.has(r)||(kd(t,e,2,!1),n.add(r))}function Ed(e,t,n){var r=0;t&&(r|=4),kd(n,e,r,t)}var Dd=`_reactListening`+Math.random().toString(36).slice(2);function Od(e){if(!e[Dd]){e[Dd]=!0,gt.forEach(function(t){t!==`selectionchange`&&(Cd.has(t)||Ed(t,!1,e),Ed(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Dd]||(t[Dd]=!0,Ed(`selectionchange`,!1,t))}}function kd(e,t,n,r){switch(bp(t)){case 2:var i=mp;break;case 8:i=hp;break;default:i=gp}n=i.bind(null,t,n,e),i=void 0,!on||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ad(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=dt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}nn(function(){var r=a,i=Zt(n),s=[];a:{var c=Hr.get(e);if(c!==void 0){var l=_n,u=e;switch(e){case`keypress`:if(fn(n)===0)break a;case`keydown`:case`keyup`:l=Fn;break;case`focusin`:u=`focus`,l=En;break;case`focusout`:u=`blur`,l=En;break;case`beforeblur`:case`afterblur`:l=En;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=wn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Tn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Ln;break;case Fr:case Ir:case Lr:l=Dn;break;case Vr:l=Rn;break;case`scroll`:case`scrollend`:l=yn;break;case`wheel`:l=zn;break;case`copy`:case`cut`:case`paste`:l=On;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=In;break;case`toggle`:case`beforetoggle`:l=Bn}var d=(t&4)!=0,f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=rn(m,p),g!=null&&d.push(jd(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==Xt&&(u=n.relatedTarget||n.fromElement)&&(dt(u)||u[it]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?dt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=wn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=In,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:pt(l),h=u==null?c:pt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,dt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Nd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Pd(s,c,l,d,!1),u!==null&&f!==null&&Pd(s,f,u,d,!0)}}a:{if(c=r?pt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=ar;else if(er(c))if(or)v=hr;else{v=pr;var y=fr}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&Gt(r.elementType)&&(v=ar):v=mr;if(v&&=v(e,r)){tr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Lt(c,`number`,c.value)}switch(y=r?pt(r):window,e){case`focusin`:(er(y)||y.contentEditable===`true`)&&(Tr=y,Er=r,Dr=null);break;case`focusout`:Dr=Er=Tr=null;break;case`mousedown`:Or=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Or=!1,kr(s,n,i);break;case`selectionchange`:if(wr)break;case`keydown`:case`keyup`:kr(s,n,i)}var b;if(Hn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Xn?Jn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Gn&&n.locale!==`ko`&&(Xn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Xn&&(b=dn()):(cn=i,ln=`value`in cn?cn.value:cn.textContent,Xn=!0)),y=Md(r,x),0<y.length&&(x=new kn(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=Yn(n),b!==null&&(x.data=b)))),(b=Wn?Zn(e,n):Qn(e,n))&&(x=Md(r,`onBeforeInput`),0<x.length&&(y=new kn(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),K(s,e,r,n,i)}wd(s,t)})}function jd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Md(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=rn(e,n),i!=null&&r.unshift(jd(e,i,a)),i=rn(e,t),i!=null&&r.push(jd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Nd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=rn(n,a),l!=null&&o.unshift(jd(n,l,c))):i||(l=rn(n,a),l!=null&&o.push(jd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Fd=/\r\n?/g,Id=/\u0000|\uFFFD/g;function Ld(e){return(typeof e==`string`?e:``+e).replace(Fd,`
|
|
9
|
+
`).replace(Id,``)}function Rd(e,t){return t=Ld(t),Ld(e)===t}function q(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Vt(e,``+r);break;case`className`:Tt(e,`class`,r);break;case`tabIndex`:Tt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Tt(e,n,r);break;case`style`:Wt(e,r,o);break;case`data`:if(t!==`object`){Tt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}else typeof o==`function`&&(n===`formAction`?(t!==`input`&&q(e,t,`name`,a.name,a,null),q(e,t,`formEncType`,a.formEncType,a,null),q(e,t,`formMethod`,a.formMethod,a,null),q(e,t,`formTarget`,a.formTarget,a,null)):(q(e,t,`encType`,a.encType,a,null),q(e,t,`method`,a.method,a,null),q(e,t,`target`,a.target,a,null)));if(r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Jt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`onScroll`:r!=null&&Td(`scroll`,e);break;case`onScrollEnd`:r!=null&&Td(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Jt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Td(`beforetoggle`,e),Td(`toggle`,e),wt(e,`popover`,r);break;case`xlinkActuate`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Et(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Et(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:wt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=Kt.get(n)||n,wt(e,n,r))}}function zd(e,t,n,r,a,o){switch(n){case`style`:Wt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Vt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Vt(e,``+r);break;case`onScroll`:r!=null&&Td(`scroll`,e);break;case`onScrollEnd`:r!=null&&Td(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Yt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!_t.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[rt]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):wt(e,n,r)}}}function Bd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Td(`error`,e),Td(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:q(e,t,o,s,n,null)}}a&&q(e,t,`srcSet`,n.srcSet,n,null),r&&q(e,t,`src`,n.src,n,null);return;case`input`:Td(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:q(e,t,r,d,n,null)}}It(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Td(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:q(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Rt(e,!!r,n,!0):Rt(e,!!r,t,!1);return;case`textarea`:for(s in Td(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:q(e,t,s,c,n,null)}Bt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:q(e,t,l,r,n,null)}return;case`dialog`:Td(`beforetoggle`,e),Td(`toggle`,e),Td(`cancel`,e),Td(`close`,e);break;case`iframe`:case`object`:Td(`load`,e);break;case`video`:case`audio`:for(r=0;r<Sd.length;r++)Td(Sd[r],e);break;case`image`:Td(`error`,e),Td(`load`,e);break;case`details`:Td(`toggle`,e);break;case`embed`:case`source`:case`link`:Td(`error`,e),Td(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:q(e,t,u,r,n,null)}return;default:if(Gt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&zd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&q(e,t,c,r,n,null))}function Vd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||q(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&q(e,t,p,m,r,f)}}Ft(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||q(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&q(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Rt(e,!!n,n?[]:``,!1):Rt(e,!!n,t,!0)):Rt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:q(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&q(e,t,s,a,r,o)}zt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:q(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:q(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&q(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:q(e,t,u,p,r,m)}return;default:if(Gt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&zd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||zd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&q(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||q(e,t,f,p,r,m)}function Hd(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Ud(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Hd(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Hd(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Wd=null,Gd=null;function Kd(e){return e.nodeType===9?e:e.ownerDocument}function qd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Jd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Yd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Xd=null;function Zd(){var e=window.event;return e&&e.type===`popstate`?e===Xd?!1:(Xd=e,!0):(Xd=null,!1)}var Qd=typeof setTimeout==`function`?setTimeout:void 0,$d=typeof clearTimeout==`function`?clearTimeout:void 0,ef=typeof Promise==`function`?Promise:void 0,tf=typeof queueMicrotask==`function`?queueMicrotask:ef===void 0?Qd:function(e){return ef.resolve(null).then(e).catch(nf)};function nf(e){setTimeout(function(){throw e})}function rf(e){return e===`head`}function af(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),zp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)yf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,yf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&yf(e.ownerDocument.body);n=i}while(n);zp(t)}function of(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8)if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++;n=r}while(n)}function sf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:sf(n),ut(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function cf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r)if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e;else if(!e[lt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=mf(e.nextSibling),e===null)break}return null}function lf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=mf(e.nextSibling),e===null))return null;return e}function uf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=mf(e.nextSibling),e===null))return null;return e}function df(e){return e.data===`$?`||e.data===`$~`}function ff(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function pf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function mf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var hf=null;function gf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return mf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function _f(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function vf(e,t,n){switch(t=Kd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function yf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ut(e)}var bf=new Map,xf=new Set;function Sf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Cf=L.d;L.d={f:wf,r:Tf,D:Of,C:kf,L:Af,m:jf,X:Nf,S:Mf,M:Pf};function wf(){var e=Cf.f(),t=Tu();return e||t}function Tf(e){var t=ft(e);t!==null&&t.tag===5&&t.type===`form`?ws(t):Cf.r(e)}var Ef=typeof document>`u`?null:document;function Df(e,t,n){var r=Ef;if(r&&typeof t==`string`&&t){var i=Pt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),xf.has(i)||(xf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Bd(t,`link`,e),ht(t),r.head.appendChild(t)))}}function Of(e){Cf.D(e),Df(`dns-prefetch`,e,null)}function kf(e,t){Cf.C(e,t),Df(`preconnect`,e,t)}function Af(e,t,n){Cf.L(e,t,n);var r=Ef;if(r&&e&&t){var i=`link[rel="preload"][as="`+Pt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Pt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Pt(n.imageSizes)+`"]`)):i+=`[href="`+Pt(e)+`"]`;var a=i;switch(t){case`style`:a=If(e);break;case`script`:a=Bf(e)}bf.has(a)||(e=m({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),bf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Lf(a))||t===`script`&&r.querySelector(Vf(a))||(t=r.createElement(`link`),Bd(t,`link`,e),ht(t),r.head.appendChild(t)))}}function jf(e,t){Cf.m(e,t);var n=Ef;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Pt(r)+`"][href="`+Pt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Bf(e)}if(!bf.has(a)&&(e=m({rel:`modulepreload`,href:e},t),bf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Vf(a)))return}r=n.createElement(`link`),Bd(r,`link`,e),ht(r),n.head.appendChild(r)}}}function Mf(e,t,n){Cf.S(e,t,n);var r=Ef;if(r&&e){var i=mt(r).hoistableStyles,a=If(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Lf(a)))s.loading=5;else{e=m({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=bf.get(a))&&Wf(e,n);var c=o=r.createElement(`link`);ht(c),Bd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Uf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Nf(e,t){Cf.X(e,t);var n=Ef;if(n&&e){var r=mt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=m({src:e,async:!0},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),ht(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Pf(e,t){Cf.M(e,t);var n=Ef;if(n&&e){var r=mt(n).hoistableScripts,i=Bf(e),a=r.get(i);a||(a=n.querySelector(Vf(i)),a||(e=m({src:e,async:!0,type:`module`},t),(t=bf.get(i))&&Gf(e,t),a=n.createElement(`script`),ht(a),Bd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t,n,r){var a=(a=oe.current)?Sf(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=If(n.href),n=mt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=If(n.href);var o=mt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Lf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),bf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},bf.set(e,n),o||zf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Bf(n),n=mt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function If(e){return`href="`+Pt(e)+`"`}function Lf(e){return`link[rel="stylesheet"][`+e+`]`}function Rf(e){return m({},e,{"data-precedence":e.precedence,precedence:null})}function zf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Bd(t,`link`,n),ht(t),e.head.appendChild(t))}function Bf(e){return`[src="`+Pt(e)+`"]`}function Vf(e){return`script[async]`+e}function Hf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Pt(n.href)+`"]`);if(r)return t.instance=r,ht(r),r;var a=m({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),ht(r),Bd(r,`style`,a),Uf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=If(n.href);var o=e.querySelector(Lf(a));if(o)return t.state.loading|=4,t.instance=o,ht(o),o;r=Rf(n),(a=bf.get(a))&&Wf(r,a),o=(e.ownerDocument||e).createElement(`link`),ht(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Bd(o,`link`,r),t.state.loading|=4,Uf(o,n.precedence,e),t.instance=o;case`script`:return o=Bf(n.src),(a=e.querySelector(Vf(o)))?(t.instance=a,ht(a),a):(r=n,(a=bf.get(o))&&(r=m({},n),Gf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),ht(a),Bd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Uf(r,n.precedence,e));return t.instance}function Uf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Wf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Kf=null;function qf(e,t,n){if(Kf===null){var r=new Map,i=Kf=new Map;i.set(n,r)}else i=Kf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[lt]||a[nt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Jf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Yf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Xf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Zf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=If(r.href),a=t.querySelector(Lf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ep.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,ht(a);return}a=t.ownerDocument||t,r=Rf(r),(i=bf.get(i))&&Wf(r,i),a=a.createElement(`link`),ht(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Bd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ep.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Qf=0;function $f(e,t){return e.stylesheets&&e.count===0&&np(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&np(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Qf===0&&(Qf=62500*Ud());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&np(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function ep(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)np(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var tp=null;function np(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tp=new Map,t.forEach(rp,e),tp=null,ep.call(e))}function rp(e,t){if(!(t.state.loading&4)){var n=tp.get(e);if(n)var r=n.get(null);else{n=new Map,tp.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ep.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ip={$$typeof:C,Provider:null,Consumer:null,_currentValue:R,_currentValue2:R,_threadCount:0};function ap(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Ge(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ge(0),this.hiddenUpdates=Ge(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function op(e,t,n,r,i,a,o,s,c,l,u,d){return e=new ap(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ri(3,null,null,t),e.current=a,a.stateNode=e,t=ia(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},La(a),e}function sp(e){return e?(e=ti,e):ti}function cp(e,t,n,r,i,a){i=sp(i),r.context===null?r.context=i:r.pendingContext=i,r=za(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ba(e,r,t),n!==null&&(bu(n,e,t),Va(n,e,t))}function lp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function up(e,t){lp(e,t),(e=e.alternate)&&lp(e,t)}function dp(e){if(e.tag===13||e.tag===31){var t=Qr(e,67108864);t!==null&&bu(t,e,67108864),up(e,67108864)}}function fp(e){if(e.tag===13||e.tag===31){var t=vu();t=Ze(t);var n=Qr(e,t);n!==null&&bu(n,e,t),up(e,t)}}var pp=!0;function mp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,gp(e,t,n,r)}finally{L.p=a,I.T=i}}function hp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,gp(e,t,n,r)}finally{L.p=a,I.T=i}}function gp(e,t,n,r){if(pp){var i=_p(r);if(i===null)Ad(e,t,r,vp,n),kp(e,r);else if(jp(i,e,t,n,r))r.stopPropagation();else if(kp(e,r),t&4&&-1<Op.indexOf(e)){for(;i!==null;){var a=ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Be(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ne(o);s.entanglements[1]|=c,o&=~c}ld(a),!(zl&6)&&(ou=xe()+500,ud(0,!1))}}break;case 31:case 13:s=Qr(a,2),s!==null&&bu(s,a,2),Tu(),up(a,2)}if(a=_p(r),a===null&&Ad(e,t,r,vp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ad(e,t,r,null,n)}}function _p(e){return e=Zt(e),yp(e)}var vp=null;function yp(e){if(vp=null,e=dt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return vp=e,null}function bp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Se()){case Ce:return 2;case we:return 8;case Te:case Ee:return 32;case De:return 268435456;default:return 32}default:return 32}}var xp=!1,Sp=null,Cp=null,wp=null,Tp=new Map,Ep=new Map,Dp=[],Op=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function kp(e,t){switch(e){case`focusin`:case`focusout`:Sp=null;break;case`dragenter`:case`dragleave`:Cp=null;break;case`mouseover`:case`mouseout`:wp=null;break;case`pointerover`:case`pointerout`:Tp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Ep.delete(t.pointerId)}}function Ap(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=ft(t),t!==null&&dp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jp(e,t,n,r,i){switch(t){case`focusin`:return Sp=Ap(Sp,e,t,n,r,i),!0;case`dragenter`:return Cp=Ap(Cp,e,t,n,r,i),!0;case`mouseover`:return wp=Ap(wp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Tp.set(a,Ap(Tp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Ep.set(a,Ap(Ep.get(a)||null,e,t,n,r,i)),!0}return!1}function Mp(e){var t=dt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,et(e.priority,function(){fp(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,et(e.priority,function(){fp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Np(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=_p(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Xt=r,n.target.dispatchEvent(r),Xt=null}else return t=ft(n),t!==null&&dp(t),e.blockedOn=n,!1;t.shift()}return!0}function Pp(e,t,n){Np(e)&&n.delete(t)}function Fp(){xp=!1,Sp!==null&&Np(Sp)&&(Sp=null),Cp!==null&&Np(Cp)&&(Cp=null),wp!==null&&Np(wp)&&(wp=null),Tp.forEach(Pp),Ep.forEach(Pp)}function Ip(e,n){e.blockedOn===n&&(e.blockedOn=null,xp||(xp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Fp)))}var Lp=null;function Rp(e){Lp!==e&&(Lp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Lp===e&&(Lp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(yp(r||n)===null)continue;break}var a=ft(n);a!==null&&(e.splice(t,3),t-=3,Ss(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function zp(e){function t(t){return Ip(t,e)}Sp!==null&&Ip(Sp,e),Cp!==null&&Ip(Cp,e),wp!==null&&Ip(wp,e),Tp.forEach(t),Ep.forEach(t);for(var n=0;n<Dp.length;n++){var r=Dp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Dp.length&&(n=Dp[0],n.blockedOn===null);)Mp(n),n.blockedOn===null&&Dp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[rt]||null;if(typeof a==`function`)o||Rp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[rt]||null)s=o.formAction;else if(yp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Rp(n)}}}function Bp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Vp(e){this._internalRoot=e}Hp.prototype.render=Vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;cp(n,vu(),e,t,null,null)},Hp.prototype.unmount=Vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cp(e.current,2,null,e,null,null),Tu(),t[it]=null}};function Hp(e){this._internalRoot=e}Hp.prototype.unstable_scheduleHydration=function(e){if(e){var t=$e();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Dp.length&&t!==0&&t<Dp[n].priority;n++);Dp.splice(n,0,e),n===0&&Mp(e)}};var Up=n.version;if(Up!==`19.2.7`)throw Error(i(527,Up,`19.2.7`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=u(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var Wp={bundleType:0,version:`19.2.7`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.7`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Gp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gp.isDisabled&&Gp.supportsFiber)try{Ae=Gp.inject(Wp),je=Gp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Gs,s=Ks,c=qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=op(e,1,!1,null,null,n,r,null,o,s,c,Bp),e[it]=t.current,Od(e),new Vp(t)}})),_=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=g()})),v=c(d(),1),y=_(),b=`modulepreload`,x=function(e){return`/`+e},S={},C=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=x(t,n),t in S)return;S[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:b,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},w=`popstate`;function T(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function E(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return j(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:M(t)}return P(t,n,null,e)}function D(e,t){if(e===!1||e==null)throw Error(t)}function O(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function k(){return Math.random().toString(36).substring(2,10)}function A(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function j(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?N(t):t,state:n,key:t&&t.key||r||k(),mask:i}}function M({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function N(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function P(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=T(e)?e:j(h.location,e,t);n&&n(r,e),l=u()+1;let d=A(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=T(e)?e:j(h.location,e,t);n&&n(r,e),l=u();let i=A(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return F(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(w,d),c=e,()=>{i.removeEventListener(w,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function F(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),D(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:M(t);return i=i.replace(/ $/,`%20`),!n&&i.startsWith(`//`)&&(i=r+i),new URL(i,r)}function I(e,t,n=`/`){return L(e,t,n,!1)}function L(e,t,n,r,i){let a=he((typeof t==`string`?N(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ee(e),s=null,c=me(a);for(let e=0;s==null&&e<o.length;++e)s=fe(o[e],c,r);return s}function R(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function ee(e){let t=te(e);return re(t),t}function te(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;D(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Se([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(D(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),te(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ue(l,e.index),routesMeta:u})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ne(e.path))a(e,t,!0,n)}),t}function ne(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ne(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function re(e){e.sort((e,t)=>e.score===t.score?de(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var z=/^:[\w-]+$/,ie=3,ae=2,oe=1,se=10,ce=-2,le=e=>e===`*`;function ue(e,t){let n=e.split(`/`),r=n.length;return n.some(le)&&(r+=ce),t&&(r+=ae),n.filter(e=>!le(e)).reduce((e,t)=>e+(z.test(t)?ie:t===``?oe:se),r)}function de(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function fe(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u=B({path:s.relativePath,caseSensitive:s.caseSensitive,end:c},l),d=s.route;if(!u&&c&&n&&!r[r.length-1].route.index&&(u=B({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!u)return null;Object.assign(i,u.params),o.push({params:i,pathname:Se([a,u.pathname]),pathnameBase:we(Se([a,u.pathnameBase])),route:d}),u.pathnameBase!==`/`&&(a=Se([a,u.pathnameBase]))}return o}function B(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pe(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return n&&!i?e[t]=void 0:e[t]=(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function pe(e,t=!1,n=!0){O(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function me(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return O(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function he(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}var ge=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function _e(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?N(e):e,a;return n?(n=xe(n),a=n.startsWith(`/`)?ve(n.substring(1),`/`):ve(n,t)):a=t,{pathname:a,search:Te(r),hash:Ee(i)}}function ve(e,t){let n=Ce(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function ye(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function V(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function H(e){let t=V(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function be(e,t,n,r=!1){let i;typeof e==`string`?i=N(e):(i={...e},D(!i.pathname||!i.pathname.includes(`?`),ye(`?`,`pathname`,`search`,i)),D(!i.pathname||!i.pathname.includes(`#`),ye(`#`,`pathname`,`hash`,i)),D(!i.search||!i.search.includes(`#`),ye(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=_e(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var xe=e=>e.replace(/\/\/+/g,`/`),Se=e=>xe(e.join(`/`)),Ce=e=>e.replace(/\/+$/,``),we=e=>Ce(e).replace(/^\/*/,`/`),Te=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ee=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,De=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Oe(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ke(e){return Se(e.map(e=>e.route.path).filter(Boolean))||`/`}var Ae=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function je(e,t){let n=e;if(typeof n!=`string`||!ge.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Ae)try{let e=new URL(window.location.href),r=n.startsWith(`//`)?new URL(e.protocol+n):new URL(n),a=he(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{O(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Me=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Me);var Ne=[`GET`,...Me];new Set(Ne);var Pe=v.createContext(null);Pe.displayName=`DataRouter`;var Fe=v.createContext(null);Fe.displayName=`DataRouterState`;var Ie=v.createContext(!1);function Le(){return v.useContext(Ie)}var Re=v.createContext({isTransitioning:!1});Re.displayName=`ViewTransition`;var ze=v.createContext(new Map);ze.displayName=`Fetchers`;var Be=v.createContext(null);Be.displayName=`Await`;var Ve=v.createContext(null);Ve.displayName=`Navigation`;var He=v.createContext(null);He.displayName=`Location`;var Ue=v.createContext({outlet:null,matches:[],isDataRoute:!1});Ue.displayName=`Route`;var We=v.createContext(null);We.displayName=`RouteError`;var Ge=`REACT_ROUTER_ERROR`,Ke=`REDIRECT`,qe=`ROUTE_ERROR_RESPONSE`;function Je(e){if(e.startsWith(`${Ge}:${Ke}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function Ye(e){if(e.startsWith(`${Ge}:${qe}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new De(t.status,t.statusText,t.data)}catch{}}function Xe(e,{relative:t}={}){D(Ze(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(Ve),{hash:i,pathname:a,search:o}=st(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Se([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Ze(){return v.useContext(He)!=null}function Qe(){return D(Ze(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(He).location}var $e=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function et(e){v.useContext(Ve).static||v.useLayoutEffect(e)}function tt(){let{isDataRoute:e}=v.useContext(Ue);return e?Et():nt()}function nt(){D(Ze(),`useNavigate() may be used only in the context of a <Router> component.`);let e=v.useContext(Pe),{basename:t,navigator:n}=v.useContext(Ve),{matches:r}=v.useContext(Ue),{pathname:i}=Qe(),a=JSON.stringify(H(r)),o=v.useRef(!1);return et(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(O(o.current,$e),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=be(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Se([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var rt=v.createContext(null);function it(){return v.useContext(rt)}function at(e){let t=v.useContext(Ue).outlet;return v.useMemo(()=>t&&v.createElement(rt.Provider,{value:e},t),[t,e])}function ot(){let{matches:e}=v.useContext(Ue);return e[e.length-1]?.params??{}}function st(e,{relative:t}={}){let{matches:n}=v.useContext(Ue),{pathname:r}=Qe(),i=JSON.stringify(H(n));return v.useMemo(()=>be(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function ct(e,t){return lt(e,t)}function lt(e,t,n){D(Ze(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(Ve),{matches:i}=v.useContext(Ue),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Ot(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Qe(),d;if(t){let e=typeof t==`string`?N(t):t;D(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):I(e,{pathname:p});O(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),O(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=gt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Se([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Se([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?v.createElement(He.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function ut(){let e=Tt(),t=Oe(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=v.createElement(v.Fragment,null,v.createElement(`p`,null,`💿 Hey developer 👋`),v.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,v.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,v.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:i},n):null,o)}var dt=v.createElement(ut,null),ft=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=Ye(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(Ue.Provider,{value:this.props.routeContext},v.createElement(We.Provider,{value:e,children:this.props.component}));return this.context?v.createElement(mt,{error:e},t):t}};ft.contextType=Ie;var pt=new WeakMap;function mt({children:e,error:t}){let{basename:n}=v.useContext(Ve);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Je(t.digest);if(e){let r=pt.get(t);if(r)throw r;let i=je(e.location,n);if(Ae&&!pt.get(t))if(i.isExternal||e.reloadDocument)window.location.href=i.absoluteURL||i.to;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw pt.set(t,n),n}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${i.absoluteURL||i.to}`})}}return e}function ht({routeContext:e,match:t,children:n}){let r=v.useContext(Pe);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Ue.Provider,{value:e},n)}function gt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);D(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:ke(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||dt,o&&(s<0&&c===0?(Ot(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(ht,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(ft,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function _t(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function vt(e){let t=v.useContext(Pe);return D(t,_t(e)),t}function yt(e){let t=v.useContext(Fe);return D(t,_t(e)),t}function bt(e){let t=v.useContext(Ue);return D(t,_t(e)),t}function xt(e){let t=bt(e),n=t.matches[t.matches.length-1];return D(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function St(){return xt(`useRouteId`)}function Ct(){let e=yt(`useNavigation`);return v.useMemo(()=>{let{matches:t,historyAction:n,...r}=e.navigation;return r},[e.navigation])}function wt(){let{matches:e,loaderData:t}=yt(`useMatches`);return v.useMemo(()=>e.map(e=>R(e,t)),[e,t])}function Tt(){let e=v.useContext(We),t=yt(`useRouteError`),n=xt(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Et(){let{router:e}=vt(`useNavigate`),t=xt(`useNavigate`),n=v.useRef(!1);return et(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{O(n.current,$e),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Dt={};function Ot(e,t,n){!t&&!Dt[e]&&(Dt[e]=!0,O(!1,n))}v.memo(kt);function kt({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return lt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function At({to:e,replace:t,state:n,relative:r}){D(Ze(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=v.useContext(Ve);O(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=v.useContext(Ue),{pathname:o}=Qe(),s=tt(),c=be(e,H(a),o,r===`path`),l=JSON.stringify(c);return v.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function jt(e){return at(e.context)}function Mt(e){D(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function Nt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){D(!Ze(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=N(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=v.useMemo(()=>{let e=he(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return O(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:v.createElement(Ve.Provider,{value:c},v.createElement(He.Provider,{children:t,value:h}))}function Pt({children:e,location:t}){return ct(Ft(e),t)}v.Component;function Ft(e,t=[]){let n=[];return v.Children.forEach(e,(e,r)=>{if(!v.isValidElement(e))return;let i=[...t,r];if(e.type===v.Fragment){n.push.apply(n,Ft(e.props.children,i));return}D(e.type===Mt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),D(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Ft(e.props.children,i)),n.push(a)}),n}var It=`get`,Lt=`application/x-www-form-urlencoded`;function Rt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function zt(e){return Rt(e)&&e.tagName.toLowerCase()===`button`}function Bt(e){return Rt(e)&&e.tagName.toLowerCase()===`form`}function Vt(e){return Rt(e)&&e.tagName.toLowerCase()===`input`}function Ht(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Ut(e,t){return e.button===0&&(!t||t===`_self`)&&!Ht(e)}function Wt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Gt(e,t){let n=Wt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var Kt=null;function qt(){if(Kt===null)try{new FormData(document.createElement(`form`),0),Kt=!1}catch{Kt=!0}return Kt}var Jt=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function Yt(e){return e!=null&&!Jt.has(e)?(O(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Lt}"`),null):e}function Xt(e,t){let n,r,i,a,o;if(Bt(e)){let o=e.getAttribute(`action`);r=o?he(o,t):null,n=e.getAttribute(`method`)||It,i=Yt(e.getAttribute(`enctype`))||Lt,a=new FormData(e)}else if(zt(e)||Vt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?he(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||It,i=Yt(e.getAttribute(`formenctype`))||Yt(o.getAttribute(`enctype`))||Lt,a=new FormData(o,e),!qt()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Rt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=It,r=null,i=Lt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var Zt={"&":`\\u0026`,">":`\\u003e`,"<":`\\u003c`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},Qt=/[&><\u2028\u2029]/g;function $t(e){return e.replace(Qt,e=>Zt[e])}function en(e,t){if(e===!1||e==null)throw Error(t)}function tn(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return n?i.pathname.endsWith(`/`)?i.pathname=`${i.pathname}_.${r}`:i.pathname=`${i.pathname}.${r}`:i.pathname===`/`?i.pathname=`_root.${r}`:t&&he(i.pathname,t)===`/`?i.pathname=`${Ce(t)}/_root.${r}`:i.pathname=`${Ce(i.pathname)}.${r}`,i}async function nn(e,t){if(e.id in t)return t[e.id];try{let n=await C(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function rn(e){return e!=null&&typeof e.page==`string`}function an(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function on(e,t,n){return dn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await nn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(an).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function sn(e,t,n,r,i,a){let o=(e,t)=>n[t]?e.route.id!==n[t].route.id:!0,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function cn(e,t,{includeHydrateFallback:n}={}){return ln(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function ln(e){return[...new Set(e)]}function un(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function dn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!rn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(un(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function fn(){let e=v.useContext(Pe);return en(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function pn(){let e=v.useContext(Fe);return en(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var mn=v.createContext(void 0);mn.displayName=`FrameworkContext`;function hn(){let e=v.useContext(mn);return en(e,`You must render this element inside a <HydratedRouter> element`),e}function gn(e,t){let n=v.useContext(mn),[r,i]=v.useState(!1),[a,o]=v.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=v.useRef(null);v.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),v.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:_n(s,p),onBlur:_n(c,m),onMouseEnter:_n(l,p),onMouseLeave:_n(u,m),onTouchStart:_n(d,p)}]:[a,f,{}]:[!1,f,{}]}function _n(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function vn({page:e,...t}){let n=Le(),{router:r}=fn(),i=v.useMemo(()=>I(r.routes,e,r.basename),[r.routes,e,r.basename]);return i?n?v.createElement(bn,{page:e,matches:i,...t}):v.createElement(xn,{page:e,matches:i,...t}):null}function yn(e){let{manifest:t,routeModules:n}=hn(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return on(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function bn({page:e,matches:t,...n}){let r=Qe(),{future:i}=hn(),{basename:a}=fn(),o=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=tn(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return v.createElement(v.Fragment,null,o.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function xn({page:e,matches:t,...n}){let r=Qe(),{future:i,manifest:a,routeModules:o}=hn(),{basename:s}=fn(),{loaderData:c,matches:l}=pn(),u=v.useMemo(()=>sn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=v.useMemo(()=>sn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=tn(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=v.useMemo(()=>cn(d,a),[d,a]),m=yn(d);return v.createElement(v.Fragment,null,f.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>v.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>v.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Sn(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}v.Component;var Cn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Cn&&(window.__reactRouterVersion=`7.16.0`)}catch{}function wn({basename:e,children:t,useTransitions:n,window:r}){let i=v.useRef();i.current??=E({window:r,v5Compat:!0});let a=i.current,[o,s]=v.useState({action:a.action,location:a.location}),c=v.useCallback(e=>{n===!1?s(e):v.startTransition(()=>s(e))},[n]);return v.useLayoutEffect(()=>a.listen(c),[a,c]),v.createElement(Nt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}function Tn({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=v.useState({action:n.action,location:n.location}),o=v.useCallback(e=>{r===!1?a(e):v.startTransition(()=>a(e))},[r]);return v.useLayoutEffect(()=>n.listen(o),[n,o]),v.createElement(Nt,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}Tn.displayName=`unstable_HistoryRouter`;var En=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Dn=v.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=v.useContext(Ve),y=typeof l==`string`&&En.test(l),b=je(l,h);l=b.to;let x=Xe(l,{relative:r}),S=Qe(),C=null;if(o){let e=be(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Se([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=gn(n,p),D=Pn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=v.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Sn(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?v.createElement(v.Fragment,null,A,v.createElement(vn,{page:x})):A});Dn.displayName=`Link`;var On=v.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=st(a,{relative:c.relative}),d=Qe(),f=v.useContext(Fe),{navigator:p,basename:m}=v.useContext(Ve),h=f!=null&&Gn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=he(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return v.createElement(Dn,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});On.displayName=`NavLink`;var kn=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=It,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=v.useContext(Ve),g=Rn(),_=zn(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&En.test(s);return v.createElement(`form`,{ref:m,method:y,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?v.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});kn.displayName=`Form`;function An({getKey:e,storageKey:t,...n}){let r=v.useContext(mn),{basename:i}=v.useContext(Ve),a=Qe(),o=wt();Un({getKey:e,storageKey:t});let s=v.useMemo(()=>{if(!r||!e)return null;let t=Hn(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return v.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${$t(JSON.stringify(t||Bn))}, ${$t(JSON.stringify(s))})`}})}An.displayName=`ScrollRestoration`;function jn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Mn(e){let t=v.useContext(Pe);return D(t,jn(e)),t}function Nn(e){let t=v.useContext(Fe);return D(t,jn(e)),t}function Pn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=tt(),d=Qe(),f=st(e,{relative:o});return v.useCallback(p=>{if(Ut(p,t)){p.preventDefault();let t=n===void 0?M(d)===M(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?v.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Fn(e){O(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(Wt(e)),n=v.useRef(!1),r=Qe(),i=v.useMemo(()=>Gt(r.search,n.current?null:t.current),[r.search]),a=tt();return[i,v.useCallback((e,t)=>{let r=Wt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var In=0,Ln=()=>`__${String(++In)}__`;function Rn(){let{router:e}=Mn(`useSubmit`),{basename:t}=v.useContext(Ve),n=St(),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Xt(e,t);a.navigate===!1?await r(a.fetcherKey||Ln(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function zn(e,{relative:t}={}){let{basename:n}=v.useContext(Ve),r=v.useContext(Ue);D(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...st(e||`.`,{relative:t})},o=Qe();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Se([n,a.pathname])),M(a)}var Bn=`react-router-scroll-positions`,Vn={};function Hn(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:he(e.pathname,n)||e.pathname},t)),i??=e.key,i}function Un({getKey:e,storageKey:t}={}){let{router:n}=Mn(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=Nn(`useScrollRestoration`),{basename:a}=v.useContext(Ve),o=Qe(),s=wt(),c=Ct();v.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),Wn(v.useCallback(()=>{if(c.state===`idle`){let t=Hn(o,s,a,e);Vn[t]=window.scrollY}try{sessionStorage.setItem(t||Bn,JSON.stringify(Vn))}catch(e){O(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[c.state,e,a,o,s,t])),typeof document<`u`&&(v.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||Bn);e&&(Vn=JSON.parse(e))}catch{}},[t]),v.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(Vn,()=>window.scrollY,e?(t,n)=>Hn(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),v.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(o.hash){let e=document.getElementById(decodeURIComponent(o.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{O(!1,`"${o.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[o,r,i]))}function Wn(e,t){let{capture:n}=t||{};v.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function Gn(e,{relative:t}={}){let n=v.useContext(Re);D(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Mn(`useViewTransitionState`),i=st(e,{relative:t});if(!n.isTransitioning)return!1;let a=he(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=he(n.nextLocation.pathname,r)||n.nextLocation.pathname;return B(i.pathname,o)!=null||B(i.pathname,a)!=null}var Kn=`9drive.accessToken`,qn=`9drive.refreshToken`,Jn=`9drive.user`;function Yn(){return localStorage.getItem(Kn)}function Xn(){return localStorage.getItem(qn)}function Zn(){let e=localStorage.getItem(Jn);return e?JSON.parse(e):null}function Qn(e,t,n){localStorage.setItem(Kn,e),localStorage.setItem(qn,t),localStorage.setItem(Jn,JSON.stringify(n))}function $n(e){localStorage.setItem(Jn,JSON.stringify(e))}function er(e){localStorage.setItem(Kn,e)}function tr(){localStorage.removeItem(Kn),localStorage.removeItem(qn),localStorage.removeItem(Jn)}var nr=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),U=o(((e,t)=>{t.exports=nr()}))();function rr(){return Yn()?(0,U.jsx)(jt,{}):(0,U.jsx)(At,{to:`/login`,replace:!0})}var ir=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ar=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),or=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),sr=e=>{let t=or(e);return t.charAt(0).toUpperCase()+t.slice(1)},cr={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},lr=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ur=(0,v.createContext)({}),dr=()=>(0,v.useContext)(ur),fr=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=dr()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...cr,width:t??l??cr.width,height:t??l??cr.height,stroke:e??f,strokeWidth:m,className:ir(`lucide`,p,i),...!a&&!lr(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),pr=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(fr,{ref:i,iconNode:t,className:ir(`lucide-${ar(sr(e))}`,`lucide-${e}`,n),...r}));return n.displayName=sr(e),n},mr=pr(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),hr=pr(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),gr=pr(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),_r=pr(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),vr=pr(`bell`,[[`path`,{d:`M10.268 21a2 2 0 0 0 3.464 0`,key:`vwvbt9`}],[`path`,{d:`M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326`,key:`11g9vi`}]]),yr=pr(`binary`,[[`rect`,{x:`14`,y:`14`,width:`4`,height:`6`,rx:`2`,key:`p02svl`}],[`rect`,{x:`6`,y:`4`,width:`4`,height:`6`,rx:`2`,key:`xm4xkj`}],[`path`,{d:`M6 20h4`,key:`1i6q5t`}],[`path`,{d:`M14 10h4`,key:`ru81e7`}],[`path`,{d:`M6 14h2v6`,key:`16z9wg`}],[`path`,{d:`M14 4h2v6`,key:`1idq9u`}]]),br=pr(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),xr=pr(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Sr=pr(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Cr=pr(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),wr=pr(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Tr=pr(`circle-check-big`,[[`path`,{d:`M21.801 10A10 10 0 1 1 17 3.335`,key:`yps3ct`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),Er=pr(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Dr=pr(`circle-question-mark`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Or=pr(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),kr=pr(`clipboard-paste`,[[`path`,{d:`M11 14h10`,key:`1w8e9d`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v1.344`,key:`1e62lh`}],[`path`,{d:`m17 18 4-4-4-4`,key:`z2g111`}],[`path`,{d:`M8 4H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 1.793-1.113`,key:`bjbb7m`}],[`rect`,{x:`8`,y:`2`,width:`8`,height:`4`,rx:`1`,key:`ublpy`}]]),Ar=pr(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),jr=pr(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),Mr=pr(`code-xml`,[[`path`,{d:`m18 16 4-4-4-4`,key:`1inbqp`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}],[`path`,{d:`m14.5 4-5 16`,key:`e7oirm`}]]),Nr=pr(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Pr=pr(`corner-down-left`,[[`path`,{d:`M20 4v7a4 4 0 0 1-4 4H4`,key:`6o5b7l`}],[`path`,{d:`m9 10-5 5 5 5`,key:`1kshq7`}]]),Fr=pr(`crop`,[[`path`,{d:`M6 2v14a2 2 0 0 0 2 2h14`,key:`ron5a4`}],[`path`,{d:`M18 22V8a2 2 0 0 0-2-2H2`,key:`7s9ehn`}]]),Ir=pr(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Lr=pr(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Rr=pr(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),zr=pr(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Br=pr(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Vr=pr(`file-archive`,[[`path`,{d:`M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5`,key:`4pqfef`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 12v-1`,key:`1ej8lb`}],[`path`,{d:`M8 18v-2`,key:`qcmpov`}],[`path`,{d:`M8 7V6`,key:`1nbb54`}],[`circle`,{cx:`8`,cy:`20`,r:`2`,key:`ckkr5m`}]]),Hr=pr(`file-code`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),Ur=pr(`file-headphone`,[[`path`,{d:`M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343`,key:`1vfytu`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0`,key:`1etmh7`}]]),Wr=pr(`file-text`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),Gr=pr(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),Kr=pr(`folder-input`,[[`path`,{d:`M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1`,key:`fm4g5t`}],[`path`,{d:`M2 13h10`,key:`pgb2dq`}],[`path`,{d:`m9 16 3-3-3-3`,key:`6m91ic`}]]),qr=pr(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),Jr=pr(`folder-plus`,[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Yr=pr(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),Xr=pr(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Zr=pr(`hard-drive`,[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]),Qr=pr(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),$r=pr(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]),ei=pr(`info`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ti=pr(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),ni=pr(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),ri=pr(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]),ii=pr(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),ai=pr(`list`,[[`path`,{d:`M3 5h.01`,key:`18ugdj`}],[`path`,{d:`M3 12h.01`,key:`nlz23k`}],[`path`,{d:`M3 19h.01`,key:`noohij`}],[`path`,{d:`M8 5h13`,key:`1pao27`}],[`path`,{d:`M8 12h13`,key:`1za7za`}],[`path`,{d:`M8 19h13`,key:`m83p4d`}]]),oi=pr(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),si=pr(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),ci=pr(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),li=pr(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),ui=pr(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),di=pr(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),fi=pr(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),pi=pr(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),mi=pr(`move-horizontal`,[[`path`,{d:`m18 8 4 4-4 4`,key:`1ak13k`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m6 8-4 4 4 4`,key:`15zrgr`}]]),hi=pr(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),gi=pr(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]),_i=pr(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),vi=pr(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),yi=pr(`pen-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),bi=pr(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),xi=pr(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Si=pr(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Ci=pr(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),wi=pr(`scissors`,[[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M8.12 8.12 12 12`,key:`1alkpv`}],[`path`,{d:`M20 4 8.12 15.88`,key:`xgtan2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`path`,{d:`M14.8 14.8 20 20`,key:`ptml3r`}]]),Ti=pr(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Ei=pr(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),Di=pr(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Oi=pr(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),ki=pr(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ai=pr(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),ji=pr(`sparkles`,[[`path`,{d:`M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z`,key:`1s2grr`}],[`path`,{d:`M20 2v4`,key:`1rf3ol`}],[`path`,{d:`M22 4h-4`,key:`gwowj6`}],[`circle`,{cx:`4`,cy:`20`,r:`2`,key:`6kqj1y`}]]),Mi=pr(`stamp`,[[`path`,{d:`M14 13V8.5C14 7 15 7 15 5a3 3 0 0 0-6 0c0 2 1 2 1 3.5V13`,key:`i9gjdv`}],[`path`,{d:`M20 15.5a2.5 2.5 0 0 0-2.5-2.5h-11A2.5 2.5 0 0 0 4 15.5V17a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1z`,key:`1vzg3v`}],[`path`,{d:`M5 22h14`,key:`ehvnwv`}]]),Ni=pr(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),Pi=pr(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Fi=pr(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ii=pr(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Li=pr(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Ri=pr(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),zi=pr(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),Bi=pr(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),Vi=pr(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]),Hi=pr(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ui=pr(`zap`,[[`path`,{d:`M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z`,key:`1xq2db`}]]);function Wi(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Wi(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Gi(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Wi(e))&&(r&&(r+=` `),r+=t);return r}var Ki=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},qi=(e,t)=>({classGroupId:e,validator:t}),Ji=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Yi=`-`,Xi=[],Zi=`arbitrary..`,Qi=e=>{let t=ta(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return ea(e);let n=e.split(Yi);return $i(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Ki(i,t):t:i||Xi}return n[e]||Xi}}},$i=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=$i(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Yi):e.slice(t).join(Yi),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ea=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Zi+r:void 0})(),ta=e=>{let{theme:t,classGroups:n}=e;return na(n,t)},na=(e,t)=>{let n=Ji();for(let r in e){let i=e[r];ra(i,n,r,t)}return n},ra=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];ia(i,t,n,r)}},ia=(e,t,n,r)=>{if(typeof e==`string`){aa(e,t,n);return}if(typeof e==`function`){oa(e,t,n,r);return}sa(e,t,n,r)},aa=(e,t,n)=>{let r=e===``?t:ca(t,e);r.classGroupId=n},oa=(e,t,n,r)=>{if(la(e)){ra(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(qi(n,e))},sa=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];ra(o,ca(t,a),n,r)}},ca=(e,t)=>{let n=e,r=t.split(Yi),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Ji(),n.nextPart.set(t,i)),n=i}return n},la=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,ua=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},da=`!`,fa=`:`,pa=[],ma=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),ha=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===fa){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(da)?(c=s.slice(0,-1),l=!0):s.startsWith(da)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return ma(t,l,c,u)};if(t){let e=t+fa,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):ma(pa,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},ga=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},_a=e=>({cache:ua(e.cacheSize),parseClassName:ha(e),sortModifiers:ga(e),postfixLookupClassGroupIds:va(e),...Qi(e)}),va=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},ya=/\s+/,ba=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(ya),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+da:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},xa=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Sa(n))&&(i&&(i+=` `),i+=r);return i},Sa=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Sa(e[r]))&&(n&&(n+=` `),n+=t);return n},Ca=(e,...t)=>{let n,r,i,a,o=o=>(n=_a(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ba(e,n);return i(e,a),a};return a=o,(...e)=>a(xa(...e))},wa=[],Ta=e=>{let t=t=>t[e]||wa;return t.isThemeGetter=!0,t},Ea=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Da=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Oa=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ka=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Aa=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ja=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ma=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Na=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Pa=e=>Oa.test(e),Fa=e=>!!e&&!Number.isNaN(Number(e)),Ia=e=>!!e&&Number.isInteger(Number(e)),La=e=>e.endsWith(`%`)&&Fa(e.slice(0,-1)),Ra=e=>ka.test(e),za=()=>!0,Ba=e=>Aa.test(e)&&!ja.test(e),Va=()=>!1,Ha=e=>Ma.test(e),Ua=e=>Na.test(e),Wa=e=>!qa(e)&&!to(e),Ga=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Ka=e=>lo(e,mo,Va),qa=e=>Ea.test(e),Ja=e=>lo(e,ho,Ba),Ya=e=>lo(e,go,Fa),Xa=e=>lo(e,vo,za),Za=e=>lo(e,_o,Va),Qa=e=>lo(e,fo,Va),$a=e=>lo(e,po,Ua),eo=e=>lo(e,yo,Ha),to=e=>Da.test(e),no=e=>uo(e,ho),ro=e=>uo(e,_o),io=e=>uo(e,fo),ao=e=>uo(e,mo),oo=e=>uo(e,po),so=e=>uo(e,yo,!0),co=e=>uo(e,vo,!0),lo=(e,t,n)=>{let r=Ea.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},uo=(e,t,n=!1)=>{let r=Da.exec(e);return r?r[1]?t(r[1]):n:!1},fo=e=>e===`position`||e===`percentage`,po=e=>e===`image`||e===`url`,mo=e=>e===`length`||e===`size`||e===`bg-size`,ho=e=>e===`length`,go=e=>e===`number`,_o=e=>e===`family-name`,vo=e=>e===`number`||e===`weight`,yo=e=>e===`shadow`,bo=Ca(()=>{let e=Ta(`color`),t=Ta(`font`),n=Ta(`text`),r=Ta(`font-weight`),i=Ta(`tracking`),a=Ta(`leading`),o=Ta(`breakpoint`),s=Ta(`container`),c=Ta(`spacing`),l=Ta(`radius`),u=Ta(`shadow`),d=Ta(`inset-shadow`),f=Ta(`text-shadow`),p=Ta(`drop-shadow`),m=Ta(`blur`),h=Ta(`perspective`),g=Ta(`aspect`),_=Ta(`ease`),v=Ta(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),to,qa],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[to,qa,c],T=()=>[Pa,`full`,`auto`,...w()],E=()=>[Ia,`none`,`subgrid`,to,qa],D=()=>[`auto`,{span:[`full`,Ia,to,qa]},Ia,to,qa],O=()=>[Ia,`auto`,to,qa],k=()=>[`auto`,`min`,`max`,`fr`,to,qa],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[Pa,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[Pa,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[Pa,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,to,qa],L=()=>[...b(),io,Qa,{position:[to,qa]}],R=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ee=()=>[`auto`,`cover`,`contain`,ao,Ka,{size:[to,qa]}],te=()=>[La,no,Ja],ne=()=>[``,`none`,`full`,l,to,qa],re=()=>[``,Fa,no,Ja],z=()=>[`solid`,`dashed`,`dotted`,`double`],ie=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ae=()=>[Fa,La,io,Qa],oe=()=>[``,`none`,m,to,qa],se=()=>[`none`,Fa,to,qa],ce=()=>[`none`,Fa,to,qa],le=()=>[Fa,to,qa],ue=()=>[Pa,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Ra],breakpoint:[Ra],color:[za],container:[Ra],"drop-shadow":[Ra],ease:[`in`,`out`,`in-out`],font:[Wa],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Ra],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Ra],shadow:[Ra],spacing:[`px`,Fa],text:[Ra],"text-shadow":[Ra],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Pa,qa,to,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,to,qa]}],"container-named":[Ga],columns:[{columns:[Fa,qa,to,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[Ia,`auto`,to,qa]}],basis:[{basis:[Pa,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Fa,Pa,`auto`,`initial`,`none`,qa]}],grow:[{grow:[``,Fa,to,qa]}],shrink:[{shrink:[``,Fa,to,qa]}],order:[{order:[Ia,`first`,`last`,`none`,to,qa]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,no,Ja]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,co,Xa]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,La,qa]}],"font-family":[{font:[ro,Za,t]}],"font-features":[{"font-features":[qa]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,to,qa]}],"line-clamp":[{"line-clamp":[Fa,`none`,to,Ya]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,to,qa]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,to,qa]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...z(),`wavy`]}],"text-decoration-thickness":[{decoration:[Fa,`from-font`,`auto`,to,Ja]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[Fa,`auto`,to,qa]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[Ia,to,qa]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,to,qa]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,to,qa]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:R()}],"bg-size":[{bg:ee()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},Ia,to,qa],radial:[``,to,qa],conic:[Ia,to,qa]},oo,$a]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:te()}],"gradient-via-pos":[{via:te()}],"gradient-to-pos":[{to:te()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:ne()}],"rounded-s":[{"rounded-s":ne()}],"rounded-e":[{"rounded-e":ne()}],"rounded-t":[{"rounded-t":ne()}],"rounded-r":[{"rounded-r":ne()}],"rounded-b":[{"rounded-b":ne()}],"rounded-l":[{"rounded-l":ne()}],"rounded-ss":[{"rounded-ss":ne()}],"rounded-se":[{"rounded-se":ne()}],"rounded-ee":[{"rounded-ee":ne()}],"rounded-es":[{"rounded-es":ne()}],"rounded-tl":[{"rounded-tl":ne()}],"rounded-tr":[{"rounded-tr":ne()}],"rounded-br":[{"rounded-br":ne()}],"rounded-bl":[{"rounded-bl":ne()}],"border-w":[{border:re()}],"border-w-x":[{"border-x":re()}],"border-w-y":[{"border-y":re()}],"border-w-s":[{"border-s":re()}],"border-w-e":[{"border-e":re()}],"border-w-bs":[{"border-bs":re()}],"border-w-be":[{"border-be":re()}],"border-w-t":[{"border-t":re()}],"border-w-r":[{"border-r":re()}],"border-w-b":[{"border-b":re()}],"border-w-l":[{"border-l":re()}],"divide-x":[{"divide-x":re()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":re()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...z(),`hidden`,`none`]}],"divide-style":[{divide:[...z(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...z(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Fa,to,qa]}],"outline-w":[{outline:[``,Fa,no,Ja]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,so,eo]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,so,eo]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:re()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[Fa,Ja]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":re()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,so,eo]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[Fa,to,qa]}],"mix-blend":[{"mix-blend":[...ie(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":ie()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Fa]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[to,qa]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Fa]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:R()}],"mask-size":[{mask:ee()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,to,qa]}],filter:[{filter:[``,`none`,to,qa]}],blur:[{blur:oe()}],brightness:[{brightness:[Fa,to,qa]}],contrast:[{contrast:[Fa,to,qa]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,so,eo]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,Fa,to,qa]}],"hue-rotate":[{"hue-rotate":[Fa,to,qa]}],invert:[{invert:[``,Fa,to,qa]}],saturate:[{saturate:[Fa,to,qa]}],sepia:[{sepia:[``,Fa,to,qa]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,to,qa]}],"backdrop-blur":[{"backdrop-blur":oe()}],"backdrop-brightness":[{"backdrop-brightness":[Fa,to,qa]}],"backdrop-contrast":[{"backdrop-contrast":[Fa,to,qa]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Fa,to,qa]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Fa,to,qa]}],"backdrop-invert":[{"backdrop-invert":[``,Fa,to,qa]}],"backdrop-opacity":[{"backdrop-opacity":[Fa,to,qa]}],"backdrop-saturate":[{"backdrop-saturate":[Fa,to,qa]}],"backdrop-sepia":[{"backdrop-sepia":[``,Fa,to,qa]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,to,qa]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Fa,`initial`,to,qa]}],ease:[{ease:[`linear`,`initial`,_,to,qa]}],delay:[{delay:[Fa,to,qa]}],animate:[{animate:[`none`,v,to,qa]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,to,qa]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ce()}],"scale-x":[{"scale-x":ce()}],"scale-y":[{"scale-y":ce()}],"scale-z":[{"scale-z":ce()}],"scale-3d":[`scale-3d`],skew:[{skew:le()}],"skew-x":[{"skew-x":le()}],"skew-y":[{"skew-y":le()}],transform:[{transform:[to,qa,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":[`translate-none`],zoom:[{zoom:[Ia,to,qa]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,to,qa]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,to,qa]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[Fa,no,Ja,Ya]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function xo(...e){return bo(Gi(e))}function So({className:e}){return(0,U.jsx)(`div`,{className:xo(`inline-flex items-center justify-center shrink-0`,e),children:(0,U.jsxs)(`svg`,{viewBox:`0 0 87.3 78`,className:`h-full w-full select-none`,role:`img`,"aria-label":`9Drive logo`,children:[(0,U.jsxs)(`defs`,{children:[(0,U.jsx)(`filter`,{id:`nineDriveCenterShadow`,x:`-30%`,y:`-30%`,width:`160%`,height:`160%`,children:(0,U.jsx)(`feDropShadow`,{dx:`0`,dy:`1.2`,stdDeviation:`1.5`,floodOpacity:`0.25`,floodColor:`#000000`})}),(0,U.jsxs)(`linearGradient`,{id:`nineDriveDiskGrad`,x1:`0%`,y1:`0%`,x2:`0%`,y2:`100%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#FFFFFF`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#F8FAFD`})]}),(0,U.jsxs)(`linearGradient`,{id:`nineDriveBlueGrad`,x1:`0%`,y1:`0%`,x2:`100%`,y2:`100%`,children:[(0,U.jsx)(`stop`,{offset:`0%`,stopColor:`#1A73E8`}),(0,U.jsx)(`stop`,{offset:`100%`,stopColor:`#0B57D0`})]})]}),(0,U.jsx)(`path`,{d:`M29.9 1.2h27.5L84.9 47H57.4L29.9 1.2z`,fill:`#FFBA00`}),(0,U.jsx)(`path`,{d:`M73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5H59.8l5.85 10.15 7.9 13.65z`,fill:`#EA4335`}),(0,U.jsx)(`path`,{d:`M13.75 76.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.4 4.5-1.2L59.8 53H27.5L13.75 76.8z`,fill:`#00AC47`}),(0,U.jsx)(`path`,{d:`M6.6 66.85l3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8H0c0 1.55.4 3.1 1.2 4.5l5.4 9.35z`,fill:`#0066DA`}),(0,U.jsx)(`path`,{d:`M27.5 53l-13.75 23.8c-1.35-.8-2.5-1.9-3.3-3.3L.05 51.5c-.8-1.4-.8-2.95 0-4.5L24.05 3c.8-1.4 1.95-2.5 3.3-3.3l13.8 23.9L27.5 53z`,fill:`#2684FC`}),(0,U.jsx)(`path`,{d:`M43.65 25L29.9 1.2c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44c-.8 1.4-1.2 2.95-1.2 4.5h27.5L43.65 25z`,fill:`#00AC47`,opacity:`0.18`}),(0,U.jsx)(`circle`,{cx:`43.65`,cy:`43.8`,r:`16.5`,fill:`url(#nineDriveDiskGrad)`,stroke:`#E2E7EE`,strokeWidth:`0.8`,filter:`url(#nineDriveCenterShadow)`}),(0,U.jsx)(`text`,{x:`43.65`,y:`44.2`,textAnchor:`middle`,dominantBaseline:`central`,fontFamily:`'Product Sans', 'Google Sans', 'Roboto', 'Segoe UI', system-ui, sans-serif`,fontSize:`22`,fontWeight:`800`,fill:`url(#nineDriveBlueGrad)`,children:`9`})]})})}async function Co(){let e=Xn();if(!e)return!1;let t=await fetch(`/auth/refresh`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({refreshToken:e})});return t.ok?(er((await t.json()).accessToken),!0):!1}async function W(e,t={}){let n=new Headers(t.headers),r=Yn();!t.skipAuth&&r&&n.set(`Authorization`,`Bearer ${r}`),t.body&&!(t.body instanceof FormData)&&!n.has(`Content-Type`)&&n.set(`Content-Type`,`application/json`);let i=await fetch(`${e}`,{...t,headers:n});if(i.status===401&&t.retry!==!1&&!t.skipAuth&&await Co())return W(e,{...t,retry:!1});if(!i.ok){let e=await i.json().catch(()=>({message:i.statusText}));throw i.status===401&&tr(),Error(e.message??`Request failed`)}return i.json()}function wo(e){if(e==null)return`--`;let t=Number(e);if(!Number.isFinite(t))return`--`;if(t===0)return`0 B`;let n=[`B`,`KB`,`MB`,`GB`,`TB`],r=Math.min(Math.floor(Math.log(t)/Math.log(1024)),n.length-1);return`${(t/1024**r).toFixed(r===0?0:2)} ${n[r]}`}function To(e){return new Intl.DateTimeFormat(`en`,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e))}var Eo=(0,v.createContext)(void 0),Do=`9drive:selected-drive-id`,Oo=`9drive:default-drive-id`;function ko({children:e}){let[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)(()=>localStorage.getItem(Do)||``),[a,o]=(0,v.useState)(()=>localStorage.getItem(Oo)||``),[s,c]=(0,v.useState)(!0);async function l(){try{let e=((await W(`/connected-accounts`)).accounts||[]).filter(e=>e.status===`connected`);n(e);let t=localStorage.getItem(Oo),r=``;r=t===`all`?`all`:t&&e.some(e=>e.id===t)?t:e.length>0?e[0].id:`all`,o(r);let a=localStorage.getItem(Do);a===`all`?i(`all`):a&&e.some(e=>e.id===a)?i(a):(i(r),localStorage.setItem(Do,r))}catch(e){console.error(`Failed to load connected accounts for filter context:`,e)}finally{c(!1)}}(0,v.useEffect)(()=>{l();function e(){l()}return window.addEventListener(`9drive:accounts-changed`,e),()=>window.removeEventListener(`9drive:accounts-changed`,e)},[]);function u(e){i(e),localStorage.setItem(Do,e),window.dispatchEvent(new CustomEvent(`9drive:filter-drive-changed`,{detail:{accountId:e}}))}function d(e){o(e),localStorage.setItem(Oo,e),u(e),window.dispatchEvent(new CustomEvent(`9drive:default-account-changed`,{detail:{accountId:e}}))}function f(e){let n=t.findIndex(t=>t.id===e);return n===-1?``:String.fromCharCode(65+n)}let p=r===`all`,m=t.find(e=>e.id===r)||null;return(0,U.jsx)(Eo.Provider,{value:{accounts:t,selectedAccountId:r,setSelectedAccountId:u,activeAccount:m,isAll:p,defaultAccountId:a,setDefaultAccountId:d,isLoadingAccounts:s,refreshAccounts:l,getDriveLetter:f},children:e})}function Ao(){let e=(0,v.useContext)(Eo);if(!e)throw Error(`useDriveFilter must be used within a DriveFilterProvider`);return e}var jo={"nav.my_drive":{en:`My Drive`,id:`Drive Saya`},"nav.tools":{en:`Tools Studio`,id:`Studio Alat`},"nav.shared":{en:`Shared with me`,id:`Dibagikan kepada saya`},"nav.recent":{en:`Recent`,id:`Terbaru`},"nav.starred":{en:`Starred`,id:`Berbintang`},"nav.trash":{en:`Trash`,id:`Sampah`},"nav.storage":{en:`Storage`,id:`Penyimpanan`},"nav.activity":{en:`Activity`,id:`Aktivitas`},"nav.settings":{en:`Settings`,id:`Pengaturan`},"nav.api_keys":{en:`API Keys`,id:`Kunci API`},"nav.sign_out":{en:`Sign out`,id:`Keluar`},"action.new":{en:`New`,id:`Baru`},"action.new_folder":{en:`New folder`,id:`Folder baru`},"action.file_upload":{en:`File upload`,id:`Upload file`},"action.folder_upload":{en:`Folder upload`,id:`Upload folder`},"action.download":{en:`Download`,id:`Unduh`},"action.rename":{en:`Rename`,id:`Ganti nama`},"action.delete":{en:`Delete`,id:`Hapus`},"action.share":{en:`Share`,id:`Bagikan`},"action.copy_link":{en:`Copy link`,id:`Salin link`},"action.cancel":{en:`Cancel`,id:`Batal`},"action.save":{en:`Save`,id:`Simpan`},"action.close":{en:`Close`,id:`Tutup`},"action.sync":{en:`Sync`,id:`Sinkronkan`},"action.syncing":{en:`Syncing...`,id:`Menyinkronkan...`},"action.disconnect":{en:`Disconnect`,id:`Putuskan`},"action.upload":{en:`Upload`,id:`Unggah`},"action.create":{en:`Create`,id:`Buat`},"action.ok":{en:`OK`,id:`Oke`},"action.move_here":{en:`Move here`,id:`Pindahkan ke sini`},"action.open":{en:`Open`,id:`Buka`},"action.copy":{en:`Copy`,id:`Salin`},"action.copied":{en:`Copied!`,id:`Tersalin!`},"action.select_all":{en:`Select all`,id:`Pilih semua`},"action.selected":{en:`selected`,id:`dipilih`},"section.folders":{en:`Folders`,id:`Folder`},"section.files":{en:`Files`,id:`File`},"search.placeholder":{en:`Search in Drive`,id:`Telusuri di Drive`},"search.showing_results":{en:`Showing search results for`,id:`Menampilkan hasil pencarian untuk`},"search.in_all_accounts":{en:`across all drive accounts`,id:`di seluruh akun drive`},"search.search_all_accounts":{en:`Search across all drive accounts`,id:`Cari di seluruh akun drive`},"search.clear_search":{en:`Clear Search`,id:`Hapus Pencarian`},"table.name":{en:`Name`,id:`Nama`},"table.location":{en:`Location`,id:`Lokasi`},"table.owner":{en:`Owner`,id:`Pemilik`},"table.last_opened":{en:`Last opened`,id:`Terakhir dibuka`},"table.starred_on":{en:`Starred on`,id:`Dibintangi pada`},"table.last_modified":{en:`Last modified`,id:`Terakhir diubah`},"table.file_size":{en:`File size`,id:`Ukuran file`},"table.sharing":{en:`Sharing`,id:`Berbagi`},"table.select_all_files":{en:`Select all files`,id:`Pilih semua file`},"menu.open_in_gdrive":{en:`Open in Google Drive`,id:`Buka di Google Drive`},"menu.preview":{en:`Preview`,id:`Pratinjau`},"menu.download":{en:`Download`,id:`Unduh`},"menu.remove_bg":{en:`Remove Background (AI)`,id:`Hapus Latar Belakang (AI)`},"menu.convert_pdf":{en:`Convert to PDF`,id:`Konversi ke PDF`},"menu.process_pdf":{en:`Process with PDF Tools`,id:`Proses dengan Alat PDF`},"menu.rename":{en:`Rename`,id:`Ganti nama`},"menu.move_to":{en:`Move to`,id:`Pindahkan ke`},"menu.cut_folder":{en:`Move / Cut`,id:`Pindahkan / Potong`},"menu.paste_folder":{en:`Paste folder here`,id:`Tempel folder di sini`},"menu.file_info":{en:`File information`,id:`Informasi file`},"menu.share":{en:`Share`,id:`Bagikan`},"menu.copy_link":{en:`Copy link`,id:`Salin link`},"menu.copy_cdn":{en:`Copy CDN Direct URL`,id:`Salin URL Langsung CDN`},"menu.move_to_trash":{en:`Move to trash`,id:`Pindahkan ke sampah`},"drag.drop_to_upload":{en:`Drop files to instantly upload`,id:`Lepaskan berkas untuk langsung mengunggah`},"drag.will_upload_to":{en:`Will upload to:`,id:`Akan diunggah ke:`},"empty.all_files_title":{en:`A place for all of your files`,id:`Tempat untuk semua file Anda`},"empty.all_files_desc":{en:`Drag your files here or use the "+ New" button on the left to upload.`,id:`Tarik file Anda ke sini atau gunakan tombol "+ Baru" di sebelah kiri untuk mengunggah.`},"empty.folder_empty":{en:`This folder is empty. Drag files here or use the "+ New" button to upload.`,id:`Folder ini kosong. Tarik file ke sini atau gunakan tombol "+ Baru" untuk mengunggah.`},"empty.no_search_results":{en:`No files found matching your search.`,id:`Tidak ada file yang cocok dengan pencarian Anda.`},"trash.title":{en:`Trash`,id:`Sampah`},"trash.info_bar":{en:`Items in trash are deleted forever after 30 days.`,id:`Item di sampah akan dihapus selamanya setelah 30 hari.`},"trash.empty_title":{en:`Trash is empty`,id:`Sampah kosong`},"trash.empty_desc":{en:`Items moved to the trash will show up here.`,id:`Item yang dipindahkan ke sampah akan muncul di sini.`},"trash.restore":{en:`Restore`,id:`Pulihkan`},"trash.delete_forever":{en:`Delete forever`,id:`Hapus selamanya`},"trash.empty_trash":{en:`Empty trash`,id:`Kosongkan sampah`},"trash.storage_account":{en:`Storage account`,id:`Akun penyimpanan`},"trash.original_size":{en:`Original size`,id:`Ukuran asli`},"trash.date_trashed":{en:`Date trashed`,id:`Tanggal dihapus`},"trash.actions":{en:`Actions`,id:`Aksi`},"drawer.details":{en:`Details`,id:`Detail`},"drawer.file_details":{en:`File details`,id:`Detail file`},"drawer.type":{en:`Type`,id:`Tipe`},"drawer.size":{en:`Size`,id:`Ukuran`},"drawer.location":{en:`Location`,id:`Lokasi`},"drawer.owner":{en:`Owner`,id:`Pemilik`},"drawer.modified":{en:`Modified`,id:`Diubah`},"drawer.storage_provider":{en:`Storage provider`,id:`Penyedia penyimpanan`},"drawer.cdn_direct":{en:`CDN Direct URL`,id:`URL Langsung CDN`},"drawer.cdn_desc":{en:`Direct embed for <img> tags, web apps, and platforms.`,id:`Embed langsung untuk tag <img>, aplikasi web, dan platform.`},"drawer.gdrive_link":{en:`Google Drive Link`,id:`Link Google Drive`},"drawer.select_file":{en:`Select a file to see details`,id:`Pilih file untuk melihat detail`},"modal.upload_title":{en:`Upload File`,id:`Upload File`},"modal.upload_desc":{en:`Stream file directly to selected Google Drive account.`,id:`Alirkan file langsung ke akun Google Drive yang dipilih.`},"modal.drop_or_browse":{en:`Drop files here or click to browse`,id:`Tarik file ke sini atau klik untuk memilih`},"modal.target_account":{en:`Target Storage Account`,id:`Akun Penyimpanan Tujuan`},"modal.auto_account":{en:`Automatic (Default)`,id:`Otomatis (Default)`},"modal.virtual_folder":{en:`Virtual Folder`,id:`Folder Virtual`},"modal.no_folder":{en:`No folder`,id:`Tanpa folder`},"modal.uploading_to":{en:`Uploading to:`,id:`Mengunggah ke:`},"modal.new_folder_title":{en:`New Folder`,id:`Folder Baru`},"modal.new_folder_desc":{en:`Create a virtual folder for organizing files.`,id:`Buat folder virtual untuk mengorganisasi file.`},"modal.folder_name":{en:`Folder Name`,id:`Nama Folder`},"modal.untitled_folder":{en:`Untitled folder`,id:`Folder tanpa judul`},"modal.rename_title":{en:`Rename`,id:`Ganti Nama`},"modal.move_title":{en:`Move`,id:`Pindahkan`},"modal.delete_file_title":{en:`Move to trash?`,id:`Pindahkan ke sampah?`},"modal.delete_folder_title":{en:`Delete folder?`,id:`Hapus folder?`},"alert.no_storage_title":{en:`No Storage Connected`,id:`Penyimpanan Belum Terhubung`},"alert.no_storage_desc":{en:`9Drive requires at least one active storage account (Google Drive or S3 Storage) to start uploading and managing files.`,id:`9Drive memerlukan minimal satu akun penyimpanan aktif (Google Drive atau S3 Storage) untuk mulai mengunggah dan mengelola file.`},"alert.setup_badge":{en:`Setup Required`,id:`Setup Awal`},"alert.test_users_title":{en:`Google Cloud Console Note (Testing Mode):`,id:`Catatan Google Cloud Console (Mode Testing):`},"alert.test_users_desc":{en:`If your Google Console app status is still "Testing", your Gmail account must be added to OAuth Consent Screen > Test Users. Otherwise Google will block access with error "403: access_denied".`,id:`Jika status aplikasi di Google Console masih Testing, akun Gmail Anda wajib didaftarkan di menu OAuth Consent Screen > Test Users. Tanpa ini, Google akan memblokir login dengan error "403: access_denied".`},"alert.open_settings":{en:`Open Settings & Connect`,id:`Buka Pengaturan & Hubungkan`},"alert.guide_btn":{en:`Google Console Setup Guide`,id:`Panduan Setup Google Console`},"settings.title":{en:`Settings`,id:`Pengaturan`},"settings.language_title":{en:`Language / Bahasa`,id:`Bahasa / Language`},"settings.language_desc":{en:`Select your preferred interface language.`,id:`Pilih bahasa tampilan antarmuka yang Anda inginkan.`},"settings.lang_en":{en:`English (Default)`,id:`English (Default)`},"settings.lang_id":{en:`Bahasa Indonesia`,id:`Bahasa Indonesia`},"settings.google_title":{en:`Google Drive`,id:`Google Drive`},"settings.google_desc":{en:`Connect Google Drive accounts. 9Drive routes uploads to accounts with available quota.`,id:`Hubungkan akun Google Drive. 9Drive mengarahkan unggahan ke akun dengan sisa kuota terbanyak.`},"settings.connect_drive":{en:`Connect Drive`,id:`Hubungkan Drive`},"settings.s3_title":{en:`S3 Compatible Storage`,id:`Penyimpanan Kompatibel S3`},"settings.s3_desc":{en:`Connect AWS S3, Cloudflare R2, MinIO, Wasabi, Backblaze B2, or custom endpoint storage.`,id:`Hubungkan AWS S3, Cloudflare R2, MinIO, Wasabi, Backblaze B2, atau endpoint storage kustom.`},"settings.connect_s3":{en:`Connect S3`,id:`Hubungkan S3`},"settings.connected_accounts":{en:`Connected Storage Accounts`,id:`Akun Penyimpanan Terhubung`},"settings.no_accounts":{en:`No connected storage account yet.`,id:`Belum ada akun penyimpanan terhubung.`},"settings.default_account_title":{en:`Platform Default Account`,id:`Akun Default Platform`},"settings.default_account_desc":{en:`Choose which connected account is selected by default when opening 9Drive.`,id:`Pilih akun yang otomatis aktif secara default setiap kali membuka 9Drive.`},"settings.oauth_creds_title":{en:`Google OAuth Credentials`,id:`Kredensial OAuth Google`},"action.clear_selection":{en:`Clear selection`,id:`Batal pilihan`},"action.refresh":{en:`Refresh`,id:`Segarkan`},"action.refreshing":{en:`Refreshing...`,id:`Menyegarkan...`},"action.done":{en:`Done`,id:`Selesai`},"action.send":{en:`Send`,id:`Kirim`},"action.up":{en:`Up`,id:`Naik`},"action.down":{en:`Down`,id:`Turun`},"filter.all":{en:`Type: All`,id:`Tipe: Semua`},"filter.docs":{en:`Documents`,id:`Dokumen`},"filter.images":{en:`Images`,id:`Gambar`},"filter.videos":{en:`Videos`,id:`Video`},"filter.pdfs":{en:`PDFs`,id:`PDF`},"starred.empty_title":{en:`No starred files`,id:`Belum ada file berbintang`},"starred.empty_desc":{en:`Add stars to files that you want to easily find later.`,id:`Beri bintang pada file yang ingin Anda temukan dengan mudah nanti.`},"shared.title":{en:`Shared with me`,id:`Dibagikan kepada saya`},"shared.tab_files":{en:`Google Drive Files`,id:`File Google Drive`},"shared.tab_invites":{en:`Workspace Invites`,id:`Undangan Workspace`},"shared.items":{en:`items`,id:`item`},"shared.empty_title":{en:`No files shared with you`,id:`Tidak ada file yang dibagikan kepada Anda`},"shared.empty_desc":{en:`Files shared to your connected accounts will appear here.`,id:`File yang dibagikan ke akun terhubung Anda akan muncul di sini.`},"shared.sent_invites":{en:`Sent Invites`,id:`Undangan Terkirim`},"shared.received_invites":{en:`Received Invites`,id:`Undangan Diterima`},"shared.no_sent":{en:`No sent invites`,id:`Tidak ada undangan terkirim`},"shared.no_received":{en:`No pending invites received`,id:`Tidak ada undangan tertunda`},"activity.title":{en:`Activity Log`,id:`Log Aktivitas`},"activity.desc":{en:`Audit trail of file activities, moves, syncs, and deletions.`,id:`Jejak audit aktivitas file, pemindahan, sinkronisasi, dan penghapusan.`},"activity.trail_title":{en:`Recent Activity Trail`,id:`Jejak Aktivitas Terkini`},"activity.loading":{en:`Loading activity logs...`,id:`Memuat log aktivitas...`},"activity.empty_title":{en:`No activity yet`,id:`Belum ada aktivitas`},"activity.empty_desc":{en:`Actions you perform on files and folders will appear here.`,id:`Tindakan yang Anda lakukan pada file dan folder akan muncul di sini.`},"quota.title":{en:`Storage`,id:`Penyimpanan`},"quota.desc":{en:`Monitor combined Google Drive storage quota and routing.`,id:`Pantau gabungan kuota penyimpanan dan perutean Google Drive.`},"quota.auto_refresh":{en:`Auto-refresh`,id:`Segarkan Otomatis`},"quota.total_usage":{en:`Total Storage Usage`,id:`Total Penggunaan Penyimpanan`},"quota.of_used":{en:`of`,id:`dari`},"quota.used_label":{en:`used`,id:`terpakai`},"quota.free_label":{en:`free`,id:`tersedia`},"quota.connected_accounts":{en:`connected account(s)`,id:`akun terhubung`},"quota.routing_policy":{en:`Upload Routing Policy`,id:`Kebijakan Perutean Unggah`},"quota.routing_desc":{en:`Define which connected Google Drive account receives uploads.`,id:`Tentukan akun Google Drive mana yang diprioritaskan menerima berkas unggahan.`},"quota.mode_most_available":{en:`Most available free space`,id:`Ruang kosong terbanyak`},"quota.mode_round_robin":{en:`Round robin`,id:`Bergantian (Round robin)`},"quota.mode_priority":{en:`Priority order`,id:`Urutan prioritas`},"quota.no_accounts":{en:`No connected accounts yet.`,id:`Belum ada akun terhubung.`},"api_keys.title":{en:`API Keys`,id:`Kunci API`},"api_keys.desc":{en:`Manage programmatic API keys and webhook access.`,id:`Kelola kunci API dan akses webhook untuk integrasi otomatis.`},"api_keys.generate_btn":{en:`Generate New Key`,id:`Buat Kunci Baru`},"api_keys.docs_btn":{en:`Documentation`,id:`Dokumentasi`},"api_keys.env_var":{en:`API environment variable`,id:`Variabel lingkungan API`},"api_keys.table_name":{en:`Key Name`,id:`Nama Kunci`},"api_keys.table_created":{en:`Date Created`,id:`Tanggal Dibuat`},"api_keys.table_prefix":{en:`API Key (Prefix)`,id:`Kunci API (Awalan)`},"api_keys.table_secret":{en:`API Secret`,id:`Secret API`},"api_keys.table_status":{en:`Status`,id:`Status`},"api_keys.table_actions":{en:`Actions`,id:`Aksi`},"api_keys.empty_title":{en:`No API keys generated yet`,id:`Belum ada kunci API yang dibuat`},"api_keys.empty_desc":{en:`Click "Generate New Key" above to create one.`,id:`Klik "Buat Kunci Baru" di atas untuk membuatnya.`},"share_modal.title":{en:`Share`,id:`Bagikan`},"share_modal.add_people":{en:`Add people, groups, or calendar events`,id:`Tambahkan orang, grup, atau acara kalender`},"share_modal.people_with_access":{en:`People with access`,id:`Orang yang memiliki akses`},"share_modal.general_access":{en:`General access`,id:`Akses umum`},"share_modal.restricted":{en:`Restricted`,id:`Dibatasi`},"share_modal.anyone":{en:`Anyone with the link`,id:`Siapa saja yang memiliki link`},"share_modal.viewer":{en:`Viewer`,id:`Pelihat`},"share_modal.editor":{en:`Editor`,id:`Editor`},"share_modal.owner":{en:`Owner`,id:`Pemilik`},"share_modal.you":{en:`you`,id:`Anda`},"share_modal.copy_link":{en:`Copy link`,id:`Salin link`},"share_modal.link_copied":{en:`Link copied`,id:`Link disalin`},"share_modal.cascade_title":{en:`Change parent folder access to Restricted?`,id:`Ubah akses folder induk ke Restricted?`},"share_modal.cascade_desc":{en:`This file inherits public access from parent folder. Changing it to Restricted will make the parent folder and all files inside it Restricted as well.`,id:`File ini mewarisi hak akses publik dari folder induk. Mengubahnya ke Restricted akan membuat folder induk beserta seluruh file di dalamnya ikut menjadi Restricted.`},"share_modal.cascade_confirm":{en:`Change Parent Folder`,id:`Ubah Folder Induk`}},Mo=(0,v.createContext)(void 0),No=`9drive:language`;function Po({children:e}){let[t,n]=(0,v.useState)(()=>{try{let e=localStorage.getItem(No);if(e===`id`||e===`en`)return e}catch{}return`en`});return(0,U.jsx)(Mo.Provider,{value:{language:t,setLanguage:e=>{n(e);try{localStorage.setItem(No,e)}catch{}},t:(e,n)=>{let r=jo[e];return r&&r[t]?r[t]:n??e}},children:e})}function Fo(){let e=(0,v.useContext)(Mo);if(!e)throw Error(`useLanguage must be used within a LanguageProvider`);return e}function Io({kind:e,className:t}){let n=xo(`h-5 w-5 shrink-0 select-none`,t);return e===`pdf`?(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:n,fill:`none`,"aria-label":`PDF file`,children:[(0,U.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z`,fill:`#EA4335`}),(0,U.jsx)(`path`,{d:`M14 2v6h6l-6-6z`,fill:`#FAD2CF`}),(0,U.jsx)(`path`,{d:`M8 13h2a1.5 1.5 0 0 0 0-3H8v5m0-2h2m4-3v5m0-5h2a2 2 0 0 1 2 2v1a2 2 0 0 1-2 2h-2m-8 0v2m4-2v2`,stroke:`#FFFFFF`,strokeWidth:`1.2`,strokeLinecap:`round`,strokeLinejoin:`round`})]}):e===`image`?(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:n,fill:`none`,"aria-label":`Image file`,children:[(0,U.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z`,fill:`#EA4335`}),(0,U.jsx)(`path`,{d:`M14 2v6h6l-6-6z`,fill:`#FAD2CF`}),(0,U.jsx)(`circle`,{cx:`8.5`,cy:`12.5`,r:`1.5`,fill:`#FFFFFF`}),(0,U.jsx)(`path`,{d:`M6 18l4-4 2.5 2.5 3.5-4.5 4 6H6z`,fill:`#FFFFFF`})]}):e===`video`?(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:n,fill:`none`,"aria-label":`Video file`,children:[(0,U.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z`,fill:`#D93025`}),(0,U.jsx)(`path`,{d:`M14 2v6h6l-6-6z`,fill:`#FAD2CF`}),(0,U.jsx)(`polygon`,{points:`10 11 16 14.5 10 18 10 11`,fill:`#FFFFFF`})]}):e===`archive`?(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:n,fill:`none`,"aria-label":`Archive file`,children:[(0,U.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z`,fill:`#5F6368`}),(0,U.jsx)(`path`,{d:`M14 2v6h6l-6-6z`,fill:`#E8EAED`}),(0,U.jsx)(`rect`,{x:`10`,y:`10`,width:`4`,height:`2`,fill:`#FFFFFF`}),(0,U.jsx)(`rect`,{x:`10`,y:`13`,width:`4`,height:`2`,fill:`#FFFFFF`}),(0,U.jsx)(`rect`,{x:`10`,y:`16`,width:`4`,height:`3`,rx:`0.5`,fill:`#FFFFFF`})]}):(0,U.jsxs)(`svg`,{viewBox:`0 0 24 24`,className:n,fill:`none`,"aria-label":`Document file`,children:[(0,U.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z`,fill:`#4285F4`}),(0,U.jsx)(`path`,{d:`M14 2v6h6l-6-6z`,fill:`#D2E3FC`}),(0,U.jsx)(`line`,{x1:`8`,y1:`12`,x2:`16`,y2:`12`,stroke:`#FFFFFF`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,U.jsx)(`line`,{x1:`8`,y1:`15`,x2:`16`,y2:`15`,stroke:`#FFFFFF`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,U.jsx)(`line`,{x1:`8`,y1:`18`,x2:`13`,y2:`18`,stroke:`#FFFFFF`,strokeWidth:`1.5`,strokeLinecap:`round`})]})}function Lo(e){let t=new Date(e);if(isNaN(t.getTime()))return``;let n=new Date,r=t.getFullYear()===n.getFullYear();return t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,...r?{}:{year:`numeric`}})}function Ro({text:e,query:t}){if(!t.trim())return(0,U.jsx)(`span`,{children:e});let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`),r=RegExp(`(${n})`,`gi`);return(0,U.jsx)(`span`,{children:e.split(r).map((e,t)=>r.test(e)?(0,U.jsx)(`span`,{className:`font-semibold text-[#0B57D0] dark:text-[#A8C7FA]`,children:e},t):(0,U.jsx)(`span`,{children:e},t))})}function zo(e){return e.startsWith(`image/`)?`image`:e.startsWith(`video/`)?`video`:e.includes(`pdf`)?`pdf`:e.includes(`zip`)||e.includes(`rar`)||e.includes(`tar`)||e.includes(`7z`)||e.includes(`compressed`)?`archive`:`doc`}function Bo(){let e=tt(),[t]=Fn(),{accounts:n,selectedAccountId:r,getDriveLetter:i}=Ao(),{t:a}=Fo(),[o,s]=(0,v.useState)(t.get(`q`)??``),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)({files:[],folders:[]}),[m,h]=(0,v.useState)(-1),[g,_]=(0,v.useState)(`all`),[y,b]=(0,v.useState)(()=>r||`all`),[x,S]=(0,v.useState)(`all`),[C,w]=(0,v.useState)(null),[T,E]=(0,v.useState)(!1),[D,O]=(0,v.useState)(``),[k,A]=(0,v.useState)(``),j=(0,v.useRef)(null),M=(0,v.useRef)(null),N=(0,v.useRef)(null),[,P]=(0,v.useTransition)();(0,v.useEffect)(()=>{r&&!t.get(`accountId`)&&b(r)},[r,t]),(0,v.useEffect)(()=>{let e=t.get(`q`)??``;e!==o&&!c&&s(e)},[t]),(0,v.useEffect)(()=>{function e(e){j.current&&!j.current.contains(e.target)&&(l(!1),w(null))}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,v.useEffect)(()=>{if(!c)return;N.current&&clearTimeout(N.current);let e=o.trim();if(!e&&!(g!==`all`||y&&y!==`all`||x!==`all`)){p({files:[],folders:[]}),d(!1);return}return d(!0),N.current=setTimeout(async()=>{try{let t=new URLSearchParams;e&&t.set(`q`,e),g!==`all`&&t.set(`kind`,g),y&&y!==`all`&&t.set(`accountId`,y),x!==`all`&&t.set(`modified`,x),t.set(`limit`,`8`);let n=await W(`/files/suggestions?${t.toString()}`);P(()=>{p(n),h(-1)})}catch(e){console.error(`Failed to fetch search suggestions:`,e),p({files:[],folders:[]})}finally{d(!1)}},200),()=>{N.current&&clearTimeout(N.current)}},[o,g,y,x,c]);let F=[...f.folders.map(e=>({type:`folder`,item:e})),...f.files.map(e=>({type:`file`,item:e}))];function I(t){l(!1),w(null),e(`/all-files?${t.folderId?`folderId=${t.folderId}&`:``}previewFileId=${t.id}`),window.dispatchEvent(new CustomEvent(`9drive:preview-file`,{detail:{fileId:t.id}}))}function L(t){l(!1),w(null),e(`/all-files?folderId=${t.id}`)}function R(t){t&&t.preventDefault(),l(!1),w(null),E(!1);let n=new URLSearchParams,r=o.trim();if(r&&n.set(`q`,r),g!==`all`&&n.set(`kind`,g),y&&y!==`all`&&n.set(`accountId`,y),D){let e=Number(D)*1024*1024;!isNaN(e)&&e>0&&n.set(`minSize`,String(e))}if(k){let e=Number(k)*1024*1024;!isNaN(e)&&e>0&&n.set(`maxSize`,String(e))}e({pathname:`/all-files`,search:n.toString()})}function ee(e){if(e.key===`Escape`){l(!1),w(null);return}if(!c){(e.key===`ArrowDown`||e.key===`Enter`)&&l(!0);return}if(e.key===`ArrowDown`)e.preventDefault(),h(e=>e<F.length-1?e+1:0);else if(e.key===`ArrowUp`)e.preventDefault(),h(e=>e>0?e-1:F.length-1);else if(e.key===`Enter`)if(e.preventDefault(),m>=0&&F[m]){let e=F[m];e.type===`folder`?L(e.item):I(e.item)}else R()}function te(){s(``),M.current?.focus()}function ne(){_(`all`),b(r||`all`),S(`all`),O(``),A(``)}let re=n.find(e=>e.id===y),z=y===`all`?`All accounts`:re?`Drive ${i(re.id)} (${re.email.split(`@`)[0]})`:`Account`;return(0,U.jsxs)(`div`,{ref:j,className:`relative flex-1 max-w-2xl px-2`,children:[(0,U.jsxs)(`div`,{className:xo(`relative flex items-center h-12 w-full transition-all duration-200 ease-out`,c?`rounded-t-2xl bg-white shadow-[0_4px_24px_rgba(0,0,0,0.14)] dark:bg-[#1E1F20] dark:shadow-[0_8px_32px_rgba(0,0,0,0.6)] border-b border-[#E0E3E7] dark:border-[#36373A]`:`rounded-full bg-[#EDF2FC] hover:bg-[#E9EEF6] dark:bg-[#28292A] dark:hover:bg-[#333537]`),children:[(0,U.jsx)(`div`,{className:`flex h-full w-12 items-center justify-center text-[#444746] dark:text-[#C4C7C5]`,children:u?(0,U.jsx)(oi,{className:`h-4 w-4 animate-spin text-[#0B57D0] dark:text-[#A8C7FA]`}):(0,U.jsx)(Ti,{className:`h-5 w-5`})}),(0,U.jsx)(`input`,{ref:M,type:`text`,value:o,onFocus:()=>l(!0),onChange:e=>{s(e.target.value),c||l(!0)},onKeyDown:ee,placeholder:a(`search.placeholder`,`Search in Drive`),className:`h-full flex-1 bg-transparent text-sm text-[#1F1F1F] placeholder:text-[#444746] outline-none dark:text-[#E3E3E3] dark:placeholder:text-[#8E918F]`}),o?(0,U.jsx)(`button`,{type:`button`,onClick:te,className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10 mr-1`,title:`Clear search`,children:(0,U.jsx)(Hi,{className:`h-4 w-4`})}):null,(0,U.jsx)(`button`,{type:`button`,onClick:()=>{E(e=>!e),l(!0)},className:xo(`flex h-10 w-10 items-center justify-center rounded-full mr-1 text-[#444746] hover:bg-black/5 transition-colors dark:text-[#C4C7C5] dark:hover:bg-white/10`,T&&`text-[#0B57D0] bg-[#C2E7FF]/40 dark:text-[#A8C7FA]`),"aria-label":`Search options`,title:`Search options`,children:(0,U.jsx)(Ai,{className:`h-4 w-4`})})]}),c&&(0,U.jsxs)(`div`,{className:xo(`absolute left-2 right-2 top-12 z-50 bg-white shadow-[0_12px_36px_rgba(0,0,0,0.18)] dark:bg-[#1E1F20] dark:shadow-[0_16px_48px_rgba(0,0,0,0.7)]`,`rounded-b-2xl border-x border-b border-[#E0E3E7] dark:border-[#36373A]`),children:[(0,U.jsxs)(`div`,{className:`relative z-30 flex items-center gap-2 px-4 py-2.5 border-b border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] flex-wrap`,children:[(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>w(C===`type`?null:`type`),className:xo(`flex items-center gap-1.5 px-3 py-1 rounded-lg text-xs font-medium border transition-colors`,g===`all`?`border-[#747775]/40 text-[#444746] hover:bg-black/5 dark:border-[#8E918F]/40 dark:text-[#C4C7C5] dark:hover:bg-white/5`:`border-[#0B57D0] bg-[#C2E7FF]/30 text-[#0B57D0] dark:border-[#A8C7FA] dark:text-[#A8C7FA] dark:bg-[#004A77]/30`),children:[(0,U.jsx)(`span`,{children:{all:`Type`,doc:`Documents`,pdf:`PDFs`,image:`Images`,video:`Videos`,archive:`Archives`}[g]}),(0,U.jsx)(Sr,{className:`h-3 w-3`})]}),C===`type`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`fixed inset-0 z-40`,onClick:()=>w(null)}),(0,U.jsx)(`div`,{className:`absolute left-0 top-full mt-1.5 z-50 w-48 rounded-xl border border-[#E0E3E7] bg-white py-1.5 shadow-[0_8px_24px_rgba(0,0,0,0.18)] dark:border-[#36373A] dark:bg-[#28292A] dark:shadow-[0_12px_36px_rgba(0,0,0,0.8)]`,children:[{value:`all`,label:`All types`},{value:`doc`,label:`Documents`},{value:`pdf`,label:`PDFs`},{value:`image`,label:`Photos & images`},{value:`video`,label:`Videos`},{value:`archive`,label:`Archives`}].map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{_(e.value),w(null)},className:`flex w-full items-center justify-between px-3 py-1.5 text-xs text-[#1F1F1F] hover:bg-black/5 dark:text-[#E3E3E3] dark:hover:bg-white/5 text-left`,children:[(0,U.jsx)(`span`,{children:e.label}),g===e.value&&(0,U.jsx)(xr,{className:`h-3 w-3 text-[#0B57D0] dark:text-[#A8C7FA]`})]},e.value))})]})]}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>w(C===`account`?null:`account`),className:xo(`flex items-center gap-1.5 px-3 py-1 rounded-lg text-xs font-medium border transition-colors whitespace-nowrap`,y===`all`?`border-[#747775]/40 text-[#444746] hover:bg-black/5 dark:border-[#8E918F]/40 dark:text-[#C4C7C5] dark:hover:bg-white/5`:`border-[#0B57D0] bg-[#C2E7FF]/30 text-[#0B57D0] dark:border-[#A8C7FA] dark:text-[#A8C7FA] dark:bg-[#004A77]/30`),children:[(0,U.jsx)(Zr,{className:`h-3 w-3`}),(0,U.jsx)(`span`,{children:z}),(0,U.jsx)(Sr,{className:`h-3 w-3`})]}),C===`account`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`fixed inset-0 z-40`,onClick:()=>w(null)}),(0,U.jsxs)(`div`,{className:`absolute left-0 top-full mt-1.5 z-50 w-64 rounded-xl border border-[#E0E3E7] bg-white py-1.5 shadow-[0_8px_24px_rgba(0,0,0,0.18)] dark:border-[#36373A] dark:bg-[#28292A] dark:shadow-[0_12px_36px_rgba(0,0,0,0.8)] max-h-64 overflow-y-auto scrollbar-thin`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{b(`all`),w(null)},className:`flex w-full items-center justify-between px-3 py-1.5 text-xs text-[#1F1F1F] hover:bg-black/5 dark:text-[#E3E3E3] dark:hover:bg-white/5 text-left`,children:[(0,U.jsx)(`span`,{className:`font-medium`,children:`All accounts`}),y===`all`&&(0,U.jsx)(xr,{className:`h-3 w-3 text-[#0B57D0] dark:text-[#A8C7FA]`})]}),(0,U.jsx)(`div`,{className:`my-1 border-t border-[#E0E3E7] dark:border-[#36373A]`}),n.map(e=>{let t=i(e.id),n=y===e.id;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{b(e.id),w(null)},className:`flex w-full items-center justify-between px-3 py-1.5 text-xs text-[#1F1F1F] hover:bg-black/5 dark:text-[#E3E3E3] dark:hover:bg-white/5 text-left`,children:[(0,U.jsxs)(`div`,{className:`truncate pr-2`,children:[(0,U.jsxs)(`span`,{className:`font-semibold text-[#0B57D0] dark:text-[#A8C7FA] mr-1.5`,children:[`Drive `,t]}),(0,U.jsx)(`span`,{className:`text-[#444746] dark:text-[#C4C7C5]`,children:e.email})]}),n&&(0,U.jsx)(xr,{className:`h-3 w-3 shrink-0 text-[#0B57D0] dark:text-[#A8C7FA]`})]},e.id)})]})]})]}),(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>w(C===`modified`?null:`modified`),className:xo(`flex items-center gap-1.5 px-3 py-1 rounded-lg text-xs font-medium border transition-colors`,x===`all`?`border-[#747775]/40 text-[#444746] hover:bg-black/5 dark:border-[#8E918F]/40 dark:text-[#C4C7C5] dark:hover:bg-white/5`:`border-[#0B57D0] bg-[#C2E7FF]/30 text-[#0B57D0] dark:border-[#A8C7FA] dark:text-[#A8C7FA] dark:bg-[#004A77]/30`),children:[(0,U.jsx)(`span`,{children:{all:`Modified`,today:`Today`,"7d":`Last 7 days`,"30d":`Last 30 days`,year:`This year`}[x]}),(0,U.jsx)(Sr,{className:`h-3 w-3`})]}),C===`modified`&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`fixed inset-0 z-40`,onClick:()=>w(null)}),(0,U.jsx)(`div`,{className:`absolute left-0 top-full mt-1.5 z-50 w-48 rounded-xl border border-[#E0E3E7] bg-white py-1.5 shadow-[0_8px_24px_rgba(0,0,0,0.18)] dark:border-[#36373A] dark:bg-[#28292A] dark:shadow-[0_12px_36px_rgba(0,0,0,0.8)]`,children:[{value:`all`,label:`Any time`},{value:`today`,label:`Today`},{value:`7d`,label:`Last 7 days`},{value:`30d`,label:`Last 30 days`},{value:`year`,label:`This year`}].map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{S(e.value),w(null)},className:`flex w-full items-center justify-between px-3 py-1.5 text-xs text-[#1F1F1F] hover:bg-black/5 dark:text-[#E3E3E3] dark:hover:bg-white/5 text-left`,children:[(0,U.jsx)(`span`,{children:e.label}),x===e.value&&(0,U.jsx)(xr,{className:`h-3 w-3 text-[#0B57D0] dark:text-[#A8C7FA]`})]},e.value))})]})]}),(g!==`all`||y&&y!==r||x!==`all`)&&(0,U.jsx)(`button`,{type:`button`,onClick:ne,className:`text-xs text-[#0B57D0] hover:underline dark:text-[#A8C7FA] ml-auto shrink-0`,children:`Reset`})]}),T&&(0,U.jsxs)(`div`,{className:`px-5 py-4 bg-[#F8FAFD] dark:bg-[#28292A]/50 border-b border-[#E0E3E7] dark:border-[#36373A] space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-xs font-semibold text-[#1F1F1F] dark:text-[#E3E3E3] uppercase tracking-wider`,children:`Advanced Filters`}),(0,U.jsx)(`button`,{type:`button`,onClick:ne,className:`text-xs text-[#0B57D0] hover:underline dark:text-[#A8C7FA]`,children:`Clear all`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-[11px] text-[#444746] dark:text-[#C4C7C5] block mb-1`,children:`Min Size (MB)`}),(0,U.jsx)(`input`,{type:`number`,min:`0`,placeholder:`e.g. 10`,value:D,onChange:e=>O(e.target.value),className:`w-full h-8 px-2.5 rounded-lg border border-[#E0E3E7] bg-white text-xs text-[#1F1F1F] dark:border-[#36373A] dark:bg-[#1E1F20] dark:text-[#E3E3E3] outline-none`})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-[11px] text-[#444746] dark:text-[#C4C7C5] block mb-1`,children:`Max Size (MB)`}),(0,U.jsx)(`input`,{type:`number`,min:`0`,placeholder:`e.g. 500`,value:k,onChange:e=>A(e.target.value),className:`w-full h-8 px-2.5 rounded-lg border border-[#E0E3E7] bg-white text-xs text-[#1F1F1F] dark:border-[#36373A] dark:bg-[#1E1F20] dark:text-[#E3E3E3] outline-none`})]})]})]}),(0,U.jsx)(`div`,{className:`relative z-10 max-h-[360px] overflow-y-auto py-1 scrollbar-thin`,children:u&&F.length===0?(0,U.jsxs)(`div`,{className:`flex items-center justify-center gap-2 py-8 text-xs text-[#444746] dark:text-[#8E918F]`,children:[(0,U.jsx)(oi,{className:`h-4 w-4 animate-spin text-[#0B57D0] dark:text-[#A8C7FA]`}),(0,U.jsx)(`span`,{children:`Searching in Drive...`})]}):F.length===0?(0,U.jsx)(`div`,{className:`py-8 text-center text-xs text-[#444746] dark:text-[#8E918F]`,children:o.trim()||g!==`all`||y!==`all`?`No matching files or folders found.`:`Start typing to search files, folders, or archives...`}):(0,U.jsxs)(`div`,{className:`divide-y divide-transparent`,children:[f.folders.map((e,t)=>{let n=m===t,r=e.connectedAccount?i(e.connectedAccount.id):``;return(0,U.jsxs)(`div`,{onClick:()=>L(e),className:xo(`flex items-center justify-between px-4 py-2.5 cursor-pointer transition-colors select-none`,n?`bg-[#C2E7FF]/40 dark:bg-[#004A77]/40`:`hover:bg-black/5 dark:hover:bg-white/5`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 pr-3`,children:[(0,U.jsx)(Yr,{className:`h-5 w-5 shrink-0 text-[#444746] dark:text-[#C4C7C5]`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`p`,{className:`text-sm font-normal text-[#1F1F1F] dark:text-[#E3E3E3] truncate`,children:(0,U.jsx)(Ro,{text:e.name,query:o})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-[#444746] dark:text-[#8E918F]`,children:[r&&(0,U.jsxs)(`span`,{className:`font-medium text-[#0B57D0] dark:text-[#A8C7FA]`,children:[`Drive `,r]}),e.connectedAccount?.email&&(0,U.jsxs)(`span`,{children:[`• `,e.connectedAccount.email]})]})]})]}),(0,U.jsx)(`span`,{className:`text-xs text-[#444746] dark:text-[#8E918F] shrink-0`,children:Lo(e.updatedAt)})]},`folder-${e.id}`)}),f.files.map((e,t)=>{let n=m===f.folders.length+t,r=e.connectedAccount?i(e.connectedAccount.id):``,a=e.connectedAccount?.displayName||e.connectedAccount?.email?.split(`@`)[0]||e.connectedAccount?.email||``;return(0,U.jsxs)(`div`,{onClick:()=>I(e),className:xo(`flex items-center justify-between px-4 py-2.5 cursor-pointer transition-colors select-none`,n?`bg-[#C2E7FF]/40 dark:bg-[#004A77]/40`:`hover:bg-black/5 dark:hover:bg-white/5`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 pr-3`,children:[(0,U.jsx)(Io,{kind:zo(e.mimeType),className:`h-5 w-5 shrink-0`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`p`,{className:`text-sm font-normal text-[#1F1F1F] dark:text-[#E3E3E3] truncate`,children:(0,U.jsx)(Ro,{text:e.name,query:o})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-[#444746] dark:text-[#8E918F]`,children:[a&&(0,U.jsx)(`span`,{children:a}),r&&(0,U.jsxs)(`span`,{className:`font-medium text-[#0B57D0] dark:text-[#A8C7FA]`,children:[`[Drive `,r,`]`]}),e.folder?.name&&(0,U.jsxs)(`span`,{className:`truncate max-w-[120px]`,children:[`• in `,e.folder.name]})]})]})]}),(0,U.jsx)(`span`,{className:`text-xs text-[#444746] dark:text-[#8E918F] shrink-0`,children:Lo(e.updatedAt)})]},`file-${e.id}`)})]})}),(0,U.jsxs)(`div`,{className:`relative z-10 flex items-center justify-between px-4 py-3 border-t border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#1E1F20] rounded-b-2xl`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>E(e=>!e),className:`text-xs font-medium text-[#0B57D0] hover:underline dark:text-[#A8C7FA]`,children:T?`Hide options`:`Advanced search`}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>R(),className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-[#1F1F1F] hover:bg-black/5 dark:text-[#E3E3E3] dark:hover:bg-white/5 transition-colors`,children:[(0,U.jsx)(`span`,{children:`All results`}),(0,U.jsx)(Pr,{className:`h-3 w-3 text-[#444746] dark:text-[#C4C7C5]`})]})]})]})]})}var Vo=(0,v.createContext)(void 0);function Ho({children:e}){let[t,n]=(0,v.useState)({open:!1,fileName:``,percent:0,status:`uploading`,files:[]}),[r,i]=(0,v.useState)({});async function a(e,t,n,r,a){let o=r||``,s=0;if(i(n=>({...n,[e.name]:{sessionId:o,file:e,folderId:t,targetAccountId:a}})),!o)o=(await W(`/uploads/resumable/init`,{method:`POST`,body:JSON.stringify({fileName:e.name,mimeType:e.type||`application/octet-stream`,sizeBytes:String(e.size),folderId:t||void 0,targetAccountId:a||void 0})})).sessionId,i(n=>({...n,[e.name]:{sessionId:o,file:e,folderId:t,targetAccountId:a}}));else{let e=await W(`/uploads/resumable/status/${o}`);if(s=Number(e.offset),e.status===`completed`){n(100);return}}for(;s<e.size;){let t=Math.min(s+5242880,e.size),r=e.slice(s,t),i=await fetch(`/uploads/resumable/chunk/${o}`,{method:`PUT`,headers:{Authorization:`Bearer ${Yn()}`,"Content-Range":`bytes ${s}-${t-1}/${e.size}`,"Content-Length":String(r.size)},body:r});if(!i.ok)throw Error(`Chunk upload failed`);let a=await i.json();if(a.status===`completed`){n(100);break}s=Number(a.offset),n(Math.min(99,Math.round(s/e.size*100)))}}async function o(e,t,r){if(e.length!==0){n({open:!0,fileName:e.length===1?e[0].name:`${e.length} files`,percent:0,status:`uploading`,files:e.map(e=>({name:e.name,size:e.size,percent:0,status:`uploading`}))});for(let i=0;i<e.length;i++){let o=e[i];try{await a(o,t,e=>{n(t=>{let n=[...t.files];n[i]&&(n[i]={...n[i],percent:e,status:e>=100?`done`:`uploading`});let r=Math.round(n.reduce((e,t)=>e+t.percent,0)/n.length),a=n.every(e=>e.status===`done`||e.percent>=100);return{...t,percent:r,status:a?`done`:t.status,files:n}})},void 0,r)}catch(e){console.error(`File upload failed:`,o.name,e),n(e=>{let t=[...e.files];return t[i]&&(t[i]={...t[i],status:`error`}),{...e,status:`partial`,files:t}})}}n(e=>{let t=e.files.some(e=>e.status===`error`);return{...e,percent:100,status:t?`partial`:`done`,files:e.files.map(e=>({...e,percent:e.status===`error`?e.percent:100,status:e.status===`error`?`error`:`done`}))}}),window.dispatchEvent(new Event(`9drive:storage-changed`)),window.dispatchEvent(new Event(`9drive:upload-completed`))}}async function s(e){let i=r[e];if(i){n(t=>{let n=t.files.map(t=>t.name===e?{...t,status:`uploading`}:t);return{...t,status:`uploading`,files:n}});try{let r=t.files.findIndex(t=>t.name===e);await a(i.file,i.folderId||null,e=>{n(t=>{let n=[...t.files];n[r]&&(n[r]={...n[r],percent:e,status:e>=100?`done`:`uploading`});let i=Math.round(n.reduce((e,t)=>e+t.percent,0)/n.length),a=n.every(e=>e.status===`done`);return{...t,percent:i,status:a?`done`:`uploading`,files:n}})},i.sessionId,i.targetAccountId),window.dispatchEvent(new Event(`9drive:storage-changed`)),window.dispatchEvent(new Event(`9drive:upload-completed`))}catch(t){console.error(`Retry upload failed:`,e,t),n(t=>{let n=t.files.map(t=>t.name===e?{...t,status:`error`}:t);return{...t,status:`partial`,files:n}})}}}return(0,U.jsx)(Vo.Provider,{value:{uploadProgress:t,setUploadProgress:n,uploadFiles:o,retryFailedUpload:s},children:e})}function Uo(){let e=(0,v.useContext)(Vo);if(e===void 0)throw Error(`useUpload must be used within an UploadProvider`);return e}async function Wo(e,t){let n=e?.trim().toLowerCase(),r=n??`default-user`,i=``;if(typeof crypto<`u`&&crypto.subtle)try{let e=await crypto.subtle.digest(`SHA-256`,new TextEncoder().encode(r));i=Array.from(new Uint8Array(e),e=>e.toString(16).padStart(2,`0`)).join(``)}catch{i=Go(r)}else i=Go(r);if(n&&i.length===64){let e=`https://www.gravatar.com/avatar/${i}?s=${t}&d=404`;try{if((await fetch(e,{method:`HEAD`})).ok)return e}catch{}}return`https://api.dicebear.com/8.x/bottts/svg?seed=${encodeURIComponent(i)}&size=${t}&backgroundColor=b6e3f4,c0aede,d1f4cc,ffdfbf,ffd5dc`}function Go(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return Math.abs(t).toString(36)}function Ko({className:e}){return(0,U.jsxs)(`svg`,{viewBox:`0 0 87.3 78`,className:e,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`m6.6 66.85 3.85 6.65c.8 1.4 1.95 2.5 3.3 3.3l13.75-23.8H0c0 1.55.4 3.1 1.2 4.5z`,fill:`#0066da`}),(0,U.jsx)(`path`,{d:`M43.65 25 29.9 1.2c-1.35.8-2.5 1.9-3.3 3.3l-25.4 44C.4 49.9 0 51.45 0 53h27.5z`,fill:`#00ac47`}),(0,U.jsx)(`path`,{d:`M73.55 76.8c1.35-.8 2.5-1.9 3.3-3.3l1.6-2.75 7.65-13.25c.8-1.4 1.2-2.95 1.2-4.5H59.8l5.85 10.1z`,fill:`#ea4335`}),(0,U.jsx)(`path`,{d:`M43.65 25 57.4 1.2C56.05.4 54.5 0 52.9 0H34.4c-1.6 0-3.15.45-4.5 1.2z`,fill:`#00832d`}),(0,U.jsx)(`path`,{d:`M59.8 53H27.5L13.75 76.8c1.35.8 2.9 1.2 4.5 1.2h50.8c1.6 0 3.15-.45 4.5-1.2z`,fill:`#2684fc`}),(0,U.jsx)(`path`,{d:`m73.4 26.5-12.7-22c-.8-1.4-1.95-2.5-3.3-3.3L43.65 25 59.8 53h27.5c0-1.55-.4-3.1-1.2-4.5z`,fill:`#ffba00`})]})}function qo({className:e}){let t=tt(),{accounts:n,selectedAccountId:r,setSelectedAccountId:i,defaultAccountId:a,activeAccount:o,isAll:s}=Ao(),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(``),f=(0,v.useRef)(null),p=(0,v.useRef)(null);(0,v.useEffect)(()=>{c?setTimeout(()=>{p.current?.focus()},50):d(``)},[c]),(0,v.useEffect)(()=>{function e(e){f.current&&!f.current.contains(e.target)&&l(!1)}if(c)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[c]);let m=(0,v.useMemo)(()=>{let e=u.trim().toLowerCase();return e?n.filter(t=>{let n=t.email.toLowerCase(),r=t.provider.toLowerCase(),i=(t.displayName||``).toLowerCase();return n.includes(e)||r.includes(e)||i.includes(e)}):n},[n,u]);function h(e){i(e),l(!1)}let g=s?`Semua Akun`:o?.email??`Pilih Akun`;return(0,U.jsxs)(`div`,{className:xo(`relative inline-block text-left`,e),ref:f,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>l(!c),className:xo(`group flex h-10 items-center gap-2 rounded-full border border-[#E0E3E7] bg-white px-3.5 text-xs font-normal transition-all duration-150 hover:bg-[#F0F4F9] hover:border-[#C4C7C5] active:scale-[0.98] dark:border-[#36373A] dark:bg-[#1E1F20] dark:hover:bg-[#28292A] dark:hover:border-[#444746]`,c&&`border-[#0B57D0] ring-2 ring-[#0B57D0]/15 dark:border-[#A8C7FA]`),title:g,"aria-haspopup":`listbox`,"aria-expanded":c,children:[s?(0,U.jsx)(`div`,{className:`flex h-5 w-5 items-center justify-center rounded-full bg-[#E8F0FE] text-[#0B57D0] dark:bg-[#004A77] dark:text-[#C2E7FF]`,children:(0,U.jsx)(ni,{className:`h-3.5 w-3.5`})}):(0,U.jsx)(Ko,{className:`h-4 w-4 shrink-0`}),(0,U.jsx)(`span`,{className:`truncate max-w-[150px] sm:max-w-[190px] text-[#1F1F1F] dark:text-[#E3E3E3]`,children:g}),(0,U.jsx)(Sr,{className:xo(`h-4 w-4 text-[#747775] transition-transform duration-200 dark:text-[#8E918F]`,c&&`rotate-180 text-[#0B57D0] dark:text-[#A8C7FA]`)})]}),c&&(0,U.jsxs)(`div`,{className:`absolute right-0 top-12 z-50 w-72 sm:w-80 origin-top-right rounded-2xl border border-[#E0E3E7] bg-white shadow-xl dark:border-[#36373A] dark:bg-[#1E1F20] animate-m3-popover overflow-hidden`,role:`listbox`,children:[(0,U.jsxs)(`div`,{className:`border-b border-[#E0E3E7] bg-[#F8FAFD] px-3.5 py-3 dark:border-[#36373A] dark:bg-[#28292A]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`p`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Pilih Akun Penyimpanan`}),(0,U.jsxs)(`span`,{className:`rounded-full bg-[#E0E3E7] px-2 py-0.5 text-[10px] font-medium text-[#444746] dark:bg-[#36373A] dark:text-[#C4C7C5]`,children:[n.length,` Akun`]})]}),(0,U.jsxs)(`div`,{className:`relative mt-2`,children:[(0,U.jsx)(Ti,{className:`absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-[#747775] dark:text-[#8E918F]`}),(0,U.jsx)(`input`,{ref:p,type:`text`,value:u,onChange:e=>d(e.target.value),placeholder:`Cari email akun...`,className:`h-8 w-full rounded-lg border border-[#E0E3E7] bg-white pl-8 pr-7 text-xs text-[#1F1F1F] placeholder:text-[#747775] outline-none focus:border-[#0B57D0] focus:ring-1 focus:ring-[#0B57D0] dark:border-[#444746] dark:bg-[#1E1F20] dark:text-[#E3E3E3] dark:placeholder:text-[#8E918F] dark:focus:border-[#A8C7FA]`}),u&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>d(``),className:`absolute right-2 top-1/2 -translate-y-1/2 text-[#747775] hover:text-[#1F1F1F] dark:text-[#8E918F] dark:hover:text-[#E3E3E3]`,title:`Hapus pencarian`,children:(0,U.jsx)(Hi,{className:`h-3.5 w-3.5`})})]})]}),(0,U.jsxs)(`div`,{className:`max-h-64 overflow-y-auto p-1.5 space-y-0.5`,children:[(!u||`semua akun all`.includes(u.toLowerCase()))&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>h(`all`),className:xo(`flex w-full items-center justify-between rounded-xl px-3 py-2 text-xs transition-colors text-left`,s?`bg-[#E8F0FE] text-[#0B57D0] font-medium dark:bg-[#004A77]/50 dark:text-[#C2E7FF]`:`text-[#1F1F1F] hover:bg-[#F0F4F9] dark:text-[#E3E3E3] dark:hover:bg-[#28292A]`),role:`option`,"aria-selected":s,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[(0,U.jsx)(`div`,{className:xo(`flex h-7 w-7 shrink-0 items-center justify-center rounded-full`,s?`bg-[#0B57D0] text-white dark:bg-[#A8C7FA] dark:text-[#003062]`:`bg-[#E0E3E7] text-[#444746] dark:bg-[#36373A] dark:text-[#C4C7C5]`),children:(0,U.jsx)(ni,{className:`h-3.5 w-3.5`})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`p`,{className:`font-normal truncate`,children:`Semua Akun`}),a===`all`&&(0,U.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.2 text-[9px] font-medium bg-[#E6F4EA] text-[#137333] dark:bg-[#0E3D1E] dark:text-[#A8DAB5]`,children:`Default`})]}),(0,U.jsx)(`p`,{className:`text-[10px] text-[#747775] dark:text-[#8E918F] truncate`,children:`Tampilkan seluruh file & folder`})]})]}),s&&(0,U.jsx)(xr,{className:`h-4 w-4 shrink-0 text-[#0B57D0] dark:text-[#A8C7FA]`})]}),(0,U.jsx)(`div`,{className:`my-1 border-t border-[#E0E3E7] dark:border-[#36373A]`}),m.length===0?(0,U.jsx)(`div`,{className:`px-3 py-4 text-center text-xs text-[#747775] dark:text-[#8E918F]`,children:`Tidak ada akun yang cocok`}):m.map(e=>{let t=r===e.id,n=a===e.id,i=e.storageAccount?.usedBytes,o=e.storageAccount?.totalBytes;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>h(e.id),className:xo(`flex w-full items-center justify-between rounded-xl px-3 py-2 text-xs transition-colors text-left group`,t?`bg-[#E8F0FE] text-[#0B57D0] dark:bg-[#004A77]/50 dark:text-[#C2E7FF]`:`text-[#1F1F1F] hover:bg-[#F0F4F9] dark:text-[#E3E3E3] dark:hover:bg-[#28292A]`),role:`option`,"aria-selected":t,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0 flex-1 pr-2`,children:[(0,U.jsx)(`div`,{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-[#F0F4F9] dark:bg-[#28292A]`,children:(0,U.jsx)(Ko,{className:`h-3.5 w-3.5`})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(`p`,{className:`font-normal truncate text-[#1F1F1F] dark:text-[#E3E3E3]`,children:e.email}),n&&(0,U.jsx)(`span`,{className:`shrink-0 rounded px-1.5 py-0.2 text-[9px] font-medium bg-[#E6F4EA] text-[#137333] dark:bg-[#0E3D1E] dark:text-[#A8DAB5]`,children:`Default`})]}),o&&(0,U.jsxs)(`p`,{className:`text-[10px] text-[#747775] dark:text-[#8E918F] truncate`,children:[wo(i),` dari `,wo(o)]})]})]}),t&&(0,U.jsx)(xr,{className:`h-4 w-4 shrink-0 text-[#0B57D0] dark:text-[#A8C7FA]`})]},e.id)})]}),(0,U.jsx)(`div`,{className:`border-t border-[#E0E3E7] bg-[#F8FAFD] p-2 dark:border-[#36373A] dark:bg-[#28292A]`,children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{l(!1),t(`/settings`)},className:`flex w-full items-center justify-center gap-1.5 rounded-lg py-1.5 text-xs text-[#444746] hover:bg-[#E9EEF6] dark:text-[#C4C7C5] dark:hover:bg-[#36373A]`,children:[(0,U.jsx)(Ei,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:`Kelola Akun di Pengaturan`})]})})]})]})}var Jo=[{key:`nav.my_drive`,defaultLabel:`My Drive`,icon:Zr,href:`/all-files`},{key:`nav.tools`,defaultLabel:`Tools Studio`,icon:ji,href:`/tools`},{key:`nav.shared`,defaultLabel:`Shared with me`,icon:Oi,href:`/shared`},{key:`nav.recent`,defaultLabel:`Recent`,icon:Qr,href:`/recent`},{key:`nav.starred`,defaultLabel:`Starred`,icon:Ni,href:`/starred`},{key:`nav.trash`,defaultLabel:`Trash`,icon:Fi,href:`/trash`},{key:`nav.storage`,defaultLabel:`Storage`,icon:jr,href:`/quota`},{key:`nav.activity`,defaultLabel:`Activity`,icon:Qr,href:`/activity`},{key:`nav.settings`,defaultLabel:`Settings`,icon:Di,href:`/settings`},{key:`nav.api_keys`,defaultLabel:`API Keys`,icon:Mr,href:`/api`}];function Yo(){return it()}function Xo({storage:e,onClose:t}){let n=e?.accounts?.filter(e=>e.provider===`google_drive`&&e.status===`connected`)??[];return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`fixed inset-0 z-40`,onClick:t}),(0,U.jsxs)(`div`,{className:`absolute right-0 top-12 z-50 w-80 overflow-hidden rounded-2xl border border-[#E0E3E7] bg-white shadow-xl dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`div`,{className:`border-b border-[#E0E3E7] px-4 py-3 bg-[#F8FAFD] dark:border-[#36373A] dark:bg-[#28292A]`,children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`System Status & Info`}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:`Storage gateway overview`})]}),(0,U.jsxs)(`div`,{className:`max-h-80 overflow-y-auto p-4 space-y-3.5 text-xs text-[#444746] dark:text-[#C4C7C5]`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h4`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5 mb-1.5`,children:[(0,U.jsx)(ki,{className:`h-4 w-4 text-[#0F9D58]`}),` Connected Accounts`]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-[#F8FAFD] p-2.5 border border-[#E0E3E7] dark:bg-[#28292A] dark:border-[#36373A]`,children:[(0,U.jsxs)(`span`,{className:`font-medium`,children:[n.length,` Google Drive account(s) connected`]}),n.map(e=>(0,U.jsxs)(`p`,{className:`text-[11px] text-[#747775] truncate mt-0.5`,children:[`• `,e.email]},e.id))]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`h4`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5 mb-1.5`,children:[(0,U.jsx)(jr,{className:`h-4 w-4 text-[#0B57D0]`}),` Storage Engine`]}),(0,U.jsxs)(`div`,{className:`rounded-lg bg-[#F8FAFD] p-2.5 border border-[#E0E3E7] dark:bg-[#28292A] dark:border-[#36373A] space-y-1 text-[11px]`,children:[(0,U.jsxs)(`p`,{children:[`• `,(0,U.jsx)(`b`,{children:`Storage Folder:`}),` `,(0,U.jsx)(`code`,{children:`9drive`}),` on Google Drive`]}),(0,U.jsxs)(`p`,{children:[`• `,(0,U.jsx)(`b`,{children:`Max Upload:`}),` 5 GB per file stream`]}),(0,U.jsxs)(`p`,{children:[`• `,(0,U.jsx)(`b`,{children:`Direct Streaming:`}),` No local disk caching`]})]})]})]})]})]})}function Zo({onNewFolder:e,onUploadFile:t}){let[n,r]=(0,v.useState)(!1),i=(0,v.useRef)(null),{t:a}=Fo();return(0,v.useEffect)(()=>{function e(e){i.current&&!i.current.contains(e.target)&&r(!1)}if(n)return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[n]),(0,U.jsxs)(`div`,{className:`relative mb-4 px-2`,ref:i,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>r(!n),className:`flex h-14 items-center gap-3 rounded-2xl bg-white px-5 text-sm font-medium text-[#1F1F1F] shadow-[0_1px_3px_0_rgba(60,64,67,0.3),0_4px_8px_3px_rgba(60,64,67,0.15)] transition-all duration-200 ease-[cubic-bezier(0.05,0.7,0.1,1.0)] hover:shadow-[0_2px_6px_2px_rgba(60,64,67,0.15),0_1px_2px_0_rgba(60,64,67,0.3)] hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.97] dark:bg-[#28292A] dark:text-[#E3E3E3] dark:shadow-none dark:border dark:border-[#36373A]`,"aria-expanded":n,"aria-label":`Create new item`,children:[(0,U.jsxs)(`svg`,{viewBox:`0 0 36 36`,className:`h-8 w-8 shrink-0`,children:[(0,U.jsx)(`path`,{fill:`#4285F4`,d:`M16 16v14h4V16h14v-4H20V-2h-4v14H2v4h14z`}),(0,U.jsx)(`path`,{fill:`#FBBC05`,d:`M30 16H20l-4-4V-2h4v14h10v4z`}),(0,U.jsx)(`path`,{fill:`#4285F4`,d:`M-2 16h18v4H-2z`,opacity:`0`}),(0,U.jsx)(`path`,{fill:`#34A853`,d:`M16 30h4v-14h-4z`}),(0,U.jsx)(`path`,{fill:`#EA4335`,d:`M2 16h14v-4H2z`})]}),(0,U.jsx)(`span`,{className:`text-sm font-medium pr-1`,children:a(`action.new`,`New`)})]}),n&&(0,U.jsxs)(`div`,{className:`absolute left-2 top-16 z-50 w-52 overflow-hidden rounded-2xl border border-[#E0E3E7] bg-white py-1.5 shadow-[0_8px_32px_rgba(0,0,0,0.12)] dark:border-[#36373A] dark:bg-[#1E1F20] dark:shadow-[0_12px_36px_rgba(0,0,0,0.6)] animate-m3-popover`,children:[(0,U.jsxs)(`button`,{type:`button`,className:`flex h-10 w-full items-center gap-3 px-4 text-xs font-normal text-[#1F1F1F] transition-all duration-150 active:scale-[0.98] hover:bg-[#F0F4F9] dark:text-[#E3E3E3] dark:hover:bg-[#28292A]`,onClick:()=>{r(!1),e()},children:[(0,U.jsx)(Jr,{className:`h-4 w-4 text-[#444746] dark:text-[#C4C7C5]`}),(0,U.jsx)(`span`,{children:a(`action.new_folder`,`New folder`)})]}),(0,U.jsx)(`div`,{className:`my-1 h-px bg-[#E0E3E7] dark:bg-[#36373A]`}),(0,U.jsxs)(`button`,{type:`button`,className:`flex h-10 w-full items-center gap-3 px-4 text-xs font-normal text-[#1F1F1F] transition-all duration-150 active:scale-[0.98] hover:bg-[#F0F4F9] dark:text-[#E3E3E3] dark:hover:bg-[#28292A]`,onClick:()=>{r(!1),t()},children:[(0,U.jsx)(Li,{className:`h-4 w-4 text-[#444746] dark:text-[#C4C7C5]`}),(0,U.jsx)(`span`,{children:a(`action.file_upload`,`File upload`)})]})]})]})}function Qo({onNavigate:e,user:t,storage:n,onLogout:r,onNewFolder:i,onUploadFile:a}){let{t:o,language:s}=Fo(),c=Number(n?.usedBytes??0),l=Number(n?.totalBytes??0),u=l>0?Math.min(100,c/l*100):0;return(0,U.jsxs)(`aside`,{className:`flex h-full w-64 flex-col bg-[#F8FAFD] p-3 dark:bg-[#131314]`,children:[(0,U.jsx)(Zo,{onNewFolder:i,onUploadFile:a}),(0,U.jsx)(`nav`,{className:`space-y-0.5 px-1`,children:Jo.map(t=>(0,U.jsxs)(On,{to:t.href,onClick:e,className:({isActive:e})=>xo(`flex h-10 items-center gap-4 rounded-full px-4 text-sm font-medium transition-all duration-200 ease-[cubic-bezier(0.05,0.7,0.1,1.0)] active:scale-[0.98] select-none`,e?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#E9EEF6] dark:text-[#C4C7C5] dark:hover:bg-[#28292A]`),children:[(0,U.jsx)(t.icon,{className:`h-5 w-5 shrink-0`}),(0,U.jsx)(`span`,{className:`truncate`,children:o(t.key,t.defaultLabel)})]},t.key))}),(0,U.jsxs)(`div`,{className:`mt-auto px-3 pt-4 border-t border-[#E0E3E7]/60 dark:border-[#36373A]/60`,children:[(0,U.jsxs)(On,{to:`/quota`,onClick:e,className:`group block rounded-xl p-2 transition-colors hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs font-medium text-[#444746] dark:text-[#C4C7C5]`,children:[(0,U.jsx)(jr,{className:`h-4 w-4 text-[#0B57D0]`}),(0,U.jsx)(`span`,{children:o(`nav.storage`,`Storage`)})]}),(0,U.jsx)(`div`,{className:`mt-2 h-1 w-full rounded-full bg-[#E0E3E7] dark:bg-[#36373A] overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full rounded-full bg-[#0B57D0] transition-all duration-300`,style:{width:`${u}%`}})}),(0,U.jsxs)(`p`,{className:`mt-1.5 text-xs text-[#747775] dark:text-[#8E918F]`,children:[wo(n?.usedBytes),` `,s===`id`?`dari`:`of`,` `,wo(n?.totalBytes),` `,s===`id`?`terpakai`:`used`]}),(0,U.jsx)(`span`,{className:`mt-1 inline-block text-xs font-medium text-[#0B57D0] group-hover:underline dark:text-[#A8C7FA]`,children:s===`id`?`Kelola penyimpanan`:`Manage storage`})]}),(0,U.jsxs)(`div`,{className:`mt-3 flex items-center justify-between pt-2 border-t border-[#E0E3E7]/40 dark:border-[#36373A]/40`,children:[(0,U.jsxs)(`div`,{className:`min-w-0 flex-1 pr-2`,children:[(0,U.jsx)(`p`,{className:`truncate text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:t?.name??`User`}),(0,U.jsx)(`p`,{className:`truncate text-[11px] text-[#747775] dark:text-[#8E918F]`,children:t?.email})]}),(0,U.jsx)(`button`,{type:`button`,onClick:r,title:o(`nav.sign_out`,`Sign out`),className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-[#F0F4F9] hover:text-[#B3261E] dark:text-[#C4C7C5] dark:hover:bg-[#28292A]`,children:(0,U.jsx)(ci,{className:`h-4 w-4`})})]})]})]})}function $o(){let e=tt(),t=Qe(),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(Zn()),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(null),{uploadProgress:f,setUploadProgress:p,retryFailedUpload:m}=Uo(),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(``),[b,x]=(0,v.useState)(!1),{language:S,setLanguage:C}=Fo();(0,v.useEffect)(()=>{if(f.open&&(f.status===`done`||f.percent>=100&&f.files.length>0&&f.files.every(e=>e.status===`done`||e.percent>=100))){let e=setTimeout(()=>{p(e=>({...e,open:!1}))},2e3);return()=>clearTimeout(e)}},[f.open,f.status,f.percent,f.files,p]);let[w,T]=(0,v.useState)(()=>{let e=localStorage.getItem(`9drive:theme`);return e===`light`||e===`dark`?e:`light`});(0,v.useEffect)(()=>{let e=document.documentElement;w===`dark`?(e.classList.add(`dark`),e.classList.remove(`light`)):(e.classList.add(`light`),e.classList.remove(`dark`)),localStorage.setItem(`9drive:theme`,w)},[w]);function E(){T(e=>e===`light`?`dark`:`light`)}(0,v.useEffect)(()=>{i?.email&&(x(!1),Wo(i.email,64).then(y).catch(()=>y(``)))},[i?.email]);async function D(){await W(`/storage/summary`).then(s).catch(()=>void 0)}(0,v.useEffect)(()=>(W(`/auth/me`).then(e=>{a(e.user),$n(e.user)}).catch(()=>void 0),D(),window.addEventListener(`9drive:storage-changed`,D),()=>window.removeEventListener(`9drive:storage-changed`,D)),[]);async function O(){await W(`/auth/logout`,{method:`POST`}).catch(()=>void 0),tr(),e(`/login`)}function k(){t.pathname===`/all-files`?window.dispatchEvent(new CustomEvent(`9drive:open-new-folder`)):(e(`/all-files`),setTimeout(()=>{window.dispatchEvent(new CustomEvent(`9drive:open-new-folder`))},100))}function A(){t.pathname===`/all-files`?window.dispatchEvent(new CustomEvent(`9drive:open-upload`)):(e(`/all-files`),setTimeout(()=>{window.dispatchEvent(new CustomEvent(`9drive:open-upload`))},100))}return(0,U.jsxs)(`div`,{className:`flex h-screen w-full flex-col overflow-hidden bg-[#F8FAFD] dark:bg-[#131314]`,children:[(0,U.jsxs)(`header`,{className:`flex h-16 w-full shrink-0 items-center justify-between px-4 bg-[#F8FAFD] dark:bg-[#131314] z-20`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 w-60 shrink-0`,children:[(0,U.jsx)(`button`,{type:`button`,className:`flex h-10 w-10 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10 lg:hidden`,onClick:()=>r(!0),"aria-label":`Open sidebar`,children:(0,U.jsx)(di,{className:`h-5 w-5`})}),(0,U.jsxs)(`div`,{onClick:()=>e(`/all-files`),className:`flex items-center gap-2.5 cursor-pointer select-none`,children:[(0,U.jsx)(So,{className:`h-10 w-10 shrink-0`}),(0,U.jsx)(`span`,{className:`text-[22px] font-normal tracking-tight text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`9Drive`})]})]}),(0,U.jsx)(Bo,{}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0`,children:[(0,U.jsx)(qo,{}),u?(0,U.jsx)(`div`,{className:`hidden lg:flex items-center gap-2 mr-1`,children:u}):null,(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(`button`,{type:`button`,className:`flex h-10 w-10 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,onClick:()=>l(!c),"aria-label":`Support & Info`,children:(0,U.jsx)(Dr,{className:`h-5 w-5`})}),c&&(0,U.jsx)(Xo,{storage:o,onClose:()=>l(!1)})]}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-10 w-10 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,onClick:()=>e(`/settings`),"aria-label":`Settings`,children:(0,U.jsx)(Di,{className:`h-5 w-5`})}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-10 w-10 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,onClick:E,"aria-label":`Toggle theme`,children:w===`light`?(0,U.jsx)(pi,{className:`h-5 w-5`}):(0,U.jsx)(Pi,{className:`h-5 w-5`})}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>C(S===`en`?`id`:`en`),className:`flex h-8 items-center gap-1.5 rounded-full border border-[#E0E3E7] px-2.5 text-[11px] font-semibold text-[#444746] transition-colors hover:bg-black/5 dark:border-[#36373A] dark:text-[#C4C7C5] dark:hover:bg-white/10 select-none`,"aria-label":`Toggle language`,title:S===`en`?`Ganti ke Bahasa Indonesia`:`Switch to English`,children:[(0,U.jsx)(Xr,{className:`h-3.5 w-3.5 text-[#0B57D0] dark:text-[#A8C7FA]`}),(0,U.jsx)(`span`,{className:`uppercase tracking-wider`,children:S})]}),(0,U.jsx)(`div`,{className:`ml-1 pl-1`,children:!_||b?(0,U.jsx)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-[#0B57D0] text-xs font-medium text-white shadow-sm`,children:(i?.name??i?.email??`U`).trim().charAt(0).toUpperCase()}):(0,U.jsx)(`img`,{src:_,alt:`Profile`,className:`h-9 w-9 rounded-full object-cover border border-[#E0E3E7] dark:border-[#36373A]`,onError:()=>x(!0)})})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-1 min-h-0 w-full overflow-hidden`,children:[(0,U.jsx)(`div`,{className:`hidden lg:block lg:h-full lg:shrink-0`,children:(0,U.jsx)(Qo,{user:i,storage:o,onLogout:O,onNewFolder:k,onUploadFile:A})}),(0,U.jsx)(`div`,{className:xo(`fixed inset-0 z-40 bg-black/32 transition-opacity lg:hidden`,n?`opacity-100`:`pointer-events-none opacity-0`),onClick:()=>r(!1)}),(0,U.jsxs)(`div`,{className:xo(`fixed inset-y-0 left-0 z-50 w-64 transform bg-[#F8FAFD] shadow-2xl transition-transform duration-200 ease-out lg:hidden dark:bg-[#131314]`,n?`translate-x-0`:`-translate-x-full`),children:[(0,U.jsxs)(`div`,{className:`flex h-16 items-center justify-between px-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(So,{className:`h-8 w-8`}),(0,U.jsx)(`span`,{className:`text-xl font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`9Drive`})]}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5]`,onClick:()=>r(!1),children:(0,U.jsx)(Hi,{className:`h-5 w-5`})})]}),(0,U.jsx)(Qo,{user:i,storage:o,onLogout:O,onNavigate:()=>r(!1),onNewFolder:()=>{r(!1),k()},onUploadFile:()=>{r(!1),A()}})]}),(0,U.jsx)(`div`,{className:`flex-1 min-w-0 p-0 sm:pr-4 sm:pb-4 overflow-hidden`,children:(0,U.jsx)(`main`,{className:`flex h-full w-full flex-col overflow-y-auto rounded-none sm:rounded-[24px] bg-white border-0 sm:border sm:border-[#E0E3E7] p-4 sm:p-6 shadow-sm dark:bg-[#1E1F20] dark:border-[#36373A]`,children:(0,U.jsx)(jt,{context:{setHeaderActions:d}})})})]}),f.open?(0,U.jsxs)(`div`,{className:`fixed inset-x-3 bottom-3 z-[70] max-h-[70dvh] overflow-hidden rounded-2xl border border-[#E0E3E7] bg-white shadow-2xl sm:inset-x-auto sm:bottom-4 sm:right-6 sm:w-96 dark:border-[#36373A] dark:bg-[#1E1F20] transition-all duration-300 animate-in fade-in slide-in-from-bottom-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-[#E0E3E7] px-4 py-3 bg-[#F8FAFD] dark:border-[#36373A] dark:bg-[#28292A]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[f.status===`done`?(0,U.jsx)(Tr,{className:`h-4 w-4 text-[#0F9D58]`}):f.status===`partial`||f.status===`error`?(0,U.jsx)(Hi,{className:`h-4 w-4 text-[#D93025]`}):(0,U.jsx)(Li,{className:`h-4 w-4 text-[#0B57D0]`}),(0,U.jsx)(`span`,{children:f.status===`done`?`Upload complete`:f.status===`partial`?`Completed with errors`:f.status===`error`?`Upload failed`:f.percent>=99?`Processing on Drive`:`Uploading...`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(`button`,{type:`button`,className:`flex h-7 w-7 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,onClick:()=>g(!h),children:(0,U.jsx)(Sr,{className:xo(`h-4 w-4 transition-transform`,h&&`rotate-180`)})}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-7 w-7 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,onClick:()=>p(e=>({...e,open:!1})),children:(0,U.jsx)(Hi,{className:`h-4 w-4`})})]})]}),!h&&(0,U.jsxs)(`div`,{className:`p-4 space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-[#444746] dark:text-[#C4C7C5]`,children:[(0,U.jsx)(`p`,{className:`truncate font-medium flex-1 pr-2`,children:f.fileName}),(0,U.jsxs)(`span`,{children:[f.percent,`%`]})]}),(0,U.jsx)(`div`,{className:`h-1.5 w-full rounded-full bg-[#E0E3E7] dark:bg-[#36373A] overflow-hidden`,children:(0,U.jsx)(`div`,{className:xo(`h-full rounded-full transition-all duration-300`,f.status===`error`||f.status===`partial`?`bg-[#D93025]`:f.status===`done`?`bg-[#0F9D58]`:`bg-[#0B57D0]`),style:{width:`${f.percent}%`}})}),f.files.length>0&&(0,U.jsx)(`div`,{className:`max-h-48 overflow-y-auto space-y-2 pt-1`,children:f.files.map((e,t)=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs rounded-lg p-2 bg-[#F8FAFD] dark:bg-[#28292A]`,children:[(0,U.jsx)(`span`,{className:`truncate flex-1 pr-2 font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:e.name}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.status===`error`&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>m(e.name),className:`text-[#0B57D0] hover:underline font-medium text-[11px]`,children:`Retry`}),(0,U.jsx)(`span`,{className:xo(`text-[11px]`,e.status===`error`?`text-[#D93025]`:e.status===`done`?`text-[#0F9D58]`:`text-[#0B57D0]`),children:e.status===`error`?`Failed`:e.status===`done`?`Done`:`${e.percent}%`})]})]},`${e.name}-${t}`))})]})]}):null]})}var es=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ts=Gi,ns=((e,t)=>n=>{if(t?.variants==null)return ts(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=es(t)||es(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ts(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)})(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-full text-sm font-medium transition-all duration-200 ease-[cubic-bezier(0.05,0.7,0.1,1.0)] active:scale-[0.97] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#0B57D0] disabled:pointer-events-none disabled:opacity-40 cursor-pointer select-none`,{variants:{variant:{default:`bg-[#0B57D0] text-white hover:bg-[#0842A0] active:bg-[#063175] shadow-sm hover:shadow-md active:shadow-none`,tonal:`bg-[#C2E7FF] text-[#001D35] hover:bg-[#B3DCF5] active:bg-[#97D1FA] hover:shadow-sm`,outline:`border border-[#747775]/40 bg-white text-[#0B57D0] hover:bg-[#F0F4F9] hover:border-[#0B57D0]/60 dark:bg-[#1E1F20] dark:border-[#747775]/50 dark:text-[#A8C7FA] dark:hover:bg-[#28292A]`,ghost:`text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10 active:bg-black/10 dark:active:bg-white/15`,soft:`bg-[#F0F4F9] text-[#1F1F1F] hover:bg-[#E9EEF6] dark:bg-[#28292A] dark:text-[#E3E3E3] dark:hover:bg-[#333537] active:bg-[#DFE4EC]`,danger:`text-[#B3261E] hover:bg-[#F9DEDC]/50 dark:text-[#F2B8B5] dark:hover:bg-[#8C1D18]/30 active:bg-[#F9DEDC]`},size:{default:`h-10 px-5 py-2`,sm:`h-8 px-4 text-xs`,lg:`h-12 px-6 text-base`,icon:`h-10 w-10 p-2.5`,"icon-sm":`h-8 w-8 p-1.5`}},defaultVariants:{variant:`default`,size:`default`}});function G({className:e,variant:t,size:n,...r}){return(0,U.jsx)(`button`,{className:xo(ns({variant:t,size:n,className:e})),...r})}var rs=(0,v.createContext)(void 0);function is({children:e}){let[t,n]=(0,v.useState)([]),r=(0,v.useCallback)(e=>{n(t=>t.filter(t=>t.id!==e))},[]),i=(0,v.useCallback)((e,t=`info`,i)=>{let a=`${Date.now()}-${Math.random().toString(36).slice(2,7)}`,o=i?.duration??3500,s={id:a,message:e,type:t,duration:o,action:i?.action};n(e=>[...e,s].slice(-3)),o>0&&setTimeout(()=>{r(a)},o)},[r]),a=(0,v.useMemo)(()=>({success:(e,t)=>i(e,`success`,t),error:(e,t)=>i(e,`error`,t),info:(e,t)=>i(e,`info`,t),custom:(e,t,n)=>i(e,t,n)}),[i]);return(0,U.jsxs)(rs.Provider,{value:{toast:a,dismissToast:r},children:[e,(0,U.jsx)(`aside`,{"aria-live":`polite`,className:`fixed bottom-6 right-6 z-[80] flex flex-col items-end gap-2.5 pointer-events-none max-w-sm sm:max-w-md w-full`,children:t.map(e=>(0,U.jsxs)(`div`,{role:`status`,className:xo(`pointer-events-auto flex items-center justify-between gap-3 rounded-2xl px-4 py-3 text-xs sm:text-sm font-normal shadow-2xl transition-all duration-200 select-none animate-m3-dialog`,`bg-[#1E1F20] text-white border border-white/10 dark:bg-[#E3E3E3] dark:text-[#1E1F20] dark:border-black/5`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 min-w-0`,children:[e.type===`success`&&(0,U.jsx)(Er,{className:`h-4 w-4 shrink-0 text-[#81C995] dark:text-[#137333]`}),e.type===`error`&&(0,U.jsx)(wr,{className:`h-4 w-4 shrink-0 text-[#F28B82] dark:text-[#C5221F]`}),e.type===`info`&&(0,U.jsx)(ei,{className:`h-4 w-4 shrink-0 text-[#8AB4F8] dark:text-[#1A73E8]`}),(0,U.jsx)(`span`,{className:`truncate max-w-[260px] sm:max-w-[340px] leading-snug`,children:e.message})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 ml-1`,children:[e.action&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>{e.action?.onClick(),r(e.id)},className:`text-[#8AB4F8] hover:underline font-medium text-xs dark:text-[#0B57D0]`,children:e.action.label}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>r(e.id),"aria-label":`Close notification`,className:`rounded-full p-1 opacity-70 hover:opacity-100 hover:bg-white/10 dark:hover:bg-black/10 transition-colors`,children:(0,U.jsx)(Hi,{className:`h-3.5 w-3.5`})})]})]},e.id))})]})}function as(){let e=(0,v.useContext)(rs);if(!e)throw Error(`useToast must be used within a ToastProvider`);return e}function os({open:e,title:t,description:n,children:r,onClose:i,className:a}){return e?(0,U.jsxs)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center p-4`,children:[(0,U.jsx)(`div`,{className:`fixed inset-0 bg-black/40 backdrop-blur-[2px] animate-m3-scrim`,"aria-hidden":`true`,onClick:i}),(0,U.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`modal-title`,className:xo(`relative z-10 w-full max-h-[90vh] overflow-y-auto rounded-[28px] border border-[#E0E3E7] bg-white p-6 shadow-2xl animate-m3-dialog sm:max-w-lg dark:border-[#36373A] dark:bg-[#1E1F20]`,a),children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h2`,{id:`modal-title`,className:`text-xl font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:t}),n?(0,U.jsx)(`p`,{className:`mt-1 text-sm text-[#444746] dark:text-[#C4C7C5]`,children:n}):null]}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10 transition-transform duration-200 hover:rotate-90 active:scale-90`,onClick:i,"aria-label":`Close dialog`,children:(0,U.jsx)(Hi,{className:`h-5 w-5`})})]}),(0,U.jsx)(`div`,{className:`mt-5`,children:r})]})]}):null}function ss({open:e,file:t,onClose:n}){let[r,i]=(0,v.useState)(null),{toast:a}=as(),{t:o}=Fo(),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(`restricted`),[h,g]=(0,v.useState)(`reader`),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(null),[A,j]=(0,v.useState)(!1),[M,N]=(0,v.useState)(!1),P=(0,v.useRef)(null),F=(0,v.useRef)(null),[I,L]=(0,v.useState)(``),[R,ee]=(0,v.useState)(`viewer`),[te,ne]=(0,v.useState)(!1),[re,z]=(0,v.useState)([]),[ie,ae]=(0,v.useState)(``);(0,v.useEffect)(()=>{function e(e){P.current&&!P.current.contains(e.target)&&j(!1),F.current&&!F.current.contains(e.target)&&N(!1)}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[]),(0,v.useEffect)(()=>{if(!e||!t||!t.id){D(!1),k(null),L(``),ae(``),j(!1),N(!1);return}let n=Zn();i(n),n?.email&&Wo(n.email,64).then(e=>c(e));let r=!0;return u(!0),k(null),t.driveUrl&&T(t.driveUrl),W(t.type===`folder`?`/folders/${t.id}/permissions`:`/files/${t.id}/permissions`).then(e=>{r&&(m(e.generalAccess),g(e.role||`reader`),y(!!e.isInherited),x(e.parentName??null),e.shareUrl?T(e.shareUrl):t.driveUrl&&T(t.driveUrl))}).catch(e=>{r&&(t.driveUrl&&T(t.driveUrl),k(e instanceof Error?e.message:`Failed to fetch permissions`))}).finally(()=>{r&&u(!1)}),W(`/invites`).then(e=>{r&&z(e.sent.filter(e=>e.targetId===t.id&&e.status!==`revoked`))}).catch(()=>void 0),()=>{r=!1}},[e,t]);async function oe(e,n=!1){if(!t?.id||d||!n&&e===p){j(!1);return}if(e===`restricted`&&_&&!n){j(!1),C(!0);return}f(!0),k(null),j(!1);try{let r=await W(t.type===`folder`?`/folders/${t.id}/permissions`:`/files/${t.id}/permissions`,{method:`PUT`,body:JSON.stringify({generalAccess:e,role:h,cascadeParent:n})});m(r.generalAccess),g(r.role||`reader`),y(!!r.isInherited),x(r.parentName??null),C(!1),r.shareUrl&&T(r.shareUrl)}catch(e){k(e instanceof Error?e.message:`Failed to update access permission`)}finally{f(!1)}}async function se(e){if(!t?.id||d||e===h){N(!1);return}f(!0),k(null),N(!1);try{let n=await W(t.type===`folder`?`/folders/${t.id}/permissions`:`/files/${t.id}/permissions`,{method:`PUT`,body:JSON.stringify({generalAccess:p,role:e})});g(n.role||`reader`),y(!!n.isInherited),n.shareUrl&&T(n.shareUrl)}catch(e){k(e instanceof Error?e.message:`Failed to update role permission`)}finally{f(!1)}}async function ce(){let e=w||t?.driveUrl;if(!e&&t?.id)try{e=(await W(`/files/${t.id}/share`,{method:`POST`})).url,T(e)}catch{e=window.location.href}e&&(await navigator.clipboard.writeText(e),D(!0),a.success(`Link copied to clipboard!`),setTimeout(()=>D(!1),2500))}async function le(e){if(e.preventDefault(),!(!t?.id||!I.trim()||te)){ne(!0),k(null),ae(``);try{let e=await W(`/invites`,{method:`POST`,body:JSON.stringify({email:I.trim(),role:R,targetType:t.type===`folder`?`folder`:`file`,targetId:t.id})});z(t=>[e.invite,...t.filter(t=>t.email!==e.invite.email)]),L(``),ae(`Invitation sent to ${e.invite.email}`),setTimeout(()=>ae(``),3e3),window.dispatchEvent(new Event(`9drive:invites-changed`))}catch(e){k(e instanceof Error?e.message:`Failed to invite collaborator`)}finally{ne(!1)}}}async function ue(e){try{await W(`/invites/${e}`,{method:`DELETE`}),z(t=>t.filter(t=>t.id!==e)),window.dispatchEvent(new Event(`9drive:invites-changed`))}catch{}}return e?(0,U.jsxs)(`div`,{className:`fixed inset-0 z-[70] flex items-center justify-center p-4 overflow-y-auto`,children:[(0,U.jsx)(`div`,{className:`fixed inset-0 bg-black/45 backdrop-blur-[2px] animate-m3-scrim`,"aria-hidden":`true`,onClick:n}),(0,U.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,className:`relative z-10 w-full max-h-[92vh] overflow-visible rounded-[28px] border border-[#E0E3E7] bg-white p-6 shadow-2xl animate-m3-dialog sm:max-w-[560px] dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-4 pb-2`,children:[(0,U.jsx)(`div`,{className:`min-w-0 pr-2`,children:(0,U.jsxs)(`h2`,{className:`truncate text-[22px] font-normal tracking-tight text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[o(`share_modal.title`,`Share`),` “`,t?.name??`Item`,`”`]})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,U.jsx)(`button`,{type:`button`,className:`flex h-9 w-9 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,title:`Settings`,onClick:()=>a.info(`Editors can change permissions and share. Viewers and commenters can see the option to download, print, and copy.`),children:(0,U.jsx)(Di,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-9 w-9 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10 transition-transform duration-200 hover:rotate-90 active:scale-90`,onClick:n,"aria-label":`Close dialog`,children:(0,U.jsx)(Hi,{className:`h-5 w-5`})})]})]}),O?(0,U.jsx)(`div`,{className:`mt-3 rounded-xl border border-red-200 bg-red-50 p-3 text-xs text-red-700 dark:border-red-900/50 dark:bg-red-950/30 dark:text-red-300`,children:O}):null,ie?(0,U.jsx)(`div`,{className:`mt-3 rounded-xl border border-[#C2E7FF] bg-[#C2E7FF]/40 p-3 text-xs text-[#001D35] dark:bg-[#004A77]/40 dark:text-[#C2E7FF]`,children:ie}):null,(0,U.jsx)(`form`,{onSubmit:le,className:`mt-4`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 rounded-2xl border border-[#747775]/40 bg-white px-3.5 py-2.5 transition-all focus-within:border-[#0B57D0] focus-within:ring-2 focus-within:ring-[#0B57D0]/20 hover:border-[#1F1F1F] dark:border-[#747775]/50 dark:bg-[#1E1F20] dark:focus-within:border-[#A8C7FA]`,children:[(0,U.jsx)(Ri,{className:`h-5 w-5 text-[#747775] shrink-0`}),(0,U.jsx)(`input`,{type:`email`,value:I,onChange:e=>L(e.target.value),placeholder:o(`share_modal.add_people`,`Add people, groups, or calendar events`),className:`w-full bg-transparent text-sm text-[#1F1F1F] placeholder-[#747775] outline-none dark:text-[#E3E3E3] dark:placeholder-[#8E918F]`}),I.trim()?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0 animate-in fade-in`,children:[(0,U.jsxs)(`select`,{value:R,onChange:e=>ee(e.target.value),className:`rounded-lg border border-[#E0E3E7] bg-white px-2 py-1 text-xs font-medium text-[#1F1F1F] dark:border-[#36373A] dark:bg-[#28292A] dark:text-[#E3E3E3]`,children:[(0,U.jsx)(`option`,{value:`viewer`,children:o(`share_modal.viewer`,`Viewer`)}),(0,U.jsx)(`option`,{value:`editor`,children:o(`share_modal.editor`,`Editor`)})]}),(0,U.jsx)(G,{type:`submit`,size:`sm`,disabled:te,className:`rounded-full bg-[#0B57D0] px-3.5 text-xs text-white hover:bg-[#0842A0] dark:bg-[#A8C7FA] dark:text-[#001D35]`,children:te?(0,U.jsx)(oi,{className:`h-3 w-3 animate-spin`}):o(`action.send`,`Send`)})]}):null]})}),(0,U.jsxs)(`div`,{className:`mt-6`,children:[(0,U.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-[#444746] dark:text-[#C4C7C5] mb-2.5`,children:o(`share_modal.people_with_access`,`People with access`)}),(0,U.jsxs)(`div`,{className:`space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[s?(0,U.jsx)(`img`,{src:s,alt:r?.name??`User`,className:`h-9 w-9 rounded-full object-cover shrink-0 ring-1 ring-black/5`}):(0,U.jsx)(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[#0B57D0] text-xs font-bold text-white uppercase`,children:r?.name?.[0]||`U`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`p`,{className:`truncate text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[r?.name??`You`,` `,(0,U.jsxs)(`span`,{className:`text-xs text-[#747775] font-normal`,children:[`(`,o(`share_modal.you`,`you`),`)`]})]}),(0,U.jsx)(`p`,{className:`truncate text-xs text-[#747775] dark:text-[#8E918F]`,children:r?.email??`Owner`})]})]}),(0,U.jsx)(`span`,{className:`text-xs font-normal text-[#747775] dark:text-[#8E918F] shrink-0`,children:o(`share_modal.owner`,`Owner`)})]}),re.length>0&&(0,U.jsx)(`div`,{className:`max-h-40 overflow-y-auto scrollbar-thin space-y-2 pr-1`,children:re.map(e=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 py-1.5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,U.jsx)(`div`,{className:`flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[#E0E3E7] text-xs font-bold text-[#444746] dark:bg-[#28292A] dark:text-[#C4C7C5] uppercase`,children:e.email[0]}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`p`,{className:`truncate text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:e.email}),(0,U.jsxs)(`p`,{className:`text-xs text-[#747775] capitalize dark:text-[#8E918F]`,children:[e.role,` • `,e.status]})]})]}),(0,U.jsx)(`button`,{type:`button`,title:`Remove collaborator`,onClick:()=>ue(e.id),className:`p-1 text-[#747775] hover:text-[#B3261E] dark:hover:text-[#F2B8B5] transition-colors`,children:(0,U.jsx)(Fi,{className:`h-4 w-4`})})]},e.id))})]})]}),(0,U.jsxs)(`div`,{className:`mt-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,U.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-[#444746] dark:text-[#C4C7C5]`,children:o(`share_modal.general_access`,`General access`)}),d||l?(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 text-xs text-[#0B57D0] dark:text-[#A8C7FA]`,children:[(0,U.jsx)(oi,{className:`h-3 w-3 animate-spin`}),`Updating access...`]}):null]}),(0,U.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-2xl border border-[#E0E3E7] bg-[#F8FAFD] p-3.5 dark:border-[#36373A] dark:bg-[#131314]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3.5 min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:xo(`flex h-10 w-10 shrink-0 items-center justify-center rounded-full transition-colors`,p===`anyone`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`bg-[#E0E3E7] text-[#444746] dark:bg-[#28292A] dark:text-[#C4C7C5]`),children:p===`anyone`?(0,U.jsx)(Xr,{className:`h-5 w-5`}):(0,U.jsx)(si,{className:`h-5 w-5`})}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`div`,{className:`relative inline-block`,ref:P,children:[(0,U.jsxs)(`button`,{type:`button`,disabled:d||l,onClick:()=>j(!A),className:`flex items-center gap-1.5 rounded-lg px-2 py-0.5 -ml-2 text-sm font-semibold text-[#1F1F1F] hover:bg-black/5 dark:text-[#E3E3E3] dark:hover:bg-white/5 transition-colors`,children:[(0,U.jsx)(`span`,{children:p===`anyone`?o(`share_modal.anyone`,`Anyone with the link`):o(`share_modal.restricted`,`Restricted`)}),(0,U.jsx)(Sr,{className:xo(`h-4 w-4 text-[#747775] transition-transform duration-200`,A&&`rotate-180`)})]}),A&&(0,U.jsxs)(`div`,{className:`absolute left-0 top-full z-50 mt-1.5 w-56 sm:w-60 overflow-hidden rounded-2xl border border-[#E0E3E7] bg-white py-1.5 shadow-2xl animate-in fade-in zoom-in-95 origin-top-left dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>oe(`restricted`),className:`flex w-full items-center gap-2.5 px-3.5 py-2 text-left text-sm hover:bg-[#F0F4F9] dark:hover:bg-[#28292A] transition-colors`,children:[(0,U.jsx)(`div`,{className:`w-4 shrink-0`,children:p===`restricted`&&(0,U.jsx)(xr,{className:`h-4 w-4 text-[#0B57D0] dark:text-[#A8C7FA]`})}),(0,U.jsx)(`span`,{className:xo(`text-sm font-medium`,p===`restricted`?`text-[#0B57D0] dark:text-[#A8C7FA]`:`text-[#1F1F1F] dark:text-[#E3E3E3]`),children:o(`share_modal.restricted`,`Restricted`)})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>oe(`anyone`),className:`flex w-full items-center gap-2.5 px-3.5 py-2 text-left text-sm hover:bg-[#F0F4F9] dark:hover:bg-[#28292A] transition-colors`,children:[(0,U.jsx)(`div`,{className:`w-4 shrink-0`,children:p===`anyone`&&(0,U.jsx)(xr,{className:`h-4 w-4 text-[#0B57D0] dark:text-[#A8C7FA]`})}),(0,U.jsx)(`span`,{className:xo(`text-sm font-medium`,p===`anyone`?`text-[#0B57D0] dark:text-[#A8C7FA]`:`text-[#1F1F1F] dark:text-[#E3E3E3]`),children:o(`share_modal.anyone`,`Anyone with the link`)})]})]})]}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mt-0.5`,children:p===`anyone`?`Anyone on the internet with the link can access`:`Only people with access can open with the link`}),_&&p===`anyone`?(0,U.jsxs)(`span`,{className:`mt-1 inline-flex items-center gap-1 rounded-md bg-amber-500/10 px-2 py-0.5 text-[11px] font-medium text-amber-700 dark:text-amber-300`,children:[(0,U.jsx)(si,{className:`h-3 w-3`}),` Inherited from parent folder`]}):null]})]}),p===`anyone`?(0,U.jsxs)(`div`,{className:`relative shrink-0 self-center`,ref:F,children:[(0,U.jsxs)(`button`,{type:`button`,disabled:d||l,onClick:()=>N(!M),className:`flex items-center gap-2 rounded-xl border border-[#E0E3E7] bg-white px-3.5 py-1.5 text-xs font-medium text-[#1F1F1F] shadow-sm hover:bg-[#F0F4F9] dark:border-[#36373A] dark:bg-[#1E1F20] dark:text-[#E3E3E3] dark:hover:bg-[#28292A] transition-colors`,children:[(0,U.jsx)(`span`,{className:`capitalize`,children:h===`writer`?`Editor`:h===`commenter`?`Commenter`:`Viewer`}),(0,U.jsx)(Sr,{className:xo(`h-3.5 w-3.5 text-[#747775] transition-transform duration-200`,M&&`rotate-180`)})]}),M&&(0,U.jsx)(`div`,{className:`absolute right-0 top-full z-50 mt-1.5 w-44 overflow-hidden rounded-2xl border border-[#E0E3E7] bg-white py-1.5 shadow-2xl animate-in fade-in zoom-in-95 origin-top-right dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[{value:`reader`,label:`Viewer`},{value:`commenter`,label:`Commenter`},{value:`writer`,label:`Editor`}].map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>se(e.value),className:`flex w-full items-center justify-between px-3.5 py-2 text-xs hover:bg-[#F0F4F9] dark:hover:bg-[#28292A] text-left transition-colors`,children:[(0,U.jsx)(`span`,{className:xo(h===e.value?`font-semibold text-[#0B57D0] dark:text-[#A8C7FA]`:`text-[#1F1F1F] dark:text-[#E3E3E3]`),children:e.label}),h===e.value&&(0,U.jsx)(xr,{className:`h-3.5 w-3.5 text-[#0B57D0] dark:text-[#A8C7FA]`})]},e.value))})]}):null]})]}),(0,U.jsxs)(`div`,{className:`mt-5 flex flex-col-reverse sm:flex-row sm:items-center justify-between gap-3 pt-1`,children:[(0,U.jsx)(G,{type:`button`,variant:`outline`,className:`flex items-center gap-2 rounded-full border-[#747775]/40 px-5 text-sm font-medium text-[#0B57D0] hover:bg-[#0B57D0]/10 hover:border-[#0B57D0] active:scale-95 transition-all dark:border-[#747775]/60 dark:text-[#A8C7FA]`,onClick:ce,children:E?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(xr,{className:`h-4 w-4 text-emerald-600 dark:text-emerald-400`}),(0,U.jsx)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:o(`share_modal.link_copied`,`Link copied`)})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(ii,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{children:o(`share_modal.copy_link`,`Copy link`)})]})}),(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[t?.driveUrl?(0,U.jsxs)(G,{type:`button`,variant:`ghost`,className:`flex items-center gap-1.5 text-xs text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10 rounded-full px-3`,onClick:()=>window.open(t.driveUrl??``,`_blank`),children:[(0,U.jsx)(zr,{className:`h-3.5 w-3.5`}),o(`menu.open_in_gdrive`,`Open in Google Drive`)]}):null,(0,U.jsx)(G,{type:`button`,className:`rounded-full bg-[#0B57D0] hover:bg-[#0842A0] text-white px-7 text-sm font-medium shadow-sm transition-all active:scale-95 dark:bg-[#A8C7FA] dark:text-[#001D35] dark:hover:bg-[#D3E3FD]`,onClick:n,children:o(`action.done`,`Done`)})]})]})]}),S&&(0,U.jsx)(`div`,{className:`fixed inset-0 z-60 flex items-center justify-center p-4 bg-black/40 backdrop-blur-sm animate-in fade-in`,children:(0,U.jsxs)(`div`,{className:`w-full max-w-md rounded-2xl border border-[#E0E3E7] bg-white p-6 shadow-2xl dark:border-[#36373A] dark:bg-[#1E1F20] animate-in zoom-in-95`,children:[(0,U.jsx)(`h3`,{className:`text-base font-semibold text-[#1F1F1F] dark:text-[#E3E3E3]`,children:o(`share_modal.cascade_title`,`Change parent folder access to Restricted?`)}),(0,U.jsxs)(`p`,{className:`mt-2.5 text-xs text-[#444746] dark:text-[#C4C7C5] leading-relaxed`,children:[o(`share_modal.cascade_desc`,`This file inherits public access from parent folder. Changing it to Restricted will make the parent folder and all files inside it Restricted as well.`),b?` (${b})`:``]}),(0,U.jsxs)(`div`,{className:`mt-6 flex items-center justify-end gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`ghost`,className:`rounded-full px-4 text-xs font-medium`,onClick:()=>C(!1),disabled:d,children:o(`action.cancel`,`Cancel`)}),(0,U.jsxs)(G,{type:`button`,className:`rounded-full bg-[#0B57D0] hover:bg-[#0842A0] text-white px-5 text-xs font-medium transition-all active:scale-95 dark:bg-[#A8C7FA] dark:text-[#001D35] dark:hover:bg-[#D3E3FD]`,onClick:()=>oe(`restricted`,!0),disabled:d,children:[d?(0,U.jsx)(oi,{className:`mr-1.5 h-3.5 w-3.5 animate-spin`}):null,o(`share_modal.cascade_confirm`,`Change Parent Folder`)]})]})]})})]}):null}function cs({icon:e,label:t,onClick:n}){return(0,U.jsxs)(`button`,{type:`button`,onClick:n,className:`flex h-9 w-full items-center gap-3 px-3.5 text-[13px] font-normal text-[#1F1F1F] transition-all duration-150 active:scale-[0.98] hover:bg-[#F0F4F9] text-left select-none dark:text-[#E3E3E3] dark:hover:bg-[#28292A]`,children:[(0,U.jsx)(e,{className:`h-4 w-4 shrink-0 text-[#444746] dark:text-[#C4C7C5]`}),(0,U.jsx)(`span`,{className:`flex-1 truncate`,children:t})]})}function ls({x:e,y:t,open:n,canPasteFolder:r=!1,onClose:i,onUpload:a,onCreateFolder:o,onPasteFolder:s}){let{t:c}=Fo();if(!n)return null;let l=Math.max(12,Math.min(e,window.innerWidth-240)),u=Math.max(12,Math.min(t,window.innerHeight-180));return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`fixed inset-0 z-40 cursor-default`,"aria-hidden":`true`,onClick:i}),(0,U.jsx)(`div`,{className:`fixed z-50 w-56 overflow-hidden rounded-2xl border border-[#E0E3E7] bg-white py-1.5 shadow-[0_8px_32px_rgba(0,0,0,0.12)] dark:border-[#36373A] dark:bg-[#1E1F20] dark:shadow-[0_12px_36px_rgba(0,0,0,0.6)] animate-m3-popover`,style:window.innerWidth>=640?{left:l,top:u}:{insetInline:`0.75rem`,bottom:`0.75rem`,position:`fixed`},children:(0,U.jsxs)(`div`,{className:`py-1`,children:[(0,U.jsx)(cs,{icon:Jr,label:c(`action.new_folder`,`New folder`),onClick:o}),(0,U.jsx)(`div`,{className:`my-1.5 h-px bg-[#E0E3E7] dark:bg-[#36373A]`}),(0,U.jsx)(cs,{icon:Li,label:c(`action.file_upload`,`File upload`),onClick:a}),r&&s?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`my-1.5 h-px bg-[#E0E3E7] dark:bg-[#36373A]`}),(0,U.jsx)(cs,{icon:kr,label:c(`menu.paste_folder`,`Paste folder here`),onClick:s})]}):null]})})]})}function us({icon:e,label:t,onClick:n,danger:r=!1,kbd:i}){return(0,U.jsxs)(`button`,{type:`button`,onClick:n,className:[`flex h-9 w-full items-center gap-3 px-3.5 text-[13px] font-normal transition-all duration-150 active:scale-[0.98] text-left select-none`,r?`text-[#B3261E] hover:bg-[#F9DEDC]/50 dark:text-[#F2B8B5] dark:hover:bg-[#8C1D18]/30`:`text-[#1F1F1F] hover:bg-[#F0F4F9] dark:text-[#E3E3E3] dark:hover:bg-[#28292A]`].join(` `),children:[(0,U.jsx)(e,{className:`h-4 w-4 shrink-0 text-[#444746] dark:text-[#C4C7C5]`}),(0,U.jsx)(`span`,{className:`flex-1 truncate`,children:t}),i&&(0,U.jsx)(`span`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:i})]})}function ds({x:e,y:t,file:n,onClose:r,onView:i,onDownload:a,onRename:o,onMove:s,onDetails:c,onShare:l,onCopyLink:u,onCopyCdnUrl:d,onDelete:f}){let p=tt(),{toast:m}=as(),{t:h}=Fo();if(!n)return null;let g=()=>{if(d)d();else{let e=`/cdn/view/${n.id}`;navigator.clipboard.writeText(e).then(()=>m.success(`CDN Direct URL copied to clipboard!`)).catch(()=>m.error(`Failed to copy CDN URL`)),r()}},_=async()=>{try{let e=Yn(),t={};e&&(t.Authorization=`Bearer ${e}`);let r=await fetch(`/cdn/raw/${n.id}`,{headers:t});if(!r.ok)return null;let i=await r.blob();return new File([i],n.name,{type:n.mimeType||`application/octet-stream`})}catch{return null}},v=async()=>{r(),m.info(`Loading image into Background Remover...`);let e=await _();e?p(`/tools/remove-bg`,{state:{initialFiles:[e]}}):p(`/tools/remove-bg`)},y=async()=>{r(),m.info(`Loading image into PDF Studio...`);let e=await _();e?p(`/tools/pdf?mode=images-to-pdf`,{state:{initialFiles:[e]}}):p(`/tools/pdf?mode=images-to-pdf`)},b=async()=>{r(),m.info(`Loading document into PDF Studio...`);let e=await _();e?p(`/tools/pdf`,{state:{initialFiles:[e]}}):p(`/tools/pdf`)},x=n.kind===`image`||n.mimeType?.startsWith(`image/`),S=n.kind===`pdf`||n.mimeType?.includes(`pdf`)||n.name.toLowerCase().endsWith(`.pdf`),C=Math.max(12,Math.min(e,window.innerWidth-240)),w=Math.max(12,Math.min(t,window.innerHeight-440));return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`fixed inset-0 z-40 cursor-default`,"aria-hidden":`true`,onClick:r}),(0,U.jsxs)(`div`,{className:`fixed z-50 w-60 overflow-hidden rounded-2xl border border-[#E0E3E7] bg-white py-1.5 shadow-[0_8px_32px_rgba(0,0,0,0.12)] dark:border-[#36373A] dark:bg-[#1E1F20] dark:shadow-[0_12px_36px_rgba(0,0,0,0.6)] animate-m3-popover`,style:window.innerWidth>=640?{left:C,top:w}:{insetInline:`0.75rem`,bottom:`0.75rem`,position:`fixed`},children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b border-[#E0E3E7] px-3.5 py-2.5 dark:border-[#36373A]`,children:[(0,U.jsx)(Io,{kind:n.kind,className:`h-4 w-4 shrink-0`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`p`,{className:`truncate text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:n.name}),(0,U.jsx)(`p`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:n.size})]})]}),(0,U.jsxs)(`div`,{className:`py-1`,children:[n.driveUrl?(0,U.jsx)(us,{icon:zr,label:h(`menu.open_in_gdrive`,`Open in Google Drive`),onClick:()=>{window.open(n.driveUrl,`_blank`),r()}}):null,(0,U.jsx)(us,{icon:Br,label:h(`menu.preview`,`Preview`),onClick:i,kbd:`↵`}),(0,U.jsx)(us,{icon:Lr,label:h(`menu.download`,`Download`),onClick:a}),x&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(us,{icon:ji,label:h(`menu.remove_bg`,`Remove Background (AI)`),onClick:v}),(0,U.jsx)(us,{icon:Wr,label:h(`menu.convert_pdf`,`Convert to PDF`),onClick:y})]}),S&&(0,U.jsx)(us,{icon:Wr,label:h(`menu.process_pdf`,`Process with PDF Tools`),onClick:b}),(0,U.jsx)(us,{icon:yi,label:h(`menu.rename`,`Rename`),onClick:o}),(0,U.jsx)(us,{icon:Kr,label:h(`menu.move_to`,`Move to`),onClick:s}),(0,U.jsx)(us,{icon:ei,label:h(`menu.file_info`,`File information`),onClick:c}),(0,U.jsx)(`div`,{className:`my-1.5 h-px bg-[#E0E3E7] dark:bg-[#36373A]`}),(0,U.jsx)(us,{icon:Ri,label:h(`menu.share`,`Share`),onClick:l}),(0,U.jsx)(us,{icon:ii,label:h(`menu.copy_link`,`Copy link`),onClick:u,kbd:`Ctrl+L`}),(0,U.jsx)(us,{icon:Xr,label:h(`menu.copy_cdn`,`Copy CDN Direct URL`),onClick:g}),(0,U.jsx)(`div`,{className:`my-1.5 h-px bg-[#E0E3E7] dark:bg-[#36373A]`}),(0,U.jsx)(us,{icon:Fi,label:h(`menu.move_to_trash`,`Move to trash`),onClick:f,danger:!0})]})]})]})}function fs({label:e,value:t}){return(0,U.jsxs)(`div`,{className:`py-2.5 border-b border-[#E0E3E7]/60 dark:border-[#36373A]/60`,children:[(0,U.jsx)(`p`,{className:`text-xs font-medium text-[#747775] dark:text-[#8E918F]`,children:e}),(0,U.jsx)(`p`,{className:`mt-0.5 break-words text-sm text-[#1F1F1F] dark:text-[#E3E3E3]`,children:t})]})}function ps({open:e,file:t,onClose:n,onShare:r}){let{toast:i}=as(),{t:a}=Fo();return e?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`fixed inset-0 z-40 bg-black/20 lg:hidden`,"aria-hidden":`true`,onClick:n}),(0,U.jsxs)(`aside`,{className:`fixed right-0 top-16 z-40 h-[calc(100vh-4rem)] w-80 border-l border-[#E0E3E7] bg-white shadow-xl dark:border-[#36373A] dark:bg-[#1E1F20] flex flex-col`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-[#E0E3E7] px-4 py-3 dark:border-[#36373A]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[t&&(0,U.jsx)(Io,{kind:t.kind,className:`h-5 w-5 shrink-0`}),(0,U.jsx)(`h2`,{className:`truncate text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:t?.name??a(`drawer.details`,`Details`)})]}),(0,U.jsx)(`button`,{type:`button`,onClick:n,className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5]`,"aria-label":`Close details`,children:(0,U.jsx)(Hi,{className:`h-4 w-4`})})]}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-4`,children:t?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`flex h-36 items-center justify-center rounded-xl bg-[#F0F4F9] dark:bg-[#28292A]`,children:(0,U.jsx)(Io,{kind:t.kind,className:`h-16 w-16 opacity-80`})}),r&&(0,U.jsxs)(G,{onClick:()=>r(t),variant:`outline`,className:`w-full gap-2 rounded-full border-[#747775]/40 text-[#0B57D0] hover:bg-[#0B57D0]/10 hover:border-[#0B57D0] dark:border-[#747775]/60 dark:text-[#A8C7FA]`,children:[(0,U.jsx)(Ri,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{children:a(`action.share`,`Share`)})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-xs font-semibold uppercase tracking-wider text-[#747775] dark:text-[#8E918F] mb-1`,children:a(`drawer.file_details`,`File details`)}),(0,U.jsx)(fs,{label:a(`drawer.type`,`Type`),value:t.mimeType??`Unknown`}),(0,U.jsx)(fs,{label:a(`drawer.size`,`Size`),value:t.sizeBytes?wo(t.sizeBytes):t.size}),(0,U.jsx)(fs,{label:a(`drawer.location`,`Location`),value:t.folderName?t.folderName:`My Drive`}),(0,U.jsx)(fs,{label:a(`drawer.owner`,`Owner`),value:t.accountEmail??t.access}),(0,U.jsx)(fs,{label:a(`drawer.modified`,`Modified`),value:t.createdAt?To(t.createdAt):t.date}),(0,U.jsx)(fs,{label:a(`drawer.storage_provider`,`Storage provider`),value:t.accountProvider??`Google Drive`}),(0,U.jsxs)(`div`,{className:`py-2.5 border-b border-[#E0E3E7]/60 dark:border-[#36373A]/60`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(Xr,{className:`h-3.5 w-3.5 text-emerald-500`}),(0,U.jsx)(`p`,{className:`text-xs font-medium text-[#747775] dark:text-[#8E918F]`,children:a(`drawer.cdn_direct`,`CDN Direct URL`)})]}),(0,U.jsx)(`span`,{className:`text-[10px] rounded bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 px-1.5 py-0.5 font-medium`,children:`Public`})]}),(0,U.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5`,children:[(0,U.jsx)(`input`,{type:`text`,readOnly:!0,value:`/cdn/view/${t.id}`,className:`flex-1 rounded-lg border border-[#E0E3E7] bg-[#F8FAFD] dark:bg-[#18191A] dark:border-[#36373A] px-2 py-1 text-[11px] font-mono text-[#1F1F1F] dark:text-[#E3E3E3] select-all outline-none`}),(0,U.jsx)(G,{size:`sm`,variant:`outline`,className:`h-7 px-2.5 text-xs rounded-lg shrink-0`,onClick:()=>{navigator.clipboard.writeText(`/cdn/view/${t.id}`).then(()=>i.success(a(`action.copied`,`Copied!`))).catch(()=>i.error(`Failed to copy`))},children:a(`action.copy`,`Copy`)})]}),(0,U.jsx)(`p`,{className:`mt-1 text-[10px] text-[#747775] dark:text-[#8E918F]`,children:a(`drawer.cdn_desc`,`Direct embed for <img> tags, web apps, and platforms.`)})]}),t.driveUrl&&(0,U.jsxs)(`div`,{className:`py-2.5 border-b border-[#E0E3E7]/60 dark:border-[#36373A]/60`,children:[(0,U.jsx)(`p`,{className:`text-xs font-medium text-[#747775] dark:text-[#8E918F]`,children:a(`drawer.gdrive_link`,`Google Drive Link`)}),(0,U.jsxs)(`a`,{href:t.driveUrl,target:`_blank`,rel:`noopener noreferrer`,className:`mt-1 inline-flex items-center gap-1.5 text-xs font-medium text-[#0B57D0] dark:text-[#A8C7FA] hover:underline`,children:[(0,U.jsx)(`span`,{children:a(`menu.open_in_gdrive`,`Open in Google Drive`)}),(0,U.jsx)(zr,{className:`h-3.5 w-3.5`})]})]})]})]}):(0,U.jsx)(`p`,{className:`text-xs text-[#747775]`,children:a(`drawer.select_file`,`Select a file to see details`)})})]})]}):null}function ms({files:e,selectedFileIds:t=new Set,sizeScale:n=`md`,onFileContextMenu:r,onToggleFile:i,onFileDoubleClick:a,onShare:o}){return(0,U.jsx)(`div`,{className:xo(`mt-3 grid gap-3`,n===`xs`?`grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6`:n===`sm`?`grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5`:n===`lg`?`grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3`:`grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-4`),children:e.map(e=>{let n=t.has(e.id??``);return(0,U.jsxs)(`div`,{draggable:!0,onDragStart:t=>{t.dataTransfer.setData(`text/plain`,e.id??``),t.dataTransfer.effectAllowed=`move`},onClick:()=>i?.(e),onDoubleClick:()=>a?.(e),onContextMenu:t=>r?.(t,e),className:xo(`group relative flex flex-col rounded-2xl border transition-all duration-200 ease-[cubic-bezier(0.05,0.7,0.1,1.0)] cursor-pointer select-none overflow-hidden hover:-translate-y-0.5 hover:shadow-md active:scale-[0.99]`,n?`border-[#0B57D0] bg-[#C2E7FF]/30 shadow-sm dark:border-[#A8C7FA] dark:bg-[#004A77]/30`:`border-[#E0E3E7] bg-white hover:border-[#747775]/40 hover:bg-[#F0F4F9] dark:border-[#36373A] dark:bg-[#1E1F20] dark:hover:border-[#747775]/60 dark:hover:bg-[#28292A]`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 p-3 pb-2`,children:[(0,U.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 rounded accent-[#0B57D0] cursor-pointer`,checked:n,onChange:()=>i?.(e),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.name}`}),(0,U.jsx)(Io,{kind:e.kind,className:`h-5 w-5 shrink-0`}),(0,U.jsx)(`h3`,{className:`flex-1 truncate text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,title:e.name,children:e.name}),o&&(0,U.jsx)(`button`,{type:`button`,title:`Share`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-[#444746] opacity-0 transition-opacity hover:bg-black/5 group-hover:opacity-100 dark:text-[#C4C7C5] dark:hover:bg-white/10`,onClick:t=>{t.stopPropagation(),o(e)},"aria-label":`Share ${e.name}`,children:(0,U.jsx)(Ri,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-[#444746] opacity-0 transition-opacity hover:bg-black/5 group-hover:opacity-100 dark:text-[#C4C7C5] dark:hover:bg-white/10`,onClick:t=>{t.stopPropagation(),r?.(t,e)},"aria-label":`Open ${e.name} menu`,children:(0,U.jsx)(Rr,{className:`h-4 w-4`})})]}),(0,U.jsx)(`div`,{className:`mx-3 mb-2.5 flex h-28 items-center justify-center rounded-xl bg-[#F0F4F9] dark:bg-[#28292A] overflow-hidden`,children:(0,U.jsx)(Io,{kind:e.kind,className:`h-12 w-12 opacity-80`})}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-3.5 pb-3 text-xs text-[#444746] dark:text-[#C4C7C5]`,children:[(0,U.jsx)(`span`,{children:e.size}),(0,U.jsx)(`span`,{children:e.date})]})]},e.id??e.name)})})}function hs({count:e}){return(0,U.jsx)(`div`,{className:`flex -space-x-2`,children:Array.from({length:e}).map((e,t)=>(0,U.jsx)(`img`,{src:`https://i.pravatar.cc/48?img=${12+t}`,alt:`Member avatar`,className:`h-5 w-5 rounded-full border-2 border-white object-cover`},t))})}function gs({files:e,mode:t=`default`,selectedFileIds:n=new Set,allSelected:r=!1,onFileContextMenu:i,onToggleFile:a,onToggleAll:o,onFileDoubleClick:s,onShare:c}){let{toast:l}=as(),{t:u}=Fo(),[d,f]=(0,v.useState)(null);return(0,U.jsxs)(`div`,{className:`mt-2`,children:[(0,U.jsxs)(`div`,{className:`grid gap-2 sm:hidden`,children:[o?(0,U.jsxs)(`label`,{className:`flex items-center justify-between rounded-xl border border-[#E0E3E7] bg-white px-3.5 py-2.5 text-xs font-medium text-[#444746] dark:border-[#36373A] dark:bg-[#1E1F20] dark:text-[#C4C7C5]`,children:[(0,U.jsx)(`span`,{children:u(`table.select_all_files`,`Select all files`)}),(0,U.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 rounded accent-[#0B57D0]`,checked:r,onChange:o})]}):null,e.map(e=>{let r=n.has(e.id??``),o=t===`archived`?e.location:t===`recent`?e.openedDate:t===`starred`?e.starredDate:e.date;return(0,U.jsx)(`article`,{draggable:!0,onDragStart:t=>{t.dataTransfer.setData(`text/plain`,e.id??``),t.dataTransfer.effectAllowed=`move`},onClick:()=>a?.(e),onDoubleClick:()=>s?.(e),onContextMenu:t=>i?.(t,e),className:xo(`overflow-hidden rounded-xl border p-3 transition-colors cursor-pointer select-none`,r?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] bg-white hover:bg-[#F0F4F9] dark:border-[#36373A] dark:bg-[#1E1F20] dark:hover:bg-[#28292A]`),children:(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[a?(0,U.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 shrink-0 rounded accent-[#0B57D0]`,checked:r,onChange:()=>a?.(e),onClick:e=>e.stopPropagation()}):null,(0,U.jsx)(`div`,{className:`shrink-0`,children:t===`starred`?(0,U.jsx)(Ni,{className:`h-5 w-5 fill-[#FBBC04] text-[#FBBC04]`}):(0,U.jsx)(Io,{kind:e.kind,className:`h-5 w-5`})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1 overflow-hidden`,children:[(0,U.jsx)(`h3`,{className:xo(`truncate text-sm font-medium leading-snug`,r?`text-[#001D35] dark:text-[#C2E7FF]`:`text-[#1F1F1F] dark:text-[#E3E3E3]`),title:e.name,children:e.name}),(0,U.jsxs)(`div`,{className:`mt-0.5 flex flex-wrap items-center gap-1.5 text-xs text-[#444746] dark:text-[#C4C7C5]`,children:[(0,U.jsx)(`span`,{children:o}),(0,U.jsx)(`span`,{children:`·`}),(0,U.jsx)(`span`,{children:e.size}),e.folderName&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`span`,{children:`·`}),(0,U.jsxs)(`span`,{className:`flex items-center gap-0.5 text-[#0B57D0] dark:text-[#A8C7FA]`,children:[(0,U.jsx)(qr,{className:`h-3 w-3`}),e.folderName]})]})]})]}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,onClick:t=>{t.stopPropagation(),i?.(t,e)},"aria-label":`Open ${e.name} menu`,children:(0,U.jsx)(Rr,{className:`h-4 w-4`})})]})},e.id??e.name)})]}),(0,U.jsx)(`div`,{className:`hidden overflow-x-auto sm:block`,children:(0,U.jsxs)(`table`,{className:`w-full min-w-[760px] border-collapse text-left text-sm select-none`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`border-b border-[#E0E3E7] text-[13px] font-medium text-[#444746] dark:border-[#36373A] dark:text-[#C4C7C5]`,children:[(0,U.jsx)(`th`,{className:`w-10 py-2.5 pl-3`,children:(0,U.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 rounded accent-[#0B57D0] cursor-pointer`,checked:r,onChange:o,"aria-label":`Select all`})}),(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:u(`table.name`,`Name`)}),t==="default"?(0,U.jsx)(`th`,{className:`py-2.5 font-medium text-[#747775]`,children:u(`table.location`,`Location`)}):null,t===`shared`?(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:u(`table.owner`,`Owner`)}):null,t===`recent`?(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:u(`table.last_opened`,`Last opened`)}):null,t===`starred`?(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:u(`table.starred_on`,`Starred on`)}):null,t===`archived`?(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:`Archived date`}):null,t===`archived`?(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:`Original location`}):(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:u(`table.last_modified`,`Last modified`)}),(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:u(`table.file_size`,`File size`)}),(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:u(`table.sharing`,`Sharing`)}),(0,U.jsx)(`th`,{className:`w-32 py-2.5 pr-3 text-right`})]})}),(0,U.jsx)(`tbody`,{children:e.map(e=>{let r=n.has(e.id??``);return(0,U.jsxs)(`tr`,{draggable:!0,onDragStart:t=>{t.dataTransfer.setData(`text/plain`,e.id??``),t.dataTransfer.effectAllowed=`move`},onContextMenu:t=>i?.(t,e),onClick:()=>a?.(e),onDoubleClick:()=>s?.(e),className:xo(`group h-12 border-b transition-colors cursor-pointer`,r?`border-transparent bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7]/60 hover:bg-[#F0F4F9] dark:border-[#36373A]/60 dark:hover:bg-[#28292A]`),children:[(0,U.jsx)(`td`,{className:`py-2 pl-3`,children:(0,U.jsx)(`input`,{type:`checkbox`,className:`h-4 w-4 rounded accent-[#0B57D0] cursor-pointer`,checked:r,onChange:()=>a?.(e),onClick:e=>e.stopPropagation(),"aria-label":`Select ${e.name}`})}),(0,U.jsx)(`td`,{className:`py-2 font-normal`,children:(0,U.jsxs)(`span`,{className:`flex min-w-0 items-center gap-3`,children:[t===`starred`?(0,U.jsx)(Ni,{className:`h-5 w-5 shrink-0 fill-[#FBBC04] text-[#FBBC04]`}):(0,U.jsx)(Io,{kind:e.kind,className:`h-5 w-5 shrink-0`}),(0,U.jsx)(`span`,{className:xo(`truncate max-w-[220px] lg:max-w-[340px] text-sm font-normal`,r?`text-[#001D35] dark:text-[#C2E7FF]`:`text-[#1F1F1F] dark:text-[#E3E3E3]`),title:e.name,children:e.name})]})}),t==="default"?(0,U.jsx)(`td`,{className:`py-2 text-[#444746] dark:text-[#C4C7C5]`,children:e.folderName?(0,U.jsxs)(`span`,{className:`flex items-center gap-1 text-xs font-normal text-[#0B57D0] dark:text-[#A8C7FA]`,children:[(0,U.jsx)(qr,{className:`h-3.5 w-3.5 shrink-0`}),(0,U.jsx)(`span`,{className:`truncate max-w-[120px]`,children:e.folderName})]}):(0,U.jsx)(`span`,{className:`text-xs text-[#747775]`,children:`My Drive`})}):null,t===`shared`?(0,U.jsx)(`td`,{className:`py-2 text-[#444746] dark:text-[#C4C7C5]`,children:e.owner||`me`}):null,t===`recent`?(0,U.jsx)(`td`,{className:`py-2 text-[#444746] dark:text-[#C4C7C5]`,children:e.openedDate}):null,t===`starred`?(0,U.jsx)(`td`,{className:`py-2 text-[#444746] dark:text-[#C4C7C5]`,children:e.starredDate}):null,t===`archived`?(0,U.jsx)(`td`,{className:`py-2 text-[#444746] dark:text-[#C4C7C5]`,children:e.archivedDate}):null,(0,U.jsx)(`td`,{className:`py-2 text-[#444746] dark:text-[#C4C7C5]`,children:t===`archived`?e.location:e.date}),(0,U.jsx)(`td`,{className:`py-2 text-[#444746] dark:text-[#C4C7C5]`,children:e.size}),(0,U.jsx)(`td`,{className:`py-2 text-[#444746] dark:text-[#C4C7C5]`,children:(0,U.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(hs,{count:e.shared}),(0,U.jsx)(`span`,{className:`truncate max-w-[100px] text-xs`,children:e.access})]})}),(0,U.jsx)(`td`,{className:`py-2 pr-3 text-right`,children:(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,U.jsxs)(`div`,{className:`opacity-0 group-hover:opacity-100 transition-opacity flex items-center gap-1`,children:[c&&(0,U.jsx)(`button`,{type:`button`,title:`Share`,onClick:t=>{t.stopPropagation(),c(e)},className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,children:(0,U.jsx)(Ri,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,title:`Copy Link`,onClick:async t=>{t.stopPropagation();try{let t=e.driveUrl;t||=(await W(`/files/${e.id}/view-url`)).url??(await W(`/files/${e.id}/share`,{method:`POST`})).url,await navigator.clipboard.writeText(t),f(e.id??null),l.success(`Link copied to clipboard!`),setTimeout(()=>f(null),2e3)}catch{l.error(`Failed to copy link.`)}},className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,children:d===e.id?(0,U.jsx)(xr,{className:`h-4 w-4 text-[#0F9D58]`}):(0,U.jsx)(ii,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,title:t===`starred`?`Remove from Starred`:`Add to Starred`,onClick:async n=>{n.stopPropagation();try{await W(`/files/${e.id}/star`,{method:`POST`,body:JSON.stringify({starred:t!==`starred`})}),window.dispatchEvent(new Event(`9drive:starred-changed`))}catch{}},className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,children:(0,U.jsx)(Ni,{className:xo(`h-4 w-4`,t===`starred`?`fill-[#FBBC04] text-[#FBBC04]`:``)})}),(0,U.jsx)(`button`,{type:`button`,title:`Move File`,onClick:t=>{t.stopPropagation(),window.dispatchEvent(new CustomEvent(`9drive:open-move-modal`,{detail:e}))},className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,children:(0,U.jsx)(Kr,{className:`h-4 w-4`})})]}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10 shrink-0`,onClick:t=>{t.stopPropagation(),i?.(t,e)},"aria-label":`Open ${e.name} menu`,children:(0,U.jsx)(Rr,{className:`h-4 w-4`})})]})})]},e.id??e.name)})})]})})]})}function _s({icon:e,label:t,onClick:n,danger:r=!1,kbd:i}){return(0,U.jsxs)(`button`,{type:`button`,onClick:n,className:[`flex h-9 w-full items-center gap-3 px-3.5 text-[13px] font-normal transition-all duration-150 active:scale-[0.98] text-left select-none`,r?`text-[#B3261E] hover:bg-[#F9DEDC]/50 dark:text-[#F2B8B5] dark:hover:bg-[#8C1D18]/30`:`text-[#1F1F1F] hover:bg-[#F0F4F9] dark:text-[#E3E3E3] dark:hover:bg-[#28292A]`].join(` `),children:[(0,U.jsx)(e,{className:`h-4 w-4 shrink-0 text-[#444746] dark:text-[#C4C7C5]`}),(0,U.jsx)(`span`,{className:`flex-1 truncate`,children:t}),i&&(0,U.jsx)(`span`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:i})]})}function vs({x:e,y:t,folder:n,onClose:r,onCut:i,onRename:a,onShare:o,onCopyLink:s,onDelete:c}){let{t:l}=Fo();if(!n)return null;let u=Math.max(12,Math.min(e,window.innerWidth-240)),d=Math.max(12,Math.min(t,window.innerHeight-300));return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`fixed inset-0 z-40 cursor-default`,"aria-hidden":`true`,onClick:r}),(0,U.jsxs)(`div`,{className:`fixed z-50 w-56 overflow-hidden rounded-2xl border border-[#E0E3E7] bg-white py-1.5 shadow-[0_8px_32px_rgba(0,0,0,0.12)] dark:border-[#36373A] dark:bg-[#1E1F20] dark:shadow-[0_12px_36px_rgba(0,0,0,0.6)] animate-m3-popover`,style:window.innerWidth>=640?{left:u,top:d}:{insetInline:`0.75rem`,bottom:`0.75rem`,position:`fixed`},children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 border-b border-[#E0E3E7] px-3.5 py-2.5 dark:border-[#36373A]`,children:[(0,U.jsx)(Yr,{className:`h-4 w-4 shrink-0 text-[#0B57D0]`}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`p`,{className:`truncate text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:n.name}),(0,U.jsx)(`p`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:`Folder`})]})]}),(0,U.jsxs)(`div`,{className:`py-1`,children:[n?.driveUrl?(0,U.jsx)(_s,{icon:zr,label:l(`menu.open_in_gdrive`,`Open in Google Drive`),onClick:()=>{window.open(n.driveUrl,`_blank`),r()}}):null,(0,U.jsx)(_s,{icon:Ri,label:l(`menu.share`,`Share`),onClick:o}),(0,U.jsx)(_s,{icon:ii,label:l(`menu.copy_link`,`Copy link`),onClick:s}),(0,U.jsx)(_s,{icon:wi,label:l(`menu.cut_folder`,`Move / Cut`),onClick:i,kbd:`Ctrl+X`}),(0,U.jsx)(_s,{icon:yi,label:l(`menu.rename`,`Rename`),onClick:a}),(0,U.jsx)(`div`,{className:`my-1.5 h-px bg-[#E0E3E7] dark:bg-[#36373A]`}),(0,U.jsx)(_s,{icon:Fi,label:l(`menu.move_to_trash`,`Move to trash`),onClick:c,danger:!0})]})]})]})}var ys={"text-blue-500":`#3b82f6`,"text-lime-500":`#84cc16`,"text-cyan-400":`#22d3ee`,"text-yellow-400":`#facc15`,"text-orange-500":`#f97316`},bs=`#3b82f6`,xs=`https://api.iconify.design/lucide:folder.svg`,Ss=[{label:`Folder`,url:xs},{label:`Folder Open`,url:`https://api.iconify.design/lucide:folder-open.svg`},{label:`Folders`,url:`https://api.iconify.design/lucide:folders.svg`},{label:`Files`,url:`https://api.iconify.design/lucide:files.svg`},{label:`File Text`,url:`https://api.iconify.design/lucide:file-text.svg`},{label:`File Image`,url:`https://api.iconify.design/lucide:file-image.svg`},{label:`File Video`,url:`https://api.iconify.design/lucide:file-video.svg`},{label:`File Music`,url:`https://api.iconify.design/lucide:file-music.svg`},{label:`File Code`,url:`https://api.iconify.design/lucide:file-code.svg`},{label:`File Archive`,url:`https://api.iconify.design/lucide:file-archive.svg`},{label:`Briefcase`,url:`https://api.iconify.design/lucide:briefcase.svg`},{label:`Archive`,url:`https://api.iconify.design/lucide:archive.svg`},{label:`Cloud`,url:`https://api.iconify.design/lucide:cloud.svg`},{label:`Cloud Upload`,url:`https://api.iconify.design/lucide:cloud-upload.svg`},{label:`Cloud Download`,url:`https://api.iconify.design/lucide:cloud-download.svg`},{label:`Hard Drive`,url:`https://api.iconify.design/lucide:hard-drive.svg`},{label:`Database`,url:`https://api.iconify.design/lucide:database.svg`},{label:`Server`,url:`https://api.iconify.design/lucide:server.svg`},{label:`Image`,url:`https://api.iconify.design/lucide:image.svg`},{label:`Images`,url:`https://api.iconify.design/lucide:images.svg`},{label:`Video`,url:`https://api.iconify.design/lucide:video.svg`},{label:`Film`,url:`https://api.iconify.design/lucide:film.svg`},{label:`Music`,url:`https://api.iconify.design/lucide:music.svg`},{label:`Headphones`,url:`https://api.iconify.design/lucide:headphones.svg`},{label:`Code`,url:`https://api.iconify.design/lucide:code.svg`},{label:`Terminal`,url:`https://api.iconify.design/lucide:terminal.svg`},{label:`Package`,url:`https://api.iconify.design/lucide:package.svg`},{label:`Box`,url:`https://api.iconify.design/lucide:box.svg`},{label:`Book Open`,url:`https://api.iconify.design/lucide:book-open.svg`},{label:`Notebook`,url:`https://api.iconify.design/lucide:notebook.svg`},{label:`Graduation Cap`,url:`https://api.iconify.design/lucide:graduation-cap.svg`},{label:`Receipt`,url:`https://api.iconify.design/lucide:receipt.svg`},{label:`Wallet`,url:`https://api.iconify.design/lucide:wallet.svg`},{label:`Chart`,url:`https://api.iconify.design/lucide:chart-column.svg`},{label:`Calendar`,url:`https://api.iconify.design/lucide:calendar.svg`},{label:`Clock`,url:`https://api.iconify.design/lucide:clock.svg`},{label:`Users`,url:`https://api.iconify.design/lucide:users.svg`},{label:`User Check`,url:`https://api.iconify.design/lucide:user-check.svg`},{label:`Share`,url:`https://api.iconify.design/lucide:share-2.svg`},{label:`Lock`,url:`https://api.iconify.design/lucide:lock.svg`},{label:`Shield`,url:`https://api.iconify.design/lucide:shield.svg`},{label:`Star`,url:`https://api.iconify.design/lucide:star.svg`},{label:`Heart`,url:`https://api.iconify.design/lucide:heart.svg`},{label:`Rocket`,url:`https://api.iconify.design/lucide:rocket.svg`},{label:`Sparkles`,url:`https://api.iconify.design/lucide:sparkles.svg`}],Cs=[`#3b82f6`,`#84cc16`,`#22d3ee`,`#facc15`,`#f97316`,`#ef4444`,`#a855f7`,`#14b8a6`];function ws(e){return e?.startsWith(`#`)?e:ys[e??``]??`#3b82f6`}function Ts(e,t){return`${e}${e.includes(`?`)?`&`:`?`}color=${encodeURIComponent(t)}`}function Es({folder:e,className:t,iconClassName:n}){let r=ws(e.color),i=e.iconUrl||`https://api.iconify.design/lucide:folder.svg`;return(0,U.jsx)(`span`,{className:xo(`inline-flex items-center justify-center`,t),children:i?(0,U.jsx)(`img`,{src:Ts(i,r),alt:``,className:xo(`h-full w-full object-contain`,n)}):(0,U.jsx)(Yr,{className:xo(`h-full w-full fill-current stroke-current`,n),style:{color:r}})})}function Ds({items:e,mobileTwoColumns:t=!1,sizeScale:n=`md`,onFolderMenu:r,onFolderOpen:i,onDropItem:a}){return(0,U.jsx)(`div`,{className:xo(`mt-3 grid gap-3`,n===`xs`?`grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6`:n===`sm`?`grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5`:n===`lg`?`grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-3`:`grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-4`,t&&`grid-cols-2`),children:e.map(e=>(0,U.jsxs)(`div`,{onClick:()=>i?.(e),onContextMenu:t=>r?.(t,e),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect=`move`},onDragEnter:e=>{e.currentTarget.classList.add(`bg-[#C2E7FF]/50`,`border-[#0B57D0]`,`dark:bg-[#004A77]/40`,`dark:border-[#A8C7FA]`)},onDragLeave:e=>{e.currentTarget.classList.remove(`bg-[#C2E7FF]/50`,`border-[#0B57D0]`,`dark:bg-[#004A77]/40`,`dark:border-[#A8C7FA]`)},onDrop:t=>{t.preventDefault(),t.currentTarget.classList.remove(`bg-[#C2E7FF]/50`,`border-[#0B57D0]`,`dark:bg-[#004A77]/40`,`dark:border-[#A8C7FA]`);let n=t.dataTransfer.getData(`text/plain`);n&&e.id&&a?.(n,e.id)},className:`group relative flex h-12 items-center gap-3 rounded-xl border border-[#E0E3E7] bg-[#F8FAFD] px-3.5 transition-all duration-200 ease-[cubic-bezier(0.05,0.7,0.1,1.0)] hover:-translate-y-0.5 hover:shadow-sm hover:border-[#747775]/40 hover:bg-[#F0F4F9] active:scale-[0.98] dark:border-[#36373A] dark:bg-[#28292A] dark:hover:border-[#747775]/60 dark:hover:bg-[#333537] cursor-pointer select-none`,children:[(0,U.jsx)(`div`,{className:`shrink-0 flex items-center justify-center`,children:(0,U.jsx)(Es,{folder:e,className:`h-6 w-6`})}),(0,U.jsx)(`span`,{className:`flex-1 truncate text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,title:e.name,children:e.name}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-[#444746] opacity-0 transition-opacity hover:bg-black/5 group-hover:opacity-100 dark:text-[#C4C7C5] dark:hover:bg-white/10`,onClick:t=>{t.stopPropagation(),r?.(t,e)},"aria-label":`Open ${e.name} menu`,children:(0,U.jsx)(Rr,{className:`h-4 w-4`})})]},e.id||e.name))})}function Os({className:e,...t}){return(0,U.jsx)(`input`,{className:xo(`h-10 w-full rounded-lg border border-[#747775]/40 bg-white px-3.5 text-sm text-[#1F1F1F] placeholder:text-[#747775] outline-none transition focus:border-[#0B57D0] focus:ring-2 focus:ring-[#0B57D0]/20 disabled:opacity-50 dark:bg-[#1E1F20] dark:border-[#747775]/50 dark:text-[#E3E3E3] dark:placeholder:text-[#8E918F] dark:focus:border-[#A8C7FA]`,e),...t})}function ks({value:e,onChange:t,options:n,placeholder:r=`Select an option`,variant:i=`default`,className:a,dropdownClassName:o,disabled:s=!1,id:c,name:l,"aria-label":u}){let[d,f]=v.useState(!1),p=v.useRef(null),m=v.useMemo(()=>n.find(t=>t.value===e),[n,e]);v.useEffect(()=>{if(!d)return;let e=e=>{p.current&&!p.current.contains(e.target)&&f(!1)},t=e=>{e.key===`Escape`&&f(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e),document.removeEventListener(`keydown`,t)}},[d]);let h=e=>{e.disabled||(t?.(e.value),f(!1))},g={default:`h-10 px-3.5 text-sm rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] dark:border-[#747775]/50 text-[#1F1F1F] dark:text-[#E3E3E3]`,sm:`h-9 px-3 text-xs rounded-lg border border-[#747775]/40 bg-white dark:bg-[#1E1F20] dark:border-[#747775]/50 text-[#1F1F1F] dark:text-[#E3E3E3]`,chip:xo(`h-8 px-3.5 text-xs font-medium rounded-full border transition-colors whitespace-nowrap`,e&&e!==`all`&&e!==`date_desc`?`border-[#0B57D0]/60 bg-[#C2E7FF]/50 text-[#001D35] dark:border-[#A8C7FA]/60 dark:bg-[#004A77]/40 dark:text-[#C2E7FF]`:`border-[#747775]/30 bg-white dark:bg-[#1E1F20] dark:border-[#747775]/50 text-[#1F1F1F] dark:text-[#E3E3E3] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`)},_=d?`border-[#0B57D0] ring-2 ring-[#0B57D0]/20 dark:border-[#A8C7FA] dark:ring-[#A8C7FA]/20`:`hover:border-[#0B57D0]/60 dark:hover:border-[#A8C7FA]/60`;return(0,U.jsxs)(`div`,{ref:p,className:xo(`relative inline-block text-left`,d?`z-50`:`z-20`,a),children:[l&&(0,U.jsx)(`input`,{type:`hidden`,name:l,value:e??``}),(0,U.jsxs)(`button`,{type:`button`,id:c,"aria-label":u,"aria-haspopup":`listbox`,"aria-expanded":d,disabled:s,onClick:()=>!s&&f(e=>!e),className:xo(`flex w-full items-center justify-between gap-2 text-left transition-all duration-200 ease-[cubic-bezier(0.05,0.7,0.1,1.0)] active:scale-[0.98] cursor-pointer select-none outline-none`,g[i],_,s&&`opacity-50 cursor-not-allowed pointer-events-none`),children:[(0,U.jsxs)(`span`,{className:`flex items-center gap-2 truncate`,children:[m?.icon,(0,U.jsx)(`span`,{className:`truncate`,children:m?m.label:r})]}),(0,U.jsx)(Sr,{className:xo(`h-3.5 w-3.5 shrink-0 text-[#747775] dark:text-[#8E918F] transition-transform duration-200 ease-[cubic-bezier(0.05,0.7,0.1,1.0)]`,d&&`rotate-180 text-[#0B57D0] dark:text-[#A8C7FA]`)})]}),d&&(0,U.jsx)(`div`,{role:`listbox`,tabIndex:-1,className:xo(`absolute left-0 top-full z-[100] mt-1.5 w-max min-w-full max-w-[calc(100vw-2rem)] max-h-64 overflow-y-auto rounded-2xl border border-[#E0E3E7] bg-white p-1.5 shadow-[0_8px_30px_rgba(0,0,0,0.12)] backdrop-blur-sm dark:border-[#36373A] dark:bg-[#1E1F20] dark:shadow-[0_12px_36px_rgba(0,0,0,0.7)] animate-m3-popover origin-top`,o),children:n.length===0?(0,U.jsx)(`div`,{className:`px-3 py-2 text-xs text-[#747775] dark:text-[#8E918F]`,children:`No options available`}):n.map(t=>{let n=t.value===e;return(0,U.jsxs)(`div`,{role:`option`,"aria-selected":n,onClick:()=>h(t),className:xo(`group flex items-center justify-between gap-2 rounded-lg px-3 py-2 transition-all duration-150 active:scale-[0.99] cursor-pointer select-none`,i==="default"?`text-sm`:`text-xs`,n?`bg-[#C2E7FF]/40 text-[#001D35] font-medium dark:bg-[#004A77]/40 dark:text-[#C2E7FF]`:`text-[#1F1F1F] hover:bg-[#F0F4F9] dark:text-[#E3E3E3] dark:hover:bg-[#28292A]`,t.disabled&&`opacity-40 cursor-not-allowed pointer-events-none`),children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 truncate`,children:[t.icon,(0,U.jsxs)(`div`,{className:`truncate`,children:[(0,U.jsx)(`div`,{children:t.label}),t.description&&(0,U.jsx)(`div`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:t.description})]})]}),n&&(0,U.jsx)(xr,{className:`h-4 w-4 shrink-0 text-[#0B57D0] dark:text-[#A8C7FA]`})]},t.value)})})]})}function As(){return window.Plyr?Promise.resolve():(window.__plyrReady||(window.__plyrReady=new Promise((e,t)=>{if(!document.querySelector(`link[data-plyr="true"]`)){let e=document.createElement(`link`);e.rel=`stylesheet`,e.href=`https://cdnjs.cloudflare.com/ajax/libs/plyr/3.7.8/plyr.css`,e.dataset.plyr=`true`,document.head.appendChild(e)}let n=document.querySelector(`script[data-plyr="true"]`);if(n){n.addEventListener(`load`,()=>e(),{once:!0}),n.addEventListener(`error`,()=>t(Error(`Failed to load Plyr`)),{once:!0});return}let r=document.createElement(`script`);r.src=`https://cdnjs.cloudflare.com/ajax/libs/plyr/3.7.8/plyr.min.js`,r.async=!0,r.dataset.plyr=`true`,r.onload=()=>e(),r.onerror=()=>t(Error(`Failed to load Plyr`)),document.body.appendChild(r)})),window.__plyrReady)}function js(e){return window.Plyr?new window.Plyr(e,{ratio:`16:9`,controls:[`play-large`,`play`,`progress`,`current-time`,`mute`,`volume`,`captions`,`settings`,`pip`,`airplay`,`fullscreen`]}):null}var Ms=new Set([`application/msword`,`application/vnd.ms-excel`,`application/vnd.ms-powerpoint`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`]),Ns=new Set([`application/vnd.google-apps.document`,`application/vnd.google-apps.spreadsheet`,`application/vnd.google-apps.presentation`]);function Ps(e){return e?e.startsWith(`image/`)||e===`application/vnd.google-apps.drawing`?`image`:e.startsWith(`video/`)?`video`:e===`application/pdf`||Ns.has(e)?`document`:Ms.has(e)?`office`:null:null}function Fs(e){return`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(e)}`}var Is=`9drive:all-files-view-mode`;function Ls(){let e=localStorage.getItem(Is);return e===`grid`||e===`list`?e:`list`}function Rs(e){return e.startsWith(`image/`)?`image`:e.startsWith(`video/`)?`video`:e.includes(`pdf`)?`pdf`:`doc`}function zs(e){return e===`s3`?`S3 Storage`:`Google Drive`}function Bs(e){let t=e.driveUrl??(e.providerFileId?`https://drive.google.com/file/d/${e.providerFileId}/view?usp=sharing`:void 0);return{id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes,createdAt:e.createdAt,accountEmail:e.connectedAccount?.email,accountProvider:zs(e.connectedAccount?.provider),date:To(e.createdAt),size:wo(e.sizeBytes),access:e.connectedAccount?.email??zs(e.connectedAccount?.provider),kind:Rs(e.mimeType),shared:1,folderId:e.folderId,folderName:e.folder?.name,providerFileId:e.providerFileId,driveUrl:t}}function Vs(e){let t=e.driveUrl??(e.providerFolderId?`https://drive.google.com/drive/folders/${e.providerFolderId}`:void 0);return{id:e.id,name:e.name,color:e.color,iconUrl:e.iconUrl,parentId:e.parentId,providerFolderId:e.providerFolderId,driveUrl:t,updated:`Updated ${To(e.updatedAt)}`}}function Hs({color:e,iconUrl:t,onColorChange:n,onIconChange:r}){let i=ws(e);return(0,U.jsxs)(`div`,{className:`grid gap-4`,children:[(0,U.jsxs)(`label`,{className:`grid gap-2 text-sm font-semibold`,children:[`Folder Color`,(0,U.jsx)(Os,{type:`color`,value:i,onChange:e=>n(e.target.value),className:`h-12 p-1`})]}),(0,U.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:Cs.map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>n(e),className:i===e?`h-8 w-8 rounded-lg border-2 border-blue-600`:`h-8 w-8 rounded-lg border border-slate-200`,style:{backgroundColor:e},"aria-label":`Use ${e} folder color`},e))}),(0,U.jsxs)(`div`,{className:`grid gap-2 text-sm font-semibold`,children:[(0,U.jsx)(`span`,{children:`Folder Icon`}),(0,U.jsx)(`div`,{className:`grid grid-cols-4 gap-2 sm:grid-cols-8`,children:Ss.map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>r(e.url),className:t===e.url?`flex h-12 items-center justify-center rounded-xl border-2 border-blue-600 bg-blue-50 p-2`:`flex h-12 items-center justify-center rounded-xl border border-slate-200 bg-slate-50 p-2 hover:bg-slate-100`,title:e.label,"aria-label":`Use ${e.label} icon`,children:(0,U.jsx)(`img`,{src:`${e.url}?color=${encodeURIComponent(i)}`,alt:``,className:`h-6 w-6`})},e.url))})]})]})}function Us(){let[e,t]=Fn(),n=e.get(`folderId`),r=e.get(`q`)?.trim()??``,[i,a]=(0,v.useState)(!1),o=(0,v.useRef)(null),[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(0),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(!1),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(!1),[D,O]=(0,v.useState)(!1),[k,A]=(0,v.useState)(null),[j,M]=(0,v.useState)(``),[N,P]=(0,v.useState)(``),[F,I]=(0,v.useState)(!1),[L,R]=(0,v.useState)([]),[ee,te]=(0,v.useState)([]),[ne,re]=(0,v.useState)([]),[z,ie]=(0,v.useState)([]),[ae,oe]=(0,v.useState)(``),[se,ce]=(0,v.useState)(!1),[le,ue]=(0,v.useState)(``),[de,fe]=(0,v.useState)(bs),[B,pe]=(0,v.useState)(xs),[me,he]=(0,v.useState)(``),[ge,_e]=(0,v.useState)(``),[ve,ye]=(0,v.useState)(bs),[V,H]=(0,v.useState)(xs),[be,xe]=(0,v.useState)(null),[Se,Ce]=(0,v.useState)(null),[we,Te]=(0,v.useState)(new Set),[Ee,De]=(0,v.useState)(null),[Oe,ke]=(0,v.useState)({x:0,y:0,file:null}),[Ae,je]=(0,v.useState)({x:0,y:0,folder:null}),[Me,Ne]=(0,v.useState)({x:0,y:0,open:!1}),{toast:Pe}=as(),[Fe,Ie]=(0,v.useState)(!1),[Le,Re]=(0,v.useState)(!1),[ze,Be]=(0,v.useState)(Ls),{uploadFiles:Ve}=Uo(),{selectedAccountId:He,getDriveLetter:Ue}=Ao(),We=(0,v.useRef)(null),{setHeaderActions:Ge}=Yo(),{language:Ke,t:qe}=Fo(),[Je,Ye]=(0,v.useState)([]),[Xe,Ze]=(0,v.useState)(``),[Qe,$e]=(0,v.useState)(!1),[et,tt]=(0,v.useState)(!1);async function nt(){let t=new URLSearchParams;n&&t.set(`folderId`,n),r&&t.set(`q`,r);let i=e.get(`kind`),a=e.get(`accountId`),o=e.get(`modified`),s=e.get(`minSize`),c=e.get(`maxSize`),l=e.get(`startDate`),u=e.get(`endDate`);i&&i!==`all`&&t.set(`kind`,i),a?a!==`all`&&t.set(`accountId`,a):He&&He!==`all`&&t.set(`accountId`,He),o&&o!==`all`&&t.set(`modified`,o),s&&t.set(`minSize`,s),c&&t.set(`maxSize`,c),l&&t.set(`startDate`,l),u&&t.set(`endDate`,u);let d=t.toString();R((await W(d?`/files?${d}`:`/files`)).files.map(Bs))}async function rt(){let t=new URLSearchParams;n&&t.set(`parentId`,n);let r=e.get(`accountId`)||(He===`all`?``:He);r&&r!==`all`&&t.set(`accountId`,r);let i=t.toString(),a=i?`/folders?${i}`:`/folders`,o=new URLSearchParams({all:`1`});r&&r!==`all`&&o.set(`accountId`,r);let[s,c]=await Promise.all([W(a),W(`/folders?${o.toString()}`)]);te(s.folders.map(Vs)),re(c.folders.map(Vs))}async function it(){await Promise.all([nt(),rt()])}async function at(e,t){let n=we.has(e)?Array.from(we):[e];Ie(!0);try{await W(`/files/batch`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({fileIds:n,folderId:t})}),Pe.success(`Successfully moved ${n.length} item(s).`),it().catch(()=>void 0),Te(new Set)}catch(e){Pe.error(e instanceof Error?e.message:`Failed to move items`)}finally{Ie(!1)}}(0,v.useEffect)(()=>{it().catch(e=>Pe.error(e instanceof Error?e.message:`Failed to load files`)),Te(new Set)},[n,r,He,e.get(`accountId`),e.get(`kind`),e.get(`modified`)]);let ot=e.get(`previewFileId`);(0,v.useEffect)(()=>{if(!ot)return;let e=L.find(e=>e.id===ot);e&&jt(e)},[ot,L]),(0,v.useEffect)(()=>{async function e(){try{Ye((await W(`/connected-accounts`)).accounts||[])}catch(e){console.error(`Failed to load connected accounts:`,e)}}e()},[]),(0,v.useEffect)(()=>{function e(e){e.key===`Escape`&&ke({x:0,y:0,file:null}),e.key===`Escape`&&je({x:0,y:0,folder:null}),e.key===`Escape`&&Ne({x:0,y:0,open:!1}),e.ctrlKey&&e.key.toLowerCase()===`x`&&Se&&(e.preventDefault(),Wt(Se)),e.ctrlKey&&e.key.toLowerCase()===`v`&&Ee&&(e.preventDefault(),Gt().catch(e=>Pe.error(e instanceof Error?e.message:`Failed to paste folder`)))}function t(e){let t=e.detail;xe(t),oe(t.folderId||``),b(!0)}return window.addEventListener(`keydown`,e),window.addEventListener(`9drive:open-move-modal`,t),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`9drive:open-move-modal`,t)}},[Se,Ee,n]),(0,v.useEffect)(()=>{if(!C||!be?.mimeType?.startsWith(`video/`)||!We.current)return;let e=!1,t=null;return As().then(()=>{e||!We.current||(t=js(We.current))}).catch(()=>void 0),()=>{e=!0,t?.destroy()}},[C,be?.mimeType,j]);async function st(e){e.preventDefault(),await W(`/folders`,{method:`POST`,body:JSON.stringify({name:le,color:de,iconUrl:B,parentId:n??null,accountId:He===`all`?void 0:He})}),ue(``),fe(bs),pe(xs),d(!1),await rt()}async function ct(e,t){if(!e||e.length===0)return;let r=t===void 0?n||null:t,i=Xe||(He===`all`?null:He);try{await Ve(e,r,i)}catch(e){console.error(`Direct upload failed:`,e),Pe.error(`Upload initiation failed`)}}function lt(e){e.preventDefault(),e.stopPropagation(),l.current++,e.dataTransfer.types.includes(`Files`)&&c(!0)}function ut(e){e.preventDefault(),e.stopPropagation(),l.current--,l.current<=0&&(l.current=0,c(!1))}function dt(e){e.preventDefault(),e.stopPropagation()}function ft(e){e.preventDefault(),e.stopPropagation(),l.current=0,c(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&ct(t)}async function pt(e){if(e.preventDefault(),z.length===0)return;Ie(!0);let t=[...z],r=n||ae,i=Xe||(He===`all`?null:He);ie([]),oe(``),Ze(``),a(!1);try{await Ve(t,r,i)}catch(e){console.error(`Upload initiation failed:`,e)}finally{Ie(!1)}}async function mt(){Re(!0);try{let e=await W(`/files/sync-google`,{method:`POST`,body:JSON.stringify({})}),t=0,n=0,r=0;for(let i of e.results)t+=i.created,n+=i.updated,r+=i.deleted;let i=e.results.length;Pe.success(`Google Drive synced. ${t} added, ${n} updated, ${r} removed across ${i} account${i===1?``:`s`}.`),await it(),window.dispatchEvent(new Event(`9drive:storage-changed`))}catch(e){Pe.error(e instanceof Error?e.message:`Failed to sync Google Drive`)}finally{Re(!1)}}function ht(e){if(!e)return;let t=Array.from(e);t.length!==0&&ie(t)}function gt(e){ie(t=>t.filter((t,n)=>n!==e))}function _t(e){e.preventDefault(),e.stopPropagation(),(e.type===`dragenter`||e.type===`dragover`)&&ce(!0),(e.type===`dragleave`||e.type===`drop`)&&ce(!1),e.type===`drop`&&ht(e.dataTransfer.files)}function vt(e,t){e.preventDefault(),e.stopPropagation(),xe(t),ke({x:e.clientX,y:e.clientY,file:t})}function yt(e){e.id&&Te(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})}let bt=e.get(`sort`)||`date_desc`,xt=(0,v.useMemo)(()=>[...ee].sort((e,t)=>bt===`name_asc`?e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`}):bt===`name_desc`?t.name.localeCompare(e.name,void 0,{numeric:!0,sensitivity:`base`}):bt===`date_asc`?new Date(e.updated||0).getTime()-new Date(t.updated||0).getTime():new Date(t.updated||0).getTime()-new Date(e.updated||0).getTime()),[ee,n,bt]),St=(0,v.useMemo)(()=>[...L].sort((e,t)=>{if(bt===`name_asc`)return e.name.localeCompare(t.name,void 0,{numeric:!0,sensitivity:`base`});if(bt===`name_desc`)return t.name.localeCompare(e.name,void 0,{numeric:!0,sensitivity:`base`});if(bt===`size_desc`)return Number(t.sizeBytes||0)-Number(e.sizeBytes||0);if(bt===`size_asc`)return Number(e.sizeBytes||0)-Number(t.sizeBytes||0);if(bt===`date_asc`)return(e.createdAt?new Date(e.createdAt).getTime():0)-(t.createdAt?new Date(t.createdAt).getTime():0);let n=e.createdAt?new Date(e.createdAt).getTime():0;return(t.createdAt?new Date(t.createdAt).getTime():0)-n}),[L,bt]);function Ct(){let e=St.map(e=>e.id).filter(Boolean);Te(e.length>0&&e.every(e=>we.has(e))?new Set:new Set(e))}function wt(){Te(new Set)}function Tt(e){Be(e),localStorage.setItem(Is,e)}function Et(e,t){e.preventDefault(),e.stopPropagation(),Ce(t),je({x:e.clientX,y:e.clientY,folder:t})}function Dt(e){e.id&&t(r?{folderId:e.id,q:r}:{folderId:e.id})}function Ot(e){t(r?{folderId:e,q:r}:{folderId:e})}function kt(e){e.preventDefault(),Ne({x:e.clientX,y:e.clientY,open:!0})}function At(){t(r?{q:r}:{})}async function jt(e){xe(e),M(``),P(``),I(!0),w(!0),ke({x:0,y:0,file:null});try{let t=await W(`/files/${e.id}/preview-token`,{method:`POST`});M(`${t.path??new URL(t.url).pathname}`)}catch(e){P(e instanceof Error?e.message:`Failed to load preview`)}finally{I(!1)}}async function Mt(){be?.id&&await jt(be)}async function Nt(){if(!be?.id)return;let e=await fetch(`/files/${be.id}/download`,{headers:{Authorization:`Bearer ${Yn()}`}});if(!e.ok)throw Error(`Download failed`);let t=await e.blob(),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=be.name,r.click(),URL.revokeObjectURL(n),ke({x:0,y:0,file:null})}async function Pt(){let e=[...we];if(e.length!==0){Ie(!0);try{let t=await fetch(`/files/batch-download`,{method:`POST`,headers:{"Content-Type":`application/json`,Authorization:`Bearer ${Yn()}`},body:JSON.stringify({fileIds:e})});if(!t.ok)throw Error(`Failed to download ZIP file`);let n=await t.blob(),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=`9drive-download.zip`,i.click(),URL.revokeObjectURL(r),wt(),Pe.success(`Batch download complete.`)}catch(e){Pe.error(e instanceof Error?e.message:`Batch download failed`)}finally{Ie(!1)}}}async function Ft(e){e.preventDefault(),be?.id&&(await W(`/files/${be.id}`,{method:`PATCH`,body:JSON.stringify({name:me})}),p(!1),await nt())}async function It(e){e.preventDefault();let t=[...we];if(t.length>0)await W(`/files/batch`,{method:`PATCH`,body:JSON.stringify({fileIds:t,folderId:ae||null})});else if(be?.id)await W(`/files/${be.id}`,{method:`PATCH`,body:JSON.stringify({folderId:ae||null})});else return;b(!1),oe(``),wt(),await nt()}async function Lt(){let e=[...we];if(e.length>0)await W(`/files/batch`,{method:`DELETE`,body:JSON.stringify({fileIds:e})});else if(be?.id)await W(`/files/${be.id}`,{method:`DELETE`});else return;S(!1),wt(),await nt(),window.dispatchEvent(new Event(`9drive:storage-changed`))}function Rt(e){let t=e&&typeof e==`object`&&`id`in e&&`name`in e?e:be??Oe.file;t?.id&&(xe(t),A({id:t.id,name:t.name,driveUrl:t.driveUrl,provider:t.accountProvider,type:`file`}),O(!0),ke({x:0,y:0,file:null}))}function zt(e){let t=e&&typeof e==`object`&&`id`in e&&`name`in e?e:Se??Ae.folder;t?.id&&(Ce(t),A({id:t.id,name:t.name,driveUrl:t.driveUrl,type:`folder`}),O(!0),je({x:0,y:0,folder:null}))}async function Bt(e){let t=e&&typeof e==`object`&&`id`in e&&`name`in e?e:be??Oe.file;if(t?.id){try{let e=t.driveUrl;e||=(await W(`/files/${t.id}/share`,{method:`POST`})).url,await navigator.clipboard.writeText(e),Pe.success(`Google Drive link copied to clipboard!`)}catch(e){Pe.error(`Failed to copy link: `+(e.message||e))}ke({x:0,y:0,file:null})}}async function Vt(e){let t=e&&typeof e==`object`&&`id`in e&&`name`in e?e:Se??Ae.folder;if(t?.id){try{let e=t.driveUrl||(t.providerFolderId?`https://drive.google.com/drive/folders/${t.providerFolderId}`:`${window.location.origin}/all-files?folderId=${t.id}`);await navigator.clipboard.writeText(e),Pe.success(`Google Drive folder link copied to clipboard!`)}catch(e){Pe.error(`Failed to copy folder link: `+(e.message||e))}je({x:0,y:0,folder:null})}}async function Ht(e){e.preventDefault(),Se?.id&&(await W(`/folders/${Se.id}`,{method:`PATCH`,body:JSON.stringify({name:ge,color:ve,iconUrl:V})}),h(!1),await rt())}async function Ut(){Se?.id&&(await W(`/folders/${Se.id}`,{method:`DELETE`}),_(!1),await rt())}function Wt(e){e?.id&&(De(e),je({x:0,y:0,folder:null}),Pe.info(`Folder "${e.name}" ready to move. Open target folder and press Ctrl+V.`))}async function Gt(){Ee?.id&&(await W(`/folders/${Ee.id}`,{method:`PATCH`,body:JSON.stringify({parentId:n??null})}),Pe.success(`Folder "${Ee.name}" moved.`),De(null),await rt())}function Kt(){if(M(``),P(``),I(!1),w(!1),e.get(`previewFileId`)){let n=new URLSearchParams(e);n.delete(`previewFileId`),t(n)}}(0,v.useEffect)(()=>{function e(){it().catch(()=>void 0)}function t(){o.current?.click()}function n(){d(!0)}function r(e){e?.detail&&(xe(e.detail),b(!0))}return window.addEventListener(`9drive:upload-completed`,e),window.addEventListener(`9drive:open-upload`,t),window.addEventListener(`9drive:open-new-folder`,n),window.addEventListener(`9drive:open-move-modal`,r),()=>{window.removeEventListener(`9drive:upload-completed`,e),window.removeEventListener(`9drive:open-upload`,t),window.removeEventListener(`9drive:open-new-folder`,n),window.removeEventListener(`9drive:open-move-modal`,r)}},[n]),(0,v.useEffect)(()=>{Ge((0,U.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,U.jsxs)(G,{size:`sm`,variant:`outline`,disabled:Le,onClick:mt,title:`Sync with Google Drive`,children:[(0,U.jsx)(Si,{className:Le?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),Le?`Syncing...`:`Sync`]})}))},[Le]);let qt=ne.find(e=>e.id===n),Jt=(()=>{if(!qt)return[];let e=new Map(ne.map(e=>[e.id,e])),t=[],n=new Set,r=qt;for(;r?.id&&!n.has(r.id);)t.unshift(r),n.add(r.id),r=r.parentId?e.get(r.parentId):void 0;return t})(),Yt=St.length>0&&St.every(e=>e.id&&we.has(e.id)),Xt=Ps(be?.mimeType);return(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`input`,{ref:o,type:`file`,multiple:!0,className:`sr-only`,onChange:e=>{e.target.files&&e.target.files.length>0&&(ct(Array.from(e.target.files)),e.target.value=``)}}),s&&(0,U.jsx)(`div`,{onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),c(!1),l.current=0},onDrop:ft,className:`fixed inset-0 z-[60] flex items-center justify-center bg-[#0B57D0]/10 dark:bg-[#A8C7FA]/10 backdrop-blur-xs border-4 border-dashed border-[#0B57D0] dark:border-[#A8C7FA] animate-in fade-in duration-150 m-4 rounded-3xl`,children:(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center gap-3 p-8 rounded-2xl bg-white dark:bg-[#1E1F20] shadow-2xl border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsx)(`div`,{className:`w-16 h-16 rounded-full bg-[#C2E7FF] dark:bg-[#004A77] flex items-center justify-center text-[#0B57D0] dark:text-[#C2E7FF] animate-bounce`,children:(0,U.jsx)(Li,{className:`w-8 h-8`})}),(0,U.jsx)(`h3`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:qe(`drag.drop_to_upload`,`Drop files to instantly upload`)}),(0,U.jsxs)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:[qe(`drag.will_upload_to`,`Will upload to:`),` `,(0,U.jsx)(`b`,{className:`text-[#0B57D0] dark:text-[#A8C7FA]`,children:qt?qt.name:`My Drive`})]})]})}),(0,U.jsxs)(`div`,{onContextMenu:kt,onDragEnter:lt,onDragLeave:ut,onDragOver:dt,onDrop:ft,className:`flex flex-col min-h-full w-full min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 pb-3 border-b border-[#E0E3E7]/70 dark:border-[#36373A]/70 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:At,className:xo(`text-xl sm:text-[22px] font-normal transition-colors hover:text-[#0B57D0]`,qt?`text-[#444746] dark:text-[#C4C7C5]`:`text-[#1F1F1F] dark:text-[#E3E3E3]`),children:`My Drive`}),Jt.map((e,t)=>(0,U.jsxs)(`span`,{className:`flex items-center gap-1.5 min-w-0`,children:[(0,U.jsx)(Cr,{className:`h-4 w-4 text-[#747775] shrink-0`}),t===Jt.length-1?(0,U.jsx)(`span`,{className:`truncate text-xl sm:text-[22px] font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:e.name}):(0,U.jsx)(`button`,{type:`button`,onClick:()=>e.id&&Ot(e.id),className:`truncate text-xl sm:text-[22px] font-normal text-[#444746] hover:text-[#0B57D0] dark:text-[#C4C7C5]`,children:e.name})]},e.id))]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 lg:hidden`,children:[(0,U.jsxs)(G,{size:`sm`,onClick:()=>o.current?.click(),children:[(0,U.jsx)(Li,{className:`h-3.5 w-3.5`}),`Upload`]}),(0,U.jsxs)(G,{size:`sm`,variant:`outline`,onClick:()=>d(!0),children:[(0,U.jsx)(Jr,{className:`h-3.5 w-3.5`}),`New Folder`]}),(0,U.jsx)(G,{size:`sm`,variant:`outline`,disabled:Le,onClick:mt,children:(0,U.jsx)(Si,{className:Le?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`})})]})]}),Je.length===0&&!Fe&&!Qe&&(0,U.jsx)(`div`,{className:`mt-3 relative overflow-hidden rounded-2xl border border-[#D3E3FD] bg-[#EDF2FC]/80 p-4 text-[#1F1F1F] shadow-xs dark:border-[#2C384A] dark:bg-[#1E232B]/80 dark:text-[#E3E3E3]`,children:(0,U.jsxs)(`div`,{className:`flex items-start gap-3.5`,children:[(0,U.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[#D3E3FD] text-[#0B57D0] dark:bg-[#004A77] dark:text-[#A8C7FA]`,children:(0,U.jsx)(Zr,{className:`h-5 w-5`})}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0 pr-6`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,U.jsx)(`h3`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:qe(`alert.no_storage_title`,`No Storage Connected`)}),(0,U.jsx)(`span`,{className:`rounded-full bg-[#D3E3FD] px-2.5 py-0.5 text-[10px] font-medium text-[#041E49] dark:bg-[#004A77] dark:text-[#C2E7FF]`,children:qe(`alert.setup_badge`,`Setup Required`)})]}),(0,U.jsx)(`p`,{className:`mt-1 text-xs leading-relaxed text-[#444746] dark:text-[#C4C7C5]`,children:qe(`alert.no_storage_desc`,`9Drive requires at least one active storage account (Google Drive or S3 Storage) to start uploading and managing files.`)}),(0,U.jsxs)(`div`,{className:`mt-2.5 rounded-xl border border-[#D3E3FD] bg-white p-3 text-xs dark:border-[#36373A] dark:bg-[#131314]`,children:[(0,U.jsxs)(`p`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5 mb-1`,children:[(0,U.jsx)(ei,{className:`h-3.5 w-3.5 text-[#0B57D0] dark:text-[#A8C7FA]`}),(0,U.jsx)(`span`,{children:qe(`alert.test_users_title`,`Google Cloud Console Note (Testing Mode):`)})]}),(0,U.jsx)(`p`,{className:`text-[11px] leading-relaxed text-[#444746] dark:text-[#C4C7C5]`,children:Ke===`id`?(0,U.jsxs)(U.Fragment,{children:[`Jika status aplikasi di Google Console masih `,(0,U.jsx)(`strong`,{children:`Testing`}),`, akun Gmail Anda `,(0,U.jsx)(`strong`,{children:`wajib didaftarkan di menu OAuth Consent Screen > Test Users`}),`. Tanpa ini, Google akan memblokir login dengan error `,(0,U.jsx)(`em`,{children:`"403: access_denied"`}),`.`]}):(0,U.jsxs)(U.Fragment,{children:[`If your Google Console app status is still `,(0,U.jsx)(`strong`,{children:`Testing`}),`, your Gmail account `,(0,U.jsx)(`strong`,{children:`must be added to OAuth Consent Screen > Test Users`}),`. Otherwise Google will block access with error `,(0,U.jsx)(`em`,{children:`"403: access_denied"`}),`.`]})})]}),(0,U.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,U.jsxs)(Dn,{to:`/settings`,className:`inline-flex items-center gap-1.5 rounded-full bg-[#0B57D0] px-4 py-1.5 text-xs font-medium text-white shadow-xs transition hover:bg-[#0842A0] dark:bg-[#A8C7FA] dark:text-[#001D35] dark:hover:bg-[#C2E7FF]`,children:[(0,U.jsx)(Di,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:qe(`alert.open_settings`,`Open Settings & Connect`)})]}),(0,U.jsxs)(G,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>tt(!0),className:`rounded-full h-8 text-xs border-[#747775]/40 bg-white text-[#1F1F1F] hover:bg-[#F0F4F9] dark:border-[#747775]/50 dark:bg-[#131314] dark:text-[#E3E3E3] dark:hover:bg-[#282A2C]`,children:[(0,U.jsx)(ei,{className:`h-3.5 w-3.5 text-[#0B57D0] dark:text-[#A8C7FA]`}),(0,U.jsx)(`span`,{children:qe(`alert.guide_btn`,`Google Console Setup Guide`)})]})]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>$e(!0),className:`absolute top-3 right-3 rounded-full p-1.5 text-[#747775] hover:bg-black/5 hover:text-[#1F1F1F] dark:text-[#8E918F] dark:hover:bg-white/10 dark:hover:text-[#E3E3E3]`,title:Ke===`id`?`Tutup sementara`:`Dismiss`,children:(0,U.jsx)(Hi,{className:`h-4 w-4`})})]})}),r&&(0,U.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-3 rounded-2xl bg-[#E8F0FE] px-4 py-2.5 text-xs text-[#001D35] dark:bg-[#004A77]/40 dark:text-[#C2E7FF]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,U.jsxs)(`span`,{children:[`🔍 `,qe(`search.showing_results`,`Showing search results for`),` "`,(0,U.jsx)(`b`,{children:r}),`"`,` `,(()=>{let t=e.get(`accountId`)||(He===`all`?``:He);if(t&&t!==`all`){let e=Je.find(e=>e.id===t),n=Ue(t);return(0,U.jsxs)(U.Fragment,{children:[Ke===`id`?`di`:`in`,` `,(0,U.jsxs)(`b`,{className:`text-[#0B57D0] dark:text-[#A8C7FA]`,children:[`Drive `,n]}),` (`,e?.email||`selected account`,`)`]})}return(0,U.jsx)(`b`,{children:qe(`search.in_all_accounts`,`across all drive accounts`)})})()]}),(()=>{let n=e.get(`accountId`)||(He===`all`?``:He);return n&&n!==`all`?(0,U.jsx)(`button`,{type:`button`,onClick:()=>{let n=new URLSearchParams(e);n.set(`accountId`,`all`),t(n)},className:`ml-2 font-medium underline hover:text-[#0B57D0] dark:hover:text-[#A8C7FA]`,children:qe(`search.search_all_accounts`,`Search across all drive accounts`)}):null})()]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{let n=new URLSearchParams(e);n.delete(`q`),t(n)},className:`flex items-center gap-1 font-medium hover:underline text-[#0B57D0] dark:text-[#A8C7FA] shrink-0`,children:[(0,U.jsx)(Hi,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:qe(`search.clear_search`,`Clear Search`)})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3 pt-3 pb-2 select-none`,children:[we.size>0?(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#001D35] bg-[#C2E7FF] px-3 py-1.5 rounded-full dark:bg-[#004A77] dark:text-[#C2E7FF]`,children:[we.size,` selected`]}),we.size===1&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(G,{size:`sm`,variant:`outline`,onClick:()=>{let e=Array.from(we)[0],t=L.find(t=>t.id===e);t&&Rt(t)},className:`gap-1.5 rounded-full border-[#747775]/40 text-[#0B57D0] hover:bg-[#0B57D0]/10 hover:border-[#0B57D0] dark:border-[#747775]/60 dark:text-[#A8C7FA]`,children:[(0,U.jsx)(Ri,{className:`h-3.5 w-3.5`}),` Share`]}),(0,U.jsxs)(G,{size:`sm`,variant:`outline`,onClick:()=>{let e=Array.from(we)[0],t=L.find(t=>t.id===e);t&&Bt(t)},className:`gap-1.5 rounded-full border-[#747775]/40 text-[#444746] hover:bg-black/5 dark:border-[#747775]/60 dark:text-[#C4C7C5]`,children:[(0,U.jsx)(ii,{className:`h-3.5 w-3.5`}),` Copy link`]})]}),(0,U.jsxs)(G,{size:`sm`,variant:`outline`,onClick:Pt,children:[(0,U.jsx)(Lr,{className:`h-3.5 w-3.5`}),` Download ZIP`]}),(0,U.jsxs)(G,{size:`sm`,variant:`outline`,onClick:()=>b(!0),children:[(0,U.jsx)(Kr,{className:`h-3.5 w-3.5`}),` Move`]}),(0,U.jsxs)(G,{size:`sm`,variant:`danger`,onClick:()=>S(!0),children:[(0,U.jsx)(Fi,{className:`h-3.5 w-3.5`}),` Delete`]}),(0,U.jsx)(G,{size:`sm`,variant:`ghost`,onClick:wt,children:`Clear`})]}):(0,U.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap py-1 relative z-20 overflow-visible`,children:[(0,U.jsx)(ks,{variant:`chip`,className:`w-auto min-w-[110px]`,value:e.get(`kind`)||`all`,onChange:n=>{let r=new URLSearchParams(e);!n||n===`all`?r.delete(`kind`):r.set(`kind`,n),t(r)},options:[{value:`all`,label:Ke===`id`?`Tipe: Semua`:`Type: All`},{value:`doc`,label:Ke===`id`?`Dokumen`:`Documents`},{value:`pdf`,label:`PDFs`},{value:`image`,label:Ke===`id`?`Foto & Gambar`:`Photos & images`},{value:`video`,label:`Videos`},{value:`archive`,label:Ke===`id`?`Arsip (ZIP/RAR)`:`Archives`}]}),(0,U.jsx)(ks,{variant:`chip`,className:`w-auto min-w-[130px]`,value:e.get(`modified`)||`all`,onChange:n=>{let r=new URLSearchParams(e);!n||n===`all`?r.delete(`modified`):r.set(`modified`,n),t(r)},options:[{value:`all`,label:Ke===`id`?`Waktu: Kapan saja`:`Modified: Anytime`},{value:`today`,label:Ke===`id`?`Hari ini`:`Today`},{value:`7d`,label:Ke===`id`?`7 hari terakhir`:`Last 7 days`},{value:`30d`,label:Ke===`id`?`30 hari terakhir`:`Last 30 days`},{value:`year`,label:Ke===`id`?`Tahun ini`:`This year`}]}),(0,U.jsx)(ks,{variant:`chip`,className:`w-auto min-w-[140px]`,value:e.get(`sort`)||`date_desc`,onChange:n=>{let r=new URLSearchParams(e);!n||n===`date_desc`?r.delete(`sort`):r.set(`sort`,n),t(r)},options:[{value:`date_desc`,label:Ke===`id`?`Urutan: Terakhir diubah`:`Sort: Last modified`},{value:`name_asc`,label:Ke===`id`?`Nama (A - Z)`:`Name (A - Z)`},{value:`name_desc`,label:Ke===`id`?`Nama (Z - A)`:`Name (Z - A)`},{value:`size_desc`,label:Ke===`id`?`Ukuran (Terbesar)`:`Size (Largest)`},{value:`size_asc`,label:Ke===`id`?`Ukuran (Terkecil)`:`Size (Smallest)`}]}),!!(e.get(`kind`)&&e.get(`kind`)!==`all`||e.get(`modified`)&&e.get(`modified`)!==`all`||e.get(`sort`)&&e.get(`sort`)!==`date_desc`)&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{let n=new URLSearchParams(e);n.delete(`kind`),n.delete(`modified`),n.delete(`sort`),t(n)},className:`flex items-center gap-1 rounded-full px-2.5 py-1 text-xs text-[#B3261E] hover:bg-[#F9DEDC]/50 dark:text-[#F2B8B5] transition-colors shrink-0`,title:Ke===`id`?`Reset filter`:`Clear filters`,children:[(0,U.jsx)(Hi,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:Ke===`id`?`Reset`:`Clear`})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 shrink-0`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>Tt(`list`),className:xo(`flex h-9 w-9 items-center justify-center rounded-full transition-colors`,ze===`list`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`),title:`List view`,"aria-label":`List view`,children:(0,U.jsx)(ai,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>Tt(`grid`),className:xo(`flex h-9 w-9 items-center justify-center rounded-full transition-colors`,ze===`grid`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`),title:`Grid view`,"aria-label":`Grid view`,children:(0,U.jsx)(ri,{className:`h-4 w-4`})}),be&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>E(!T),className:`flex h-9 w-9 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10 ml-1`,title:`View details`,"aria-label":`View details`,children:(0,U.jsx)(ei,{className:`h-4 w-4`})})]})]}),Ee?(0,U.jsxs)(`p`,{className:`mt-2 rounded-xl bg-amber-50 border border-amber-200 p-3 text-xs font-medium text-amber-800 dark:bg-amber-950/30 dark:border-amber-900/50 dark:text-amber-300`,children:[(0,U.jsx)(kr,{className:`mr-1.5 inline h-4 w-4`}),`Cut folder: `,(0,U.jsx)(`b`,{children:Ee.name}),`. Press Ctrl+V or right-click to paste here.`]}):null,xt.length>0&&(0,U.jsxs)(`div`,{className:`mt-4`,children:[(0,U.jsx)(`h2`,{className:`text-xs font-medium text-[#444746] dark:text-[#C4C7C5]`,children:qe(`section.folders`,`Folders`)}),(0,U.jsx)(Ds,{items:xt,mobileTwoColumns:!0,onFolderMenu:Et,onFolderOpen:Dt,onDropItem:at})]}),St.length>0?(0,U.jsxs)(`div`,{className:`mt-6 flex-1`,children:[(0,U.jsx)(`h2`,{className:`text-xs font-medium text-[#444746] dark:text-[#C4C7C5]`,children:qe(`section.files`,`Files`)}),ze===`grid`?(0,U.jsx)(ms,{files:St,selectedFileIds:we,onToggleFile:yt,onFileContextMenu:vt,onShare:Rt}):(0,U.jsx)(gs,{files:St,selectedFileIds:we,allSelected:Yt,onToggleFile:yt,onToggleAll:Ct,onFileContextMenu:vt,onShare:Rt})]}):xt.length===0?(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center py-20 px-4 text-center select-none`,children:[(0,U.jsx)(`div`,{className:`flex h-24 w-24 items-center justify-center rounded-full bg-[#EDF2FC] dark:bg-[#28292A] text-[#0B57D0] dark:text-[#A8C7FA] mb-4`,children:(0,U.jsx)(Zr,{className:`h-12 w-12 stroke-[1.2]`})}),(0,U.jsx)(`h3`,{className:`text-lg font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:qe(`empty.all_files_title`,`A place for all of your files`)}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-[#747775] dark:text-[#8E918F] max-w-sm`,children:r?Ke===`id`?`Tidak ada file yang ditemukan untuk "${r}".`:`No files found for "${r}".`:qt?qe(`empty.folder_empty`,`This folder is empty. Drag files here or use the "+ New" button to upload.`):qe(`empty.all_files_desc`,`Drag your files here or use the "+ New" button on the left to upload.`)})]}):null]}),(0,U.jsx)(ls,{x:Me.x,y:Me.y,open:Me.open,canPasteFolder:!!Ee,onClose:()=>Ne({x:0,y:0,open:!1}),onUpload:()=>{o.current?.click(),Ne({x:0,y:0,open:!1})},onCreateFolder:()=>{d(!0),Ne({x:0,y:0,open:!1})},onPasteFolder:()=>{Gt().catch(e=>Pe.error(e instanceof Error?e.message:`Failed to paste folder`)),Ne({x:0,y:0,open:!1})}}),(0,U.jsx)(ds,{x:Oe.x,y:Oe.y,file:Oe.file,onClose:()=>ke({x:0,y:0,file:null}),onView:Mt,onDownload:Nt,onRename:()=>{he(be?.name??``),p(!0),ke({x:0,y:0,file:null})},onMove:()=>{b(!0),ke({x:0,y:0,file:null})},onDetails:()=>{E(!0),ke({x:0,y:0,file:null})},onShare:()=>Rt(Oe.file??be),onCopyLink:()=>Bt(Oe.file??be),onDelete:()=>{S(!0),ke({x:0,y:0,file:null})}}),(0,U.jsx)(vs,{x:Ae.x,y:Ae.y,folder:Ae.folder,onClose:()=>je({x:0,y:0,folder:null}),onCut:()=>Wt(Se??Ae.folder),onRename:()=>{_e(Se?.name??``),ye(ws(Se?.color)),H(Se?.iconUrl??`https://api.iconify.design/lucide:folder.svg`),h(!0),je({x:0,y:0,folder:null})},onShare:()=>zt(Ae.folder??Se),onCopyLink:()=>Vt(Ae.folder??Se),onDelete:()=>{_(!0),je({x:0,y:0,folder:null})}}),(0,U.jsx)(ps,{open:T,file:be,onClose:()=>E(!1),onShare:Rt}),(0,U.jsx)(os,{open:i,title:qe(`modal.upload_title`,`Upload File`),description:qe(`modal.upload_desc`,`Stream file directly to selected Google Drive account.`),onClose:()=>a(!1),children:(0,U.jsxs)(`form`,{onSubmit:pt,className:`grid gap-4`,children:[(0,U.jsxs)(`label`,{onDragEnter:_t,onDragOver:_t,onDragLeave:_t,onDrop:_t,className:xo(`group grid cursor-pointer gap-2.5 rounded-2xl border-2 border-dashed p-6 text-center transition-all duration-200`,se?`border-[#0B57D0] bg-[#C2E7FF]/20 dark:border-[#A8C7FA] dark:bg-[#A8C7FA]/10`:`border-[#E0E3E7] bg-[#F8FAFD] hover:border-[#0B57D0] hover:bg-[#F0F4F9] dark:border-[#36373A] dark:bg-[#131314]/40 dark:hover:border-[#A8C7FA] dark:hover:bg-[#28292A]`),children:[(0,U.jsx)(Li,{className:xo(`mx-auto h-8 w-8 transition-colors`,se?`text-[#0B57D0] dark:text-[#A8C7FA]`:`text-[#444746] group-hover:text-[#0B57D0] dark:text-[#C4C7C5] dark:group-hover:text-[#A8C7FA]`)}),(0,U.jsx)(`span`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:qe(`modal.drop_or_browse`,`Drop files here or click to browse`)}),(0,U.jsxs)(`span`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:[Ke===`id`?`File dialirkan langsung ke folder `:`Files stream directly to Google Drive folder `,(0,U.jsx)(`code`,{className:`rounded bg-black/5 px-1 py-0.5 font-mono text-[11px] text-[#1F1F1F] dark:bg-white/10 dark:text-[#E3E3E3]`,children:`9drive`}),`.`]}),(0,U.jsx)(Os,{type:`file`,className:`sr-only`,multiple:!0,onChange:e=>ht(e.target.files),required:z.length===0})]}),(0,U.jsxs)(`div`,{className:`grid gap-1.5 text-xs font-medium text-[#444746] dark:text-[#C4C7C5]`,children:[(0,U.jsx)(`span`,{children:qe(`modal.target_account`,`Target Storage Account`)}),(0,U.jsx)(ks,{variant:`default`,value:Xe,onChange:e=>Ze(e),options:[{value:``,label:qe(`modal.auto_account`,`Automatic (Default)`)},...Je.map(e=>({value:e.id,label:`${e.email||e.displayName||e.id} (${e.provider===`s3`?`S3`:`Google Drive`})`}))]})]}),qt?(0,U.jsxs)(`p`,{className:`rounded-lg bg-[#F8FAFD] p-2.5 text-xs text-[#444746] border border-[#E0E3E7] dark:bg-[#28292A] dark:border-[#36373A] dark:text-[#C4C7C5]`,children:[qe(`modal.uploading_to`,`Uploading to:`),` `,(0,U.jsx)(`b`,{children:qt.name})]}):(0,U.jsxs)(`div`,{className:`grid gap-1.5 text-xs font-medium text-[#444746] dark:text-[#C4C7C5]`,children:[(0,U.jsx)(`span`,{children:qe(`modal.virtual_folder`,`Virtual Folder`)}),(0,U.jsx)(ks,{variant:`default`,value:ae,onChange:e=>oe(e),options:[{value:``,label:qe(`modal.no_folder`,`No folder`)},...ne.map(e=>({value:e.id??``,label:e.name}))]})]}),z.length>0?(0,U.jsxs)(`div`,{className:`grid max-h-48 gap-1.5 overflow-y-auto rounded-xl bg-[#F8FAFD] p-3 text-xs text-[#444746] dark:bg-[#131314]/40 dark:border dark:border-[#36373A] dark:text-[#C4C7C5]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between pb-1 font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[(0,U.jsxs)(`span`,{children:[z.length,` `,Ke===`id`?`file dipilih`:`file(s) selected`]}),(0,U.jsx)(`span`,{children:wo(z.reduce((e,t)=>e+t.size,0))})]}),z.map((e,t)=>(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center justify-between gap-2 rounded-lg bg-white p-2 border border-[#E0E3E7] dark:bg-[#1E1F20] dark:border-[#36373A]`,children:[(0,U.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,title:e.name,children:e.name}),(0,U.jsx)(`span`,{className:`shrink-0 text-slate-500 dark:text-[#8E918F]`,children:wo(e.size)}),(0,U.jsx)(`button`,{type:`button`,className:`shrink-0 text-[#747775] hover:text-[#B3261E] dark:text-[#C4C7C5] dark:hover:text-[#F2B8B5]`,onClick:()=>gt(t),"aria-label":`Remove ${e.name}`,children:(0,U.jsx)(Hi,{className:`h-4 w-4`})})]},`${e.name}-${e.size}-${t}`))]}):null,(0,U.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`ghost`,onClick:()=>a(!1),children:qe(`action.cancel`,`Cancel`)}),(0,U.jsx)(G,{disabled:Fe||z.length===0,children:Fe?Ke===`id`?`Mengunggah...`:`Uploading...`:Ke===`id`?`Unggah ${z.length} file`:`Upload${z.length>1?` ${z.length} files`:``}`})]})]})}),(0,U.jsx)(os,{open:u,title:qe(`modal.new_folder_title`,`New Folder`),description:qe(`modal.new_folder_desc`,`Create a virtual folder for organizing files.`),onClose:()=>d(!1),children:(0,U.jsxs)(`form`,{onSubmit:st,className:`grid gap-4`,children:[(0,U.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-[#444746] dark:text-[#C4C7C5]`,children:[qe(`modal.folder_name`,`Folder Name`),(0,U.jsx)(Os,{value:le,onChange:e=>ue(e.target.value),placeholder:qe(`modal.untitled_folder`,`Untitled folder`),required:!0,autoFocus:!0})]}),(0,U.jsx)(Hs,{color:de,iconUrl:B,onColorChange:fe,onIconChange:pe}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`ghost`,onClick:()=>d(!1),children:qe(`action.cancel`,`Cancel`)}),(0,U.jsx)(G,{children:qe(`action.create`,`Create`)})]})]})}),(0,U.jsx)(os,{open:f,title:qe(`modal.rename_title`,`Rename`),description:be?.name??``,onClose:()=>p(!1),children:(0,U.jsxs)(`form`,{onSubmit:Ft,className:`grid gap-4`,children:[(0,U.jsx)(Os,{value:me,onChange:e=>he(e.target.value),required:!0,autoFocus:!0}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`ghost`,onClick:()=>p(!1),children:qe(`action.cancel`,`Cancel`)}),(0,U.jsx)(G,{children:qe(`action.ok`,`OK`)})]})]})}),(0,U.jsx)(os,{open:y,title:qe(`modal.move_title`,`Move`),description:we.size>0?Ke===`id`?`Pindahkan ${we.size} file`:`Move ${we.size} files`:be?.name??``,onClose:()=>b(!1),children:(0,U.jsxs)(`form`,{onSubmit:It,className:`grid gap-4`,children:[(0,U.jsx)(ks,{variant:`default`,value:ae,onChange:e=>oe(e),options:[{value:``,label:`My Drive (Root)`},...ne.map(e=>({value:e.id??``,label:e.name}))]}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`ghost`,onClick:()=>b(!1),children:qe(`action.cancel`,`Cancel`)}),(0,U.jsx)(G,{children:qe(`action.move_here`,`Move here`)})]})]})}),(0,U.jsx)(os,{open:x,title:qe(`modal.delete_file_title`,`Move to trash?`),description:we.size>0?Ke===`id`?`Pindahkan ${we.size} file ke sampah?`:`Delete ${we.size} files from Google Drive?`:Ke===`id`?`Pindahkan "${be?.name??`file`}" ke sampah?`:`Delete "${be?.name??`file`}"?`,onClose:()=>S(!1),children:(0,U.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,U.jsx)(G,{variant:`ghost`,onClick:()=>S(!1),children:qe(`action.cancel`,`Cancel`)}),(0,U.jsx)(G,{variant:`danger`,onClick:Lt,children:qe(`menu.move_to_trash`,`Move to trash`)})]})}),(0,U.jsx)(ss,{open:D,file:k,onClose:()=>O(!1)}),(0,U.jsx)(os,{open:m,title:qe(`modal.rename_title`,`Rename`),description:Se?.name??``,onClose:()=>h(!1),children:(0,U.jsxs)(`form`,{onSubmit:Ht,className:`grid gap-4`,children:[(0,U.jsx)(Os,{value:ge,onChange:e=>_e(e.target.value),required:!0,autoFocus:!0}),(0,U.jsx)(Hs,{color:ve,iconUrl:V,onColorChange:ye,onIconChange:H}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`ghost`,onClick:()=>h(!1),children:qe(`action.cancel`,`Cancel`)}),(0,U.jsx)(G,{children:qe(`action.ok`,`OK`)})]})]})}),(0,U.jsx)(os,{open:g,title:qe(`modal.delete_folder_title`,`Delete folder?`),description:Ke===`id`?`Hapus folder virtual "${Se?.name??``}"? File di dalamnya akan tetap tersimpan.`:`Delete virtual folder "${Se?.name??``}"? Files inside will remain uploaded.`,onClose:()=>_(!1),children:(0,U.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,U.jsx)(G,{variant:`ghost`,onClick:()=>_(!1),children:qe(`action.cancel`,`Cancel`)}),(0,U.jsx)(G,{variant:`danger`,onClick:Ut,children:qe(`action.delete`,`Delete`)})]})}),(0,U.jsx)(os,{open:C,title:`File Preview`,description:be?.name??``,onClose:Kt,className:`overflow-hidden sm:max-w-[95vw] xl:max-w-[1400px]`,children:(0,U.jsxs)(`div`,{className:`flex h-[72dvh] w-full items-center justify-center overflow-hidden rounded-xl border border-[#E0E3E7] bg-[#F8FAFD] dark:border-[#36373A] dark:bg-[#131314] sm:h-[80vh]`,children:[F?(0,U.jsx)(`div`,{className:`p-6 text-center text-sm font-semibold text-[#747775] dark:text-[#8E918F]`,children:`Loading preview...`}):null,N?(0,U.jsx)(`div`,{className:`p-6 text-center text-sm text-red-600 dark:text-red-400`,children:N}):null,!F&&!N&&Xt===`image`&&j?(0,U.jsx)(`img`,{src:j,alt:be?.name??`File preview`,className:`max-h-full max-w-full object-contain`,onError:()=>P(`Failed to load preview.`)}):null,!F&&!N&&Xt===`video`&&j?(0,U.jsx)(`div`,{className:`shared-video-shell`,children:(0,U.jsx)(`video`,{ref:We,controls:!0,playsInline:!0,preload:`metadata`,onError:()=>P(`Failed to load preview.`),children:(0,U.jsx)(`source`,{src:j,type:be?.mimeType})})}):null,!F&&!N&&Xt===`document`&&j?(0,U.jsx)(`iframe`,{src:j,title:be?.name??`File preview`,className:`h-full w-full border-0 bg-white dark:bg-[#1E1F20]`}):null,!F&&!N&&Xt===`office`&&j?(0,U.jsx)(`iframe`,{src:Fs(j),title:be?.name??`File preview`,className:`h-full w-full border-0 bg-white dark:bg-[#1E1F20]`}):null,!F&&!N&&!Xt?(0,U.jsx)(`div`,{className:`p-6 text-center text-sm text-[#747775] dark:text-[#8E918F]`,children:`Preview not available for this file type. Use Download instead.`}):null]})}),(0,U.jsx)(os,{open:et,title:Ke===`id`?`Panduan Menghubungkan Google Drive & Google Cloud`:`Google Drive & Google Cloud Connection Guide`,description:Ke===`id`?`Langkah menghubungkan Google Drive API ke 9Drive`:`Step-by-step setup to connect Google Drive API to 9Drive`,onClose:()=>tt(!1),className:`sm:max-w-[560px]`,children:(0,U.jsxs)(`div`,{className:`space-y-3.5 text-xs text-[#444746] dark:text-[#C4C7C5] leading-relaxed`,children:[(0,U.jsxs)(`div`,{className:`rounded-xl bg-[#F8FAFD] dark:bg-[#18191A] p-3.5 border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsxs)(`h4`,{className:`font-semibold text-sm text-[#1F1F1F] dark:text-[#E3E3E3] mb-2 flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{children:`🚀`}),` `,Ke===`id`?`4 Langkah Setup di Google Cloud Console:`:`4 Steps Setup in Google Cloud Console:`]}),(0,U.jsxs)(`ol`,{className:`list-decimal pl-4 space-y-2`,children:[(0,U.jsx)(`li`,{children:Ke===`id`?(0,U.jsxs)(U.Fragment,{children:[`Buka `,(0,U.jsxs)(`a`,{href:`https://console.cloud.google.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-[#0B57D0] hover:underline font-medium inline-flex items-center gap-0.5`,children:[`Google Cloud Console `,(0,U.jsx)(zr,{className:`h-3 w-3 inline`})]}),` dan buat atau pilih Project Anda.`]}):(0,U.jsxs)(U.Fragment,{children:[`Open `,(0,U.jsxs)(`a`,{href:`https://console.cloud.google.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-[#0B57D0] hover:underline font-medium inline-flex items-center gap-0.5`,children:[`Google Cloud Console `,(0,U.jsx)(zr,{className:`h-3 w-3 inline`})]}),` and select or create your Project.`]})}),(0,U.jsx)(`li`,{children:Ke===`id`?(0,U.jsxs)(U.Fragment,{children:[`Di menu `,(0,U.jsx)(`strong`,{children:`APIs & Services > Library`}),`, cari dan aktifkan `,(0,U.jsx)(`strong`,{children:`Google Drive API`}),`.`]}):(0,U.jsxs)(U.Fragment,{children:[`In `,(0,U.jsx)(`strong`,{children:`APIs & Services > Library`}),`, search and enable `,(0,U.jsx)(`strong`,{children:`Google Drive API`}),`.`]})}),(0,U.jsx)(`li`,{children:Ke===`id`?(0,U.jsxs)(U.Fragment,{children:[`Buka `,(0,U.jsx)(`strong`,{children:`APIs & Services > Credentials`}),` > klik `,(0,U.jsx)(`strong`,{children:`Create Credentials > OAuth client ID`}),` (Pilih Application type: `,(0,U.jsx)(`em`,{children:`Web application`}),`).`]}):(0,U.jsxs)(U.Fragment,{children:[`Go to `,(0,U.jsx)(`strong`,{children:`APIs & Services > Credentials`}),` > click `,(0,U.jsx)(`strong`,{children:`Create Credentials > OAuth client ID`}),` (Select Application type: `,(0,U.jsx)(`em`,{children:`Web application`}),`).`]})}),(0,U.jsxs)(`li`,{children:[Ke===`id`?(0,U.jsxs)(U.Fragment,{children:[`Masukkan URL ini persis di bagian `,(0,U.jsx)(`strong`,{children:`Authorized redirect URIs`}),`:`]}):(0,U.jsxs)(U.Fragment,{children:[`Add this exact URL under `,(0,U.jsx)(`strong`,{children:`Authorized redirect URIs`}),`:`]}),(0,U.jsx)(`div`,{className:`mt-1 font-mono text-[11px] bg-white dark:bg-[#1E1F20] p-1.5 rounded-lg border border-[#E0E3E7] dark:border-[#36373A] text-[#0B57D0] select-all break-all`,children:typeof window<`u`?`${window.location.origin}/connected-accounts/google/callback`:`http://localhost:9999/connected-accounts/google/callback`})]})]})]}),(0,U.jsxs)(`div`,{className:`rounded-xl border border-[#D3E3FD] bg-[#EDF2FC] p-3.5 text-[#1F1F1F] dark:border-[#2C384A] dark:bg-[#1E232B] dark:text-[#E3E3E3]`,children:[(0,U.jsxs)(`h4`,{className:`font-semibold text-xs flex items-center gap-1.5 mb-1 text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[(0,U.jsx)(ei,{className:`h-4 w-4 text-[#0B57D0] dark:text-[#A8C7FA] shrink-0`}),(0,U.jsx)(`span`,{children:Ke===`id`?`PENTING: Wajib Menambahkan Email Anda ke "Test Users"`:`IMPORTANT: Add Your Email to "Test Users"`})]}),(0,U.jsx)(`p`,{className:`text-[11px] leading-relaxed text-[#444746] dark:text-[#C4C7C5]`,children:Ke===`id`?(0,U.jsxs)(U.Fragment,{children:[`Jika status aplikasi Anda di Google Console masih `,(0,U.jsx)(`strong`,{children:`"Testing"`}),` (belum diajukan verifikasi publik), Google `,(0,U.jsx)(`strong`,{children:`hanya mengizinkan akun email yang terdaftar sebagai Test User`}),`.`]}):(0,U.jsxs)(U.Fragment,{children:[`If your app in Google Console is in `,(0,U.jsx)(`strong`,{children:`"Testing"`}),` status (unverified), Google `,(0,U.jsx)(`strong`,{children:`only allows Google accounts that are explicitly registered under Test Users`}),`.`]})}),(0,U.jsx)(`div`,{className:`mt-2 pl-3 border-l-2 border-[#0B57D0] dark:border-[#A8C7FA] text-[11px] space-y-1 text-[#444746] dark:text-[#C4C7C5]`,children:Ke===`id`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{children:[`👉 Buka menu `,(0,U.jsx)(`strong`,{children:`APIs & Services > OAuth consent screen > Test users`}),`.`]}),(0,U.jsxs)(`p`,{children:[`👉 Klik `,(0,U.jsx)(`strong`,{children:`+ Add Users`}),`, lalu masukkan alamat Gmail yang ingin Anda hubungkan ke 9Drive.`]}),(0,U.jsx)(`p`,{className:`text-[10px] text-[#747775] dark:text-[#8E918F] italic`,children:`*Jika akun Anda tidak didaftarkan di Test Users, login akan gagal dengan pesan: "Access blocked: 403 access_denied / Not a test user".`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`p`,{children:[`👉 Go to `,(0,U.jsx)(`strong`,{children:`APIs & Services > OAuth consent screen > Test users`}),`.`]}),(0,U.jsxs)(`p`,{children:[`👉 Click `,(0,U.jsx)(`strong`,{children:`+ Add Users`}),`, and enter the Gmail address you want to connect.`]}),(0,U.jsx)(`p`,{className:`text-[10px] text-[#747775] dark:text-[#8E918F] italic`,children:`*If omitted, Google rejects login with: "Access blocked: 403 access_denied / Not a test user".`})]})})]}),(0,U.jsxs)(`div`,{className:`rounded-xl bg-[#F0F4F9] dark:bg-[#1A1C1E] p-3 text-[11px] text-[#444746] dark:text-[#C4C7C5] border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsx)(`p`,{className:`font-semibold text-[#1F1F1F] dark:text-[#E3E3E3] mb-0.5`,children:Ke===`id`?`💡 Alternatif Tanpa Google Console:`:`💡 Alternative Without Google Console:`}),(0,U.jsx)(`p`,{children:Ke===`id`?`Anda juga bisa langsung menghubungkan S3 Storage (Cloudflare R2, AWS, MinIO) di menu Pengaturan tanpa perlu konfigurasi Google Console sama sekali!`:`You can also connect S3 Compatible Storage (Cloudflare R2, AWS, MinIO, Wasabi) in Settings without requiring Google Cloud Console at all!`})]}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`outline`,onClick:()=>tt(!1),children:Ke===`id`?`Tutup`:`Close`}),(0,U.jsxs)(Dn,{to:`/settings`,onClick:()=>tt(!1),className:`inline-flex items-center gap-1.5 rounded-full bg-[#0B57D0] px-4 py-2 text-xs font-medium text-white hover:bg-[#0B57D0]/90 dark:bg-[#A8C7FA] dark:text-[#003366]`,children:[(0,U.jsx)(Di,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:Ke===`id`?`Buka Menu Settings`:`Open Settings`})]})]})]})})]})}var Ws=[];function Gs(){let[e,t]=(0,v.useState)(`list`);return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 pb-1`,children:[(0,U.jsx)(`h1`,{className:`text-[22px] font-normal tracking-tight text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Archived`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(G,{variant:`outline`,size:`sm`,className:`rounded-full h-8 text-xs font-medium`,children:[(0,U.jsx)(Ci,{className:`h-3.5 w-3.5`}),`Restore all`]}),(0,U.jsxs)(G,{variant:`danger`,size:`sm`,className:`rounded-full h-8 text-xs font-medium`,children:[(0,U.jsx)(Fi,{className:`h-3.5 w-3.5`}),`Delete permanently`]}),(0,U.jsxs)(`div`,{className:`inline-flex items-center rounded-full border border-[#E0E3E7] dark:border-[#444746] bg-white dark:bg-[#1E1F20] p-0.5 shadow-xs ml-1`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>t(`list`),className:`flex h-8 w-8 items-center justify-center rounded-full transition-colors ${e===`list`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:hover:bg-[#282A2C]`}`,title:`List view`,children:(0,U.jsx)(ai,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>t(`grid`),className:`flex h-8 w-8 items-center justify-center rounded-full transition-colors ${e===`grid`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:hover:bg-[#282A2C]`}`,title:`Grid view`,children:(0,U.jsx)(ri,{className:`h-4 w-4`})})]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 rounded-xl bg-[#F0F4F9] dark:bg-[#282A2C] px-4 py-2.5 text-xs text-[#444746] dark:text-[#C4C7C5]`,children:[(0,U.jsx)(ei,{className:`h-4 w-4 shrink-0 text-[#0B57D0] dark:text-[#A8C7FA]`}),(0,U.jsx)(`span`,{children:`Archived files are kept safely out of your main drive view but remain accessible whenever you need them.`})]}),Ws.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 text-center`,children:[(0,U.jsx)(`div`,{className:`flex h-24 w-24 items-center justify-center rounded-full bg-[#EDF2FC] dark:bg-[#1E1F20] text-[#0B57D0] dark:text-[#A8C7FA]`,children:(0,U.jsx)(mr,{className:`h-10 w-10 stroke-[1.5]`})}),(0,U.jsx)(`h2`,{className:`mt-5 text-lg font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`No archived files`}),(0,U.jsx)(`p`,{className:`mt-1 max-w-sm text-sm text-[#747775] dark:text-[#8E918F]`,children:`Items you archive from your drive will appear here.`})]}):e===`list`?(0,U.jsx)(`div`,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] overflow-hidden`,children:(0,U.jsx)(gs,{files:Ws,mode:`archived`})}):(0,U.jsx)(ms,{files:Ws})]})}function Ks({className:e=`h-4 w-4`}){return(0,U.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{fill:`#4285F4`,d:`M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z`}),(0,U.jsx)(`path`,{fill:`#34A853`,d:`M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C4 20.52 7.7 23 12 23z`}),(0,U.jsx)(`path`,{fill:`#FBBC05`,d:`M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z`}),(0,U.jsx)(`path`,{fill:`#EA4335`,d:`M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 4 3.48 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z`})]})}function qs(){let e=tt(),[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1);async function d(){u(!0),o(``);try{let e=await W(`/auth/google/url`,{skipAuth:!0});window.location.href=e.url}catch(e){o(e instanceof Error?e.message:`Google login failed`),u(!1)}}async function f(n){n.preventDefault(),c(!0),o(``);try{let n=await W(`/auth/login`,{method:`POST`,skipAuth:!0,body:JSON.stringify({email:t,password:r})});Qn(n.accessToken,n.refreshToken,n.user),e(`/all-files`)}catch(e){o(e instanceof Error?e.message:`Login failed`)}finally{c(!1)}}return(0,U.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-[#F8FAFD] p-4 dark:bg-[#131314]`,children:(0,U.jsxs)(`div`,{className:`w-full max-w-[420px] rounded-[28px] border border-[#E0E3E7] bg-white p-8 shadow-sm dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,U.jsx)(So,{className:`h-12 w-12`}),(0,U.jsx)(`h1`,{className:`mt-4 text-2xl font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Sign in`}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-[#747775] dark:text-[#8E918F]`,children:`to continue to 9Drive`})]}),(0,U.jsxs)(`form`,{onSubmit:f,className:`mt-8 grid gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-xs font-medium text-[#444746] dark:text-[#C4C7C5] block mb-1`,children:`Email`}),(0,U.jsx)(Os,{type:`email`,value:t,onChange:e=>n(e.target.value),placeholder:`name@example.com`,required:!0,autoFocus:!0})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-xs font-medium text-[#444746] dark:text-[#C4C7C5] block mb-1`,children:`Password`}),(0,U.jsx)(Os,{type:`password`,value:r,onChange:e=>i(e.target.value),placeholder:`Enter your password`,required:!0})]}),a?(0,U.jsx)(`p`,{className:`rounded-lg bg-[#F9DEDC]/50 border border-[#F9DEDC] p-2.5 text-xs text-[#B3261E]`,children:a}):null,(0,U.jsxs)(`div`,{className:`mt-2 flex items-center justify-between`,children:[(0,U.jsx)(Dn,{to:`/register`,className:`text-xs font-medium text-[#0B57D0] hover:underline dark:text-[#A8C7FA]`,children:`Create account`}),(0,U.jsx)(G,{disabled:s,children:s?`Signing in...`:`Sign in`})]})]}),(0,U.jsx)(`div`,{className:`mt-6 pt-6 border-t border-[#E0E3E7] dark:border-[#36373A]`,children:(0,U.jsxs)(G,{variant:`outline`,className:`w-full`,disabled:l,onClick:d,children:[(0,U.jsx)(Ks,{}),(0,U.jsx)(`span`,{children:l?`Redirecting...`:`Sign in with Google`})]})})]})})}function Js({className:e,...t}){return(0,U.jsx)(`div`,{className:xo(`rounded-2xl border border-[#E0E3E7] bg-white p-4 shadow-none dark:border-[#36373A] dark:bg-[#1E1F20]`,e),...t})}function Ys(){let[e]=Fn(),t=tt(),[n,r]=(0,v.useState)(`Completing Google sign-in...`),i=e.get(`token`),a=e.get(`status`);return(0,v.useEffect)(()=>{if(a===`error`||!i){r(`Google sign-in failed. Please try again.`);return}W(`/auth/google/exchange`,{method:`POST`,skipAuth:!0,body:JSON.stringify({token:i})}).then(e=>{Qn(e.accessToken,e.refreshToken,e.user),t(`/all-files`,{replace:!0})}).catch(e=>r(e instanceof Error?e.message:`Google sign-in failed. Please try again.`))},[t,a,i]),(0,U.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-slate-50 p-5`,children:(0,U.jsxs)(Js,{className:`w-full max-w-sm p-6 text-center`,children:[(0,U.jsx)(`div`,{className:`mx-auto flex h-12 w-12 items-center justify-center rounded-xl bg-blue-600 text-white`,children:(0,U.jsx)(Zr,{className:`h-6 w-6`})}),(0,U.jsx)(`h1`,{className:`mt-4 text-xl font-extrabold`,children:`Google Sign-in`}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-slate-500`,children:n})]})})}function Xs(){let[e]=Fn(),t=tt(),n=e.get(`status`)??`success`,r=n===`success`;return(0,v.useEffect)(()=>{window.opener?.postMessage({type:`GOOGLE_CONNECTED`,status:n},window.location.origin);let e=window.setTimeout(()=>{window.opener?window.close():t(`/settings`)},800);return()=>window.clearTimeout(e)},[t,n]),(0,U.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-slate-50 p-5`,children:(0,U.jsxs)(Js,{className:`w-full max-w-sm p-6 text-center`,children:[r?(0,U.jsx)(Tr,{className:`mx-auto h-10 w-10 text-emerald-500`}):(0,U.jsx)(Or,{className:`mx-auto h-10 w-10 text-red-500`}),(0,U.jsx)(`h1`,{className:`mt-4 text-xl font-extrabold`,children:r?`Google Drive Connected`:`Connection Failed`}),(0,U.jsx)(`p`,{className:`mt-2 text-sm text-slate-500`,children:r?`This window will close automatically.`:`Close this window and try again.`})]})})}function Zs({title:e,description:t,actions:n}){return(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 pb-4 sm:flex-row sm:items-center sm:justify-between border-b border-[#E0E3E7]/60 dark:border-[#36373A]/60`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h1`,{className:`text-xl sm:text-[22px] font-normal text-[#1F1F1F] dark:text-[#E3E3E3] tracking-tight`,children:e}),t?(0,U.jsx)(`p`,{className:`mt-0.5 text-xs text-[#747775] dark:text-[#8E918F]`,children:t}):null]}),n?(0,U.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 sm:shrink-0 sm:justify-end`,children:n}):null]})}function Qs(e){return e===`s3`?`S3 Storage`:`Google Drive`}function $s({provider:e}){return(0,U.jsx)(e===`s3`?Ir:Zr,{className:`h-5 w-5`})}function ec(e){return e.provider===`s3`&&e.storageAccount?.totalBytes===null?`Unlimited`:wo(e.storageAccount?.totalBytes)}function tc(e){return e.provider===`s3`&&e.storageAccount?.availableBytes===null?`Unlimited`:wo(e.storageAccount?.availableBytes)}function nc(e){let t=Number(e.storageAccount?.totalBytes??0),n=Number(e.storageAccount?.usedBytes??0);return t>0?Math.min(100,Math.round(n/t*100)):0}function rc(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)({mode:`most_available`,priorityAccountIds:[],roundRobinCursor:0}),{toast:o}=as(),{t:s}=Fo(),[c,l]=(0,v.useState)(!1),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null);async function m(){let[e,n,i]=await Promise.all([W(`/storage/summary`),W(`/connected-accounts`),W(`/storage/routing-policy`)]);t(e),r(n.accounts),a(i.policy)}async function h(){d(!0);try{await m()}finally{d(!1)}}(0,v.useEffect)(()=>{m().catch(e=>o.error(e instanceof Error?e.message:`Failed to load quota tracker`))},[]),(0,v.useEffect)(()=>{if(!c)return;let e=window.setInterval(()=>m().catch(()=>void 0),35e3);return()=>window.clearInterval(e)},[c]),(0,v.useEffect)(()=>{function e(e){e.origin!==window.location.origin||e.data?.type!==`GOOGLE_CONNECTED`||(e.data.status===`success`?o.success(`Google Drive connected successfully.`):o.error(`Google Drive connection failed.`),m().catch(()=>void 0))}return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[]);async function g(){let e=window.open(``,`google-drive-connect`,`width=540,height=720`);e&&e.document.write(`<html><head><title>Connecting...</title><style>body{font-family:sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f8fafc;color:#64748b;}</style></head><body><div style="text-align:center;"><h2>Connecting to Google...</h2><p>Please wait while we redirect you.</p></div></body></html>`);try{let t=await W(`/connected-accounts/google/connect-url`);e?e.location.href=t.url:window.location.href=t.url}catch(t){e&&e.close(),console.error(`Failed to start Google Drive connection from Quota Tracker`,t)}}async function _(e){p(e);try{await W(`/connected-accounts/${e}/sync-quota`,{method:`POST`}),await m()}finally{p(null)}}async function y(e){a(e),a((await W(`/storage/routing-policy`,{method:`PATCH`,body:JSON.stringify({mode:e.mode,priorityAccountIds:e.priorityAccountIds})})).policy),o.success(`Upload routing policy updated.`)}function b(){let e=new Map(n.map(e=>[e.id,e])),t=i.priorityAccountIds.map(t=>e.get(t)).filter(e=>!!e),r=new Set(t.map(e=>e.id));return[...t,...n.filter(e=>!r.has(e.id))]}function x(e,t){let n=b().map(e=>e.id),r=n.indexOf(e),a=r+t;if(r<0||a<0||a>=n.length)return;let s=[...n],[c]=s.splice(r,1);s.splice(a,0,c),y({...i,priorityAccountIds:s}).catch(e=>o.error(e instanceof Error?e.message:`Failed to update routing policy`))}let S=Number(e?.usedBytes??0),C=Number(e?.totalBytes??0),w=C>0?Math.min(100,Math.round(S/C*100)):0;return(0,U.jsxs)(`div`,{className:`flex flex-col min-h-full w-full min-w-0`,children:[(0,U.jsx)(Zs,{title:s(`quota.title`,`Storage`),description:s(`quota.desc`,`Monitor combined Google Drive storage quota and routing.`),actions:(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(G,{size:`sm`,variant:`outline`,onClick:()=>l(!c),children:[(0,U.jsx)(Tr,{className:`h-4 w-4`}),` `,s(`quota.auto_refresh`,`Auto-refresh`),` `,c?`On`:`Off`]}),(0,U.jsxs)(G,{size:`sm`,variant:`outline`,onClick:h,disabled:u,children:[(0,U.jsx)(Si,{className:u?`h-4 w-4 animate-spin`:`h-4 w-4`}),u?s(`action.refreshing`,`Refreshing...`):s(`action.refresh`,`Refresh`)]}),(0,U.jsxs)(G,{size:`sm`,onClick:g,children:[(0,U.jsx)(ii,{className:`h-4 w-4`}),` `,s(`settings.connect_drive`,`Connect Drive`)]})]})}),(0,U.jsxs)(`div`,{className:`mt-6 rounded-2xl border border-[#E0E3E7] bg-white p-6 dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-xs font-medium uppercase tracking-wider text-[#747775] dark:text-[#8E918F]`,children:s(`quota.total_usage`,`Total Storage Usage`)}),(0,U.jsxs)(`div`,{className:`mt-1 flex items-baseline gap-2`,children:[(0,U.jsx)(`span`,{className:`text-3xl font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:wo(e?.usedBytes)}),(0,U.jsxs)(`span`,{className:`text-sm text-[#747775] dark:text-[#8E918F]`,children:[s(`quota.of_used`,`of`),` `,wo(e?.totalBytes),` `,s(`quota.used_label`,`used`),` (`,w,`%)`]})]})]}),(0,U.jsx)(`div`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:(0,U.jsxs)(`span`,{children:[n.length,` `,s(`quota.connected_accounts`,`connected account(s)`)]})})]}),(0,U.jsx)(`div`,{className:`mt-4 h-3 w-full rounded-full bg-[#E0E3E7] dark:bg-[#36373A] overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full rounded-full bg-[#0B57D0] transition-all duration-300`,style:{width:`${w}%`}})})]}),(0,U.jsxs)(`div`,{className:`mt-6 rounded-2xl border border-[#E0E3E7] bg-white p-5 dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between pb-3 border-b border-[#E0E3E7]/60 dark:border-[#36373A]/60`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:s(`quota.routing_policy`,`Upload Routing Policy`)}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:s(`quota.routing_desc`,`Define which connected Google Drive account receives uploads.`)})]}),(0,U.jsx)(`div`,{className:`w-full sm:w-60`,children:(0,U.jsx)(ks,{variant:`sm`,value:i.mode,onChange:e=>y({...i,mode:e}).catch(e=>o.error(e instanceof Error?e.message:`Failed to update policy`)),options:[{value:`most_available`,label:s(`quota.mode_most_available`,`Most available free space`)},{value:`round_robin`,label:s(`quota.mode_round_robin`,`Round robin`)},{value:`priority`,label:s(`quota.mode_priority`,`Priority order`)}]})})]}),(0,U.jsxs)(`div`,{className:`mt-3 space-y-2`,children:[b().map((e,t)=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-[#F8FAFD] p-3 border border-[#E0E3E7]/60 dark:bg-[#28292A] dark:border-[#36373A]/60 text-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)($s,{provider:e.provider}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:e.email}),(0,U.jsxs)(`p`,{className:`text-[#747775] dark:text-[#8E918F]`,children:[wo(e.storageAccount?.usedBytes),` used • `,tc(e),` free`]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,U.jsx)(G,{variant:`ghost`,size:`sm`,onClick:()=>x(e.id,-1),disabled:t===0,children:s(`action.up`,`Up`)}),(0,U.jsx)(G,{variant:`ghost`,size:`sm`,onClick:()=>x(e.id,1),disabled:t===n.length-1,children:s(`action.down`,`Down`)})]})]},e.id)),n.length===0&&(0,U.jsx)(`p`,{className:`text-xs text-[#747775] py-2`,children:s(`quota.no_accounts`,`No connected accounts yet.`)})]})]}),(0,U.jsxs)(`div`,{className:`mt-6`,children:[(0,U.jsx)(`h2`,{className:`text-xs font-medium uppercase tracking-wider text-[#747775] dark:text-[#8E918F] mb-3`,children:`Connected Accounts Detail`}),(0,U.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:n.map(e=>{let t=nc(e);return(0,U.jsxs)(`div`,{className:`rounded-2xl border border-[#E0E3E7] bg-white p-5 dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0`,children:[(0,U.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-[#EDF2FC] text-[#0B57D0] dark:bg-[#28292A] dark:text-[#A8C7FA]`,children:(0,U.jsx)($s,{provider:e.provider})}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`p`,{className:`truncate text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:e.email}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:Qs(e.provider)})]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>_(e.id),disabled:f===e.id,title:`Sync Quota`,className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5]`,children:(0,U.jsx)(Si,{className:xo(`h-4 w-4`,f===e.id&&`animate-spin`)})})]}),(0,U.jsxs)(`div`,{className:`mt-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-[#444746] dark:text-[#C4C7C5] mb-1.5`,children:[(0,U.jsxs)(`span`,{children:[wo(e.storageAccount?.usedBytes),` used`]}),(0,U.jsxs)(`span`,{children:[t,`%`]})]}),(0,U.jsx)(`div`,{className:`h-2 w-full rounded-full bg-[#E0E3E7] dark:bg-[#36373A] overflow-hidden`,children:(0,U.jsx)(`div`,{className:xo(`h-full rounded-full transition-all duration-300`,t>=90?`bg-[#D93025]`:t>=75?`bg-[#FBBC04]`:`bg-[#0B57D0]`),style:{width:`${t}%`}})}),(0,U.jsxs)(`div`,{className:`mt-2 flex items-center justify-between text-xs text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsxs)(`span`,{children:[`Total: `,ec(e)]}),(0,U.jsxs)(`span`,{children:[`Free: `,tc(e)]})]})]})]},e.id)})})]})]})}function ic(e){return e.startsWith(`image/`)?`image`:e.startsWith(`video/`)?`video`:e.includes(`pdf`)?`pdf`:`doc`}function ac(e){let t=e.driveUrl??(e.providerFileId?`https://drive.google.com/file/d/${e.providerFileId}/view?usp=sharing`:void 0);return{id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes,createdAt:e.createdAt,accountEmail:e.connectedAccount?.email,accountProvider:e.connectedAccount?.provider===`s3`?`S3 Storage`:`Google Drive`,date:To(e.createdAt),size:wo(e.sizeBytes),access:e.connectedAccount?.email??`Google Drive`,kind:ic(e.mimeType),shared:1,folderId:e.folderId,folderName:e.folder?.name,openedDate:e.viewedAt?To(e.viewedAt):To(e.createdAt),providerFileId:e.providerFileId,driveUrl:t}}function oc(){let{selectedAccountId:e}=Ao(),{language:t,t:n}=Fo(),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(`list`),[l,u]=(0,v.useState)(`all`),[d,f]=(0,v.useState)(!0),[p,m]=(0,v.useState)(new Set),[h,g]=(0,v.useState)(null),[_,y]=(0,v.useState)({x:0,y:0,file:null}),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(!1),[E,D]=(0,v.useState)(``),[O,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(!1),[M,N]=(0,v.useState)(``),[P,F]=(0,v.useState)(!1),[I,L]=(0,v.useState)(``),[R,ee]=(0,v.useState)(``),[te,ne]=(0,v.useState)(!1),{toast:re}=as();async function z(){f(!0);try{let t=await W(e&&e!==`all`?`/files/recent?accountId=${e}`:`/files/recent`);t.files&&t.files.length>0?i(t.files.map(ac)):i([])}catch{i([])}finally{f(!1)}}async function ie(){try{o((await W(`/folders`)).folders??[])}catch{o([])}}(0,v.useEffect)(()=>{z(),ie();let e=()=>{z()};return window.addEventListener(`9drive:storage-changed`,e),()=>{window.removeEventListener(`9drive:storage-changed`,e)}},[e]);function ae(e){e.toLowerCase().includes(`success`)||e.toLowerCase().includes(`copied`)||e.toLowerCase().includes(`renamed`)||e.toLowerCase().includes(`moved`)?re.success(e):e.toLowerCase().includes(`failed`)||e.toLowerCase().includes(`error`)?re.error(e):re.info(e)}let oe=r.filter(e=>!(l===`docs`&&e.kind!==`doc`||l===`images`&&e.kind!==`image`||l===`videos`&&e.kind!==`video`||l===`pdfs`&&e.kind!==`pdf`)),se=oe.map(e=>e.id).filter(Boolean),ce=se.length>0&&se.every(e=>p.has(e));function le(e){e.id&&m(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})}function ue(){m(ce?new Set:new Set(se))}function de(){m(new Set)}function fe(e,t){e.preventDefault(),e.stopPropagation(),g(t),y({x:e.clientX,y:e.clientY,file:t})}async function B(e){let t=e??h;if(t?.id){g(t),L(``),ee(``),ne(!0),F(!0),y({x:0,y:0,file:null});try{let e=await W(`/files/${t.id}/preview-token`,{method:`POST`});L(`${e.path??new URL(e.url).pathname}`)}catch(e){ee(e instanceof Error?e.message:`Failed to load preview`)}finally{ne(!1)}}}async function pe(e){let t=e??h;if(t?.id)try{let e=await fetch(`/files/${t.id}/download`,{headers:{Authorization:`Bearer ${Yn()}`}});if(!e.ok)throw Error(`Download failed`);let n=await e.blob(),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t.name,i.click(),URL.revokeObjectURL(r)}catch(e){ae(e instanceof Error?e.message:`Download failed`)}finally{y({x:0,y:0,file:null})}}async function me(e){if(e.preventDefault(),h?.id)try{await W(`/files/${h.id}`,{method:`PATCH`,body:JSON.stringify({name:E})}),T(!1),ae(`File renamed to "${E}"`),await z()}catch(e){ae(e instanceof Error?e.message:`Rename failed`)}}async function he(e){e.preventDefault();let t=[...p];try{t.length>0?await W(`/files/batch`,{method:`PATCH`,body:JSON.stringify({fileIds:t,folderId:M||null})}):h?.id&&await W(`/files/${h.id}`,{method:`PATCH`,body:JSON.stringify({folderId:M||null})}),j(!1),N(``),de(),ae(`File(s) moved successfully`),await z()}catch(e){ae(e instanceof Error?e.message:`Move failed`)}}async function ge(){let e=[...p];try{e.length>0?await W(`/files/batch`,{method:`DELETE`,body:JSON.stringify({fileIds:e})}):h?.id&&await W(`/files/${h.id}`,{method:`DELETE`}),k(!1),de(),ae(`Moved to trash`),await z(),window.dispatchEvent(new Event(`9drive:storage-changed`))}catch(e){ae(e instanceof Error?e.message:`Delete failed`)}}function _e(e){let t=e??h;t?.id&&(g(t),C(!0),y({x:0,y:0,file:null}))}async function ve(e){let t=e??h;if(t){try{let e=t.driveUrl;!e&&t.id&&(e=(await W(`/files/${t.id}/share`,{method:`POST`})).url),e&&(await navigator.clipboard.writeText(e),ae(`Google Drive link copied to clipboard!`))}catch(e){ae(`Failed to copy link: `+(e.message||e))}y({x:0,y:0,file:null})}}function ye(){L(``),ee(``),ne(!1),F(!1)}let V=h?Ps(h.mimeType):null;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 pb-1`,children:[(0,U.jsx)(`h1`,{className:`text-[22px] font-normal tracking-tight text-[#1F1F1F] dark:text-[#E3E3E3]`,children:n(`nav.recent`,`Recent`)}),(0,U.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,U.jsxs)(`div`,{className:`inline-flex items-center rounded-full border border-[#E0E3E7] dark:border-[#444746] bg-white dark:bg-[#1E1F20] p-0.5 shadow-xs`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>c(`list`),className:`flex h-8 w-8 items-center justify-center rounded-full transition-colors ${s===`list`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:hover:bg-[#282A2C]`}`,title:`List view`,children:(0,U.jsx)(ai,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>c(`grid`),className:`flex h-8 w-8 items-center justify-center rounded-full transition-colors ${s===`grid`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:hover:bg-[#282A2C]`}`,title:`Grid view`,children:(0,U.jsx)(ri,{className:`h-4 w-4`})})]})})]}),(0,U.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pb-2`,children:(0,U.jsx)(`div`,{className:`w-36`,children:(0,U.jsx)(ks,{variant:`chip`,value:l,onChange:u,options:[{value:`all`,label:t===`id`?`Tipe: Semua`:`Type: All`},{value:`docs`,label:`Documents`},{value:`images`,label:`Images`},{value:`videos`,label:`Videos`},{value:`pdfs`,label:`PDFs`}]})})}),p.size>0&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-[#C2E7FF]/50 px-4 py-2 text-sm text-[#001D35] dark:bg-[#004A77]/40 dark:text-[#C2E7FF]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsxs)(`span`,{className:`font-medium`,children:[p.size,` `,n(`action.selected`,`selected`)]}),(0,U.jsx)(`button`,{type:`button`,onClick:de,className:`text-xs underline hover:opacity-80`,children:t===`id`?`Batalkan pilihan`:`Clear selection`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[p.size===1&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(G,{variant:`outline`,size:`sm`,onClick:()=>{let e=Array.from(p)[0],t=oe.find(t=>t.id===e);t&&_e(t)},className:`h-8 gap-1.5 rounded-full border-[#747775]/40 text-[#0B57D0] hover:bg-[#0B57D0]/10 hover:border-[#0B57D0] dark:border-[#747775]/60 dark:text-[#A8C7FA]`,children:[(0,U.jsx)(Ri,{className:`h-3.5 w-3.5`}),n(`action.share`,`Share`)]}),(0,U.jsxs)(G,{variant:`outline`,size:`sm`,onClick:()=>{let e=Array.from(p)[0],t=oe.find(t=>t.id===e);t&&ve(t)},className:`h-8 gap-1.5 rounded-full border-[#747775]/40 text-[#444746] hover:bg-black/5 dark:border-[#747775]/60 dark:text-[#C4C7C5]`,children:[(0,U.jsx)(ii,{className:`h-3.5 w-3.5`}),n(`action.copy_link`,`Copy link`)]})]}),(0,U.jsxs)(G,{variant:`ghost`,size:`sm`,onClick:()=>k(!0),className:`h-8 gap-1.5 text-xs text-[#B3261E] hover:bg-[#F9DEDC]/50 dark:text-[#F2B8B5]`,children:[(0,U.jsx)(Fi,{className:`h-3.5 w-3.5`}),n(`menu.move_to_trash`,`Move to trash`)]})]})]}),d?(0,U.jsx)(`div`,{className:`flex h-64 items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-[#0B57D0] border-t-transparent`})}):oe.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 text-center`,children:[(0,U.jsx)(`div`,{className:`flex h-24 w-24 items-center justify-center rounded-full bg-[#EDF2FC] dark:bg-[#1E1F20] text-[#0B57D0] dark:text-[#A8C7FA]`,children:(0,U.jsx)(Ar,{className:`h-10 w-10 stroke-[1.5]`})}),(0,U.jsx)(`h2`,{className:`mt-5 text-lg font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:t===`id`?`Tidak ada file terbaru`:`No recent files`}),(0,U.jsx)(`p`,{className:`mt-1 max-w-sm text-sm text-[#747775] dark:text-[#8E918F]`,children:t===`id`?`File yang Anda lihat, buka, atau edit akan muncul di sini untuk akses cepat.`:`Files you view, open, or edit will appear here for easy access.`})]}):s===`list`?(0,U.jsx)(`div`,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] overflow-hidden`,children:(0,U.jsx)(gs,{files:oe,mode:`recent`,selectedFileIds:p,allSelected:ce,onToggleFile:le,onToggleAll:ue,onFileContextMenu:fe,onFileDoubleClick:B,onShare:e=>_e(e)})}):(0,U.jsx)(ms,{files:oe,selectedFileIds:p,onToggleFile:le,onFileContextMenu:fe,onFileDoubleClick:B,onShare:e=>_e(e)}),(0,U.jsx)(ds,{x:_.x,y:_.y,file:_.file,onClose:()=>y({x:0,y:0,file:null}),onView:()=>B(),onDownload:()=>pe(),onRename:()=>{D(h?.name??``),T(!0),y({x:0,y:0,file:null})},onMove:()=>{j(!0),y({x:0,y:0,file:null})},onDetails:()=>{x(!0),y({x:0,y:0,file:null})},onShare:()=>_e(),onCopyLink:()=>ve(),onDelete:()=>{k(!0),y({x:0,y:0,file:null})}}),(0,U.jsx)(ps,{open:b,file:h,onClose:()=>x(!1),onShare:e=>_e(e)}),(0,U.jsx)(os,{open:w,title:`Rename`,description:h?.name??``,onClose:()=>T(!1),children:(0,U.jsxs)(`form`,{onSubmit:me,className:`grid gap-4`,children:[(0,U.jsx)(Os,{value:E,onChange:e=>D(e.target.value),required:!0,autoFocus:!0}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`ghost`,onClick:()=>T(!1),children:`Cancel`}),(0,U.jsx)(G,{children:`OK`})]})]})}),(0,U.jsx)(os,{open:A,title:`Move`,description:p.size>0?`Move ${p.size} files`:h?.name??``,onClose:()=>j(!1),children:(0,U.jsxs)(`form`,{onSubmit:he,className:`grid gap-4`,children:[(0,U.jsx)(ks,{variant:`default`,value:M,onChange:N,options:[{value:``,label:`My Drive (Root)`},...a.map(e=>({value:e.id??``,label:e.name}))]}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`ghost`,onClick:()=>j(!1),children:`Cancel`}),(0,U.jsx)(G,{children:`Move here`})]})]})}),(0,U.jsx)(os,{open:O,title:`Move to trash?`,description:p.size>0?`Delete ${p.size} files from Google Drive?`:`Delete "${h?.name??`file`}"?`,onClose:()=>k(!1),children:(0,U.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,U.jsx)(G,{variant:`ghost`,onClick:()=>k(!1),children:`Cancel`}),(0,U.jsx)(G,{variant:`danger`,onClick:ge,children:`Move to trash`})]})}),(0,U.jsx)(ss,{open:S,file:h,onClose:()=>C(!1)}),(0,U.jsx)(os,{open:P,title:`File Preview`,description:h?.name??``,onClose:ye,className:`overflow-hidden sm:max-w-[95vw] xl:max-w-[1400px]`,children:(0,U.jsxs)(`div`,{className:`flex h-[72dvh] w-full items-center justify-center overflow-hidden rounded-xl border border-[#E0E3E7] bg-[#F8FAFD] dark:border-[#36373A] dark:bg-[#131314] sm:h-[80vh]`,children:[te?(0,U.jsx)(`div`,{className:`p-6 text-center text-sm font-semibold text-[#747775] dark:text-[#8E918F]`,children:`Loading preview...`}):null,R?(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,children:[(0,U.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:R}),h?.driveUrl?(0,U.jsxs)(G,{variant:`outline`,onClick:()=>window.open(h.driveUrl,`_blank`),children:[(0,U.jsx)(zr,{className:`mr-2 h-4 w-4`}),` Open in Google Drive`]}):null]}):null,!te&&!R&&V===`image`&&I?(0,U.jsx)(`img`,{src:I,alt:h?.name??`File preview`,className:`max-h-full max-w-full object-contain`,onError:()=>ee(`Failed to load preview.`)}):null,!te&&!R&&V===`video`&&I?(0,U.jsx)(`div`,{className:`shared-video-shell`,children:(0,U.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,onError:()=>ee(`Failed to load preview.`),children:(0,U.jsx)(`source`,{src:I,type:h?.mimeType})})}):null,!te&&!R&&V===`document`&&I?(0,U.jsx)(`iframe`,{src:I,title:h?.name??`File preview`,className:`h-full w-full border-0 bg-white dark:bg-[#1E1F20]`}):null,!te&&!R&&V===`office`&&I?(0,U.jsx)(`iframe`,{src:Fs(I),title:h?.name??`File preview`,className:`h-full w-full border-0 bg-white dark:bg-[#1E1F20]`}):null,!te&&!R&&!V?(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center text-sm text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(`p`,{children:`Preview not available directly in app for this file type.`}),h?.driveUrl?(0,U.jsxs)(G,{onClick:()=>window.open(h.driveUrl,`_blank`),children:[(0,U.jsx)(zr,{className:`mr-2 h-4 w-4`}),` Open in Google Drive`]}):(0,U.jsx)(G,{onClick:()=>pe(h??void 0),children:`Download file`})]}):null]})})]})}var sc=``;function cc(){let e=tt(),[t,n]=(0,v.useState)(``),[r,i]=(0,v.useState)(``),[a,o]=(0,v.useState)(``),[s,c]=(0,v.useState)(``),[l,u]=(0,v.useState)(``),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(!1);(0,v.useRef)(null);let h=(0,v.useRef)(null);(0,v.useEffect)(()=>{},[]);async function g(){m(!0),u(``);try{let e=await W(`/auth/google/url`,{skipAuth:!0});window.location.href=e.url}catch(e){u(e instanceof Error?e.message:`Google register failed`),m(!1)}}async function _(n){n.preventDefault(),f(!0),u(``);try{let n=await W(`/auth/register`,{method:`POST`,skipAuth:!0,body:JSON.stringify({name:t,email:r,password:a,captchaToken:s})});Qn(n.accessToken,n.refreshToken,n.user),e(`/all-files`)}catch(e){u(e instanceof Error?e.message:`Register failed`),h.current!==null&&window.grecaptcha?.reset(h.current),c(``)}finally{f(!1)}}return(0,U.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-[#F8FAFD] p-4 dark:bg-[#131314]`,children:(0,U.jsxs)(`div`,{className:`w-full max-w-[420px] rounded-[28px] border border-[#E0E3E7] bg-white p-8 shadow-sm dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col items-center text-center`,children:[(0,U.jsx)(So,{className:`h-12 w-12`}),(0,U.jsx)(`h1`,{className:`mt-4 text-2xl font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Create account`}),(0,U.jsx)(`p`,{className:`mt-1 text-sm text-[#747775] dark:text-[#8E918F]`,children:`to start using 9Drive`})]}),(0,U.jsxs)(`form`,{onSubmit:_,className:`mt-8 grid gap-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-xs font-medium text-[#444746] dark:text-[#C4C7C5] block mb-1`,children:`Your name`}),(0,U.jsx)(Os,{value:t,onChange:e=>n(e.target.value),placeholder:`First and last name`,required:!0,autoFocus:!0})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-xs font-medium text-[#444746] dark:text-[#C4C7C5] block mb-1`,children:`Email`}),(0,U.jsx)(Os,{type:`email`,value:r,onChange:e=>i(e.target.value),placeholder:`name@example.com`,required:!0})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-xs font-medium text-[#444746] dark:text-[#C4C7C5] block mb-1`,children:`Password`}),(0,U.jsx)(Os,{type:`password`,value:a,onChange:e=>o(e.target.value),placeholder:`Choose a strong password`,required:!0})]}),sc,l?(0,U.jsx)(`p`,{className:`rounded-lg bg-[#F9DEDC]/50 border border-[#F9DEDC] p-2.5 text-xs text-[#B3261E]`,children:l}):null,(0,U.jsxs)(`div`,{className:`mt-2 flex items-center justify-between`,children:[(0,U.jsx)(Dn,{to:`/login`,className:`text-xs font-medium text-[#0B57D0] hover:underline dark:text-[#A8C7FA]`,children:`Sign in instead`}),(0,U.jsx)(G,{disabled:d,children:d?`Creating...`:`Next`})]})]}),(0,U.jsx)(`div`,{className:`mt-6 pt-6 border-t border-[#E0E3E7] dark:border-[#36373A]`,children:(0,U.jsxs)(G,{variant:`outline`,className:`w-full`,disabled:p,onClick:g,children:[(0,U.jsx)(Ks,{}),(0,U.jsx)(`span`,{children:p?`Redirecting...`:`Sign up with Google`})]})})]})})}function lc(e){return e===`s3`?`S3 Storage`:`Google Drive`}function uc(e){return e.provider===`s3`&&e.storageAccount?.totalBytes===null?`Unlimited`:wo(e.storageAccount?.totalBytes)}function dc(e){return e.provider===`s3`&&e.storageAccount?.availableBytes===null?`Unlimited`:wo(e.storageAccount?.availableBytes)}function fc(){let e=Zn(),{defaultAccountId:t,setDefaultAccountId:n}=Ao(),{language:r,setLanguage:i,t:a}=Fo(),[o,s]=(0,v.useState)([]),{toast:c}=as(),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)({name:``,bucket:``,region:`us-east-1`,endpoint:``,accessKeyId:``,secretAccessKey:``,forcePathStyle:!1,quotaBytes:``}),[_,y]=(0,v.useState)(null),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(null),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!1),[M,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(``),[I,L]=(0,v.useState)(``),[R,ee]=(0,v.useState)(``),[te,ne]=(0,v.useState)(``),[re,z]=(0,v.useState)(``),[ie,ae]=(0,v.useState)(!1),[oe,se]=(0,v.useState)(!1),[ce,le]=(0,v.useState)(!1),[ue,de]=(0,v.useState)(!1),[fe,B]=(0,v.useState)(``),[pe,me]=(0,v.useState)(!1),[he,ge]=(0,v.useState)(null),[_e,ve]=(0,v.useState)(0),ye=(0,v.useRef)(null),[V,H]=(0,v.useState)(!1),[be,xe]=(0,v.useState)(!1),[Se,Ce]=(0,v.useState)(null),[we,Te]=(0,v.useState)(``),[Ee,De]=(0,v.useState)(!1);async function Oe(){H(!0);try{let e=Yn(),t=await fetch(`/system/backup`,{headers:{Authorization:`Bearer ${e}`}});if(!t.ok){let e=await t.json().catch(()=>null);throw Error(e?.message||`Failed to retrieve database backup.`)}let n=t.headers.get(`Content-Disposition`),r=`9drive-backup.json`;if(n&&n.includes(`filename=`)){let e=n.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);e&&e[1]&&(r=e[1].replace(/['"]/g,``).trim())}let i=await t.blob(),a=window.URL.createObjectURL(i),o=document.createElement(`a`);o.href=a,o.download=r,document.body.appendChild(o),o.click(),o.remove(),window.URL.revokeObjectURL(a),c.success(`Backup downloaded successfully!`)}catch(e){c.error(`Failed to download backup: `+e.message)}finally{H(!1)}}function ke(e){e.target.files&&e.target.files.length>0?(Ce(e.target.files[0]),Te(``)):Ce(null)}async function Ae(){if(Se&&confirm(`WARNING: Restoring from "${Se.name}" will overwrite current database records (accounts, folders, files, and users). Are you sure you want to proceed?`)){xe(!0),Te(``),De(!1);try{let e=Yn(),t=new FormData;t.append(`file`,Se);let n=await fetch(`/system/restore`,{method:`POST`,headers:{Authorization:`Bearer ${e}`},body:t}),r=await n.json();if(!n.ok)throw Error(r.message||`Failed to restore database.`);De(!0),Te(r.message||`Database restored successfully! Logging you out to refresh your session...`),c.success(`Database restored successfully!`),setTimeout(()=>{tr(),window.location.href=`/login`},3e3)}catch(e){De(!1);let t=e.message||`Failed to restore database.`;Te(t),c.error(`Restore failed: `+t)}finally{xe(!1)}}}(0,v.useEffect)(()=>{if(!ue)return;let e,t=!0;async function n(){try{let e=await W(`/system/update-log`);if(!t)return;B(e.log),ve(0),e.log.includes(`=== System Update Completed:`)&&(me(!0),ge(!0),de(!1),F(`System Updated`))}catch{if(!t)return;ve(e=>e+1)}}return n(),e=setInterval(n,2e3),()=>{t=!1,clearInterval(e)}},[ue]),(0,v.useEffect)(()=>{ye.current&&(ye.current.scrollTop=ye.current.scrollHeight)},[fe]);async function je(){j(!0),B(`Initiating system update in the background...
|
|
12
|
+
`),me(!1),ge(null),ve(0),F(`System Updating`),N(!0);try{await W(`/system/update`,{method:`POST`}),de(!0)}catch(e){F(`System Update Failed`);let t=e instanceof Error?e.message:`System update failed to initiate.`;B(e=>e+`\nError: ${t}`),me(!0),ge(!1)}finally{j(!1)}}async function Me(e){e.preventDefault(),se(!0);try{let e=await W(`/system/google-config`,{method:`POST`,body:JSON.stringify({clientId:I,clientSecret:R||void 0,redirectUri:te||re})});c.success(e.message||`Google OAuth credentials saved.`),ae(!0),ee(``)}catch(e){c.error(e instanceof Error?e.message:`Failed to save Google OAuth configuration`)}finally{se(!1)}}let Ne=o.find(e=>e.id===O)??o[0]??null;async function Pe(){s((await W(`/connected-accounts`)).accounts);try{let e=await W(`/system/google-config`);e.exists&&(L(e.clientId||``),ne(e.redirectUri||``),ae(e.hasSecret||!1)),z(e.defaultRedirectUri||``)}catch(e){console.error(`Failed to load global Google config`,e)}}(0,v.useEffect)(()=>{Pe().catch(e=>c.error(e instanceof Error?e.message:`Failed to load settings`))},[]),(0,v.useEffect)(()=>{D(!1),Wo(e?.email,96).then(T).catch(()=>T(``))},[e?.email]),(0,v.useEffect)(()=>{if(o.length===0){k(``);return}o.some(e=>e.id===O)||k(o[0].id)},[o,O]),(0,v.useEffect)(()=>{function e(e){e.origin!==window.location.origin||e.data?.type!==`GOOGLE_CONNECTED`||(e.data.status===`success`?c.success(`Google Drive connected.`):c.error(`Google Drive connection failed.`),Pe().then(()=>{window.dispatchEvent(new Event(`9drive:storage-changed`)),window.dispatchEvent(new Event(`9drive:accounts-changed`))}).catch(()=>void 0))}return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[]);async function Fe(){u(!0);let e=window.open(``,`google-drive-connect`,`width=540,height=720`);e&&e.document.write(`<html><head><title>Connecting...</title><style>body{font-family:sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#f8fafc;color:#64748b;}</style></head><body><div style="text-align:center;"><h2>Connecting to Google...</h2><p>Please wait while we redirect you.</p></div></body></html>`);try{let t=await W(`/connected-accounts/google/connect-url`);e?e.location.href=t.url:window.location.href=t.url}catch(t){e&&e.close(),c.error(t instanceof Error?t.message:`Failed to start Google Drive connection`)}finally{u(!1)}}async function Ie(e){y(e);try{await W(`/connected-accounts/${e}/sync-quota`,{method:`POST`}),await Pe(),window.dispatchEvent(new Event(`9drive:storage-changed`))}finally{y(null)}}async function Le(){if(S){x(S.id);try{await W(`/connected-accounts/${S.id}`,{method:`DELETE`}),C(null),c.success(`Storage account disconnected.`),await Pe(),window.dispatchEvent(new Event(`9drive:storage-changed`)),window.dispatchEvent(new Event(`9drive:accounts-changed`))}catch(e){c.error(e instanceof Error?e.message:`Failed to disconnect Google Drive account`)}finally{x(null)}}}async function Re(e){e.preventDefault(),m(!0);try{await W(`/connected-accounts/s3`,{method:`POST`,body:JSON.stringify({...h,endpoint:h.endpoint||void 0,quotaBytes:h.quotaBytes||null})}),f(!1),g({name:``,bucket:``,region:`us-east-1`,endpoint:``,accessKeyId:``,secretAccessKey:``,forcePathStyle:!1,quotaBytes:``}),c.success(`S3 storage connected.`),await Pe(),window.dispatchEvent(new Event(`9drive:storage-changed`))}catch(e){c.error(e instanceof Error?e.message:`Failed to connect S3 storage`)}finally{m(!1)}}return(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 pb-1`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{className:`text-[22px] font-normal tracking-tight text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Settings`}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mt-0.5`,children:`Manage your account, storage connections, and system settings.`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(G,{variant:`outline`,size:`sm`,className:`rounded-full h-8 text-xs font-medium`,onClick:()=>f(!0),children:[(0,U.jsx)(Ir,{className:`h-3.5 w-3.5`}),`Connect S3`]}),(0,U.jsxs)(G,{size:`sm`,className:`rounded-full h-8 text-xs font-medium`,onClick:Fe,disabled:l,children:[(0,U.jsx)(ii,{className:`h-3.5 w-3.5`}),l?`Connecting...`:`Connect Drive`]})]})]}),(0,U.jsxs)(`div`,{className:`grid gap-4 lg:grid-cols-[1fr_280px]`,children:[(0,U.jsxs)(`div`,{className:`grid gap-4`,children:[(0,U.jsx)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-5`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-4`,children:[!w||E?(0,U.jsx)(`div`,{className:`flex h-14 w-14 shrink-0 items-center justify-center rounded-full bg-[#0B57D0] text-xl font-medium text-white shadow-xs`,children:(e?.name??e?.email??`U`).trim().charAt(0).toUpperCase()}):(0,U.jsx)(`img`,{src:w,alt:`User avatar`,className:`h-14 w-14 rounded-full object-cover border border-[#E0E3E7] dark:border-[#36373A]`,onError:()=>D(!0)}),(0,U.jsxs)(`div`,{className:`flex-1 min-w-0`,children:[(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3] truncate`,children:e?.name??`User`}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mt-0.5 truncate`,children:e?.email??`-`}),(0,U.jsx)(`span`,{className:`inline-block mt-1 text-[11px] font-medium text-[#0B57D0] dark:text-[#A8C7FA]`,children:`Google Workspace Account`})]})]})}),(0,U.jsx)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-5`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(Xr,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:a(`settings.language_title`,`Language / Bahasa`)})]}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-[#747775] dark:text-[#8E918F]`,children:a(`settings.language_desc`,`Select your preferred interface language.`)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:()=>i(`en`),className:xo(`flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-xs font-medium transition-all duration-150`,r===`en`?`bg-[#0B57D0] text-white shadow-xs dark:bg-[#A8C7FA] dark:text-[#001D35]`:`border border-[#E0E3E7] text-[#444746] hover:bg-black/5 dark:border-[#36373A] dark:text-[#C4C7C5] dark:hover:bg-white/10`),children:[r===`en`&&(0,U.jsx)(xr,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:a(`settings.lang_en`,`English (Default)`)})]}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>i(`id`),className:xo(`flex items-center gap-1.5 px-3.5 py-1.5 rounded-full text-xs font-medium transition-all duration-150`,r===`id`?`bg-[#0B57D0] text-white shadow-xs dark:bg-[#A8C7FA] dark:text-[#001D35]`:`border border-[#E0E3E7] text-[#444746] hover:bg-black/5 dark:border-[#36373A] dark:text-[#C4C7C5] dark:hover:bg-white/10`),children:[r===`id`&&(0,U.jsx)(xr,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:a(`settings.lang_id`,`Bahasa Indonesia`)})]})]})]})}),(0,U.jsx)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-5`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(jr,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:a(`settings.google_title`,`Google Drive`)})]}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-[#747775] dark:text-[#8E918F]`,children:a(`settings.google_desc`,`Connect Google Drive accounts. 9Drive routes uploads to accounts with available quota.`)})]}),(0,U.jsxs)(G,{className:`rounded-full h-8 text-xs font-medium shrink-0`,size:`sm`,onClick:Fe,disabled:l,children:[(0,U.jsx)(ii,{className:`h-3.5 w-3.5`}),l?r===`id`?`Membuka...`:`Opening...`:a(`settings.connect_drive`,`Connect Drive`)]})]})}),(0,U.jsx)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-5`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(Ir,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`S3 Compatible Storage`})]}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-[#747775] dark:text-[#8E918F]`,children:`Connect AWS S3, Cloudflare R2, MinIO, Wasabi, Backblaze B2, or custom endpoint storage.`})]}),(0,U.jsxs)(G,{className:`rounded-full h-8 text-xs font-medium shrink-0`,size:`sm`,variant:`outline`,onClick:()=>f(!0),children:[(0,U.jsx)(Ir,{className:`h-3.5 w-3.5`}),`Connect S3`]})]})}),(0,U.jsx)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-5`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(ni,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Akun Default Platform`})]}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-[#747775] dark:text-[#8E918F]`,children:`Pilih akun Google Drive atau opsi default yang otomatis aktif setiap kali membuka 9Drive.`})]}),(0,U.jsx)(`div`,{className:`w-full sm:w-64 shrink-0`,children:(0,U.jsx)(ks,{variant:`sm`,value:t,onChange:e=>{n(e);let t=e===`all`?`Semua Akun`:o.find(t=>t.id===e)?.email||e;c.success(`Akun default berhasil diatur ke: ${t}`)},options:[{value:`all`,label:`Semua Akun (Tampilkan Seluruh File)`},...o.map(e=>({value:e.id,label:e.displayName?`${e.email} (${e.displayName})`:e.email}))]})})]})}),(0,U.jsxs)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-5`,children:[(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Connected Storage Accounts`}),(0,U.jsx)(`div`,{className:`mt-3.5 grid gap-3`,children:o.length===0?(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:`No connected storage account yet.`}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(`div`,{className:`grid gap-1.5 text-xs font-medium text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(`span`,{children:`Select Account`}),(0,U.jsx)(ks,{variant:`sm`,value:Ne?.id??``,onChange:e=>k(e),options:o.map(e=>({value:e.id,label:`${lc(e.provider)} - ${e.displayName||e.email} (${e.status})${e.id===t?` [Default]`:``}`}))})]}),Ne?(0,U.jsxs)(`div`,{className:`rounded-xl bg-[#F8FAFD] dark:bg-[#18191A] p-4 border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`p`,{className:`break-all font-medium text-sm text-[#1F1F1F] dark:text-[#E3E3E3]`,children:Ne.displayName||Ne.email}),Ne.id===t&&(0,U.jsxs)(`span`,{className:`inline-flex items-center gap-1 rounded-full bg-[#E6F4EA] px-2 py-0.5 text-[10px] font-medium text-[#137333] dark:bg-[#0E3D1E] dark:text-[#A8DAB5]`,children:[(0,U.jsx)(xr,{className:`h-3 w-3`}),`Akun Default`]})]}),(0,U.jsxs)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mt-0.5`,children:[lc(Ne.provider),` · `,Ne.status]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[Ne.id!==t&&(0,U.jsx)(G,{size:`sm`,variant:`outline`,className:`rounded-full h-8 text-xs font-medium`,onClick:()=>{n(Ne.id),c.success(`Akun ${Ne.email} berhasil dijadikan sebagai akun default.`)},children:`Jadikan Default`}),(0,U.jsxs)(G,{size:`sm`,variant:`outline`,className:`rounded-full h-8 text-xs font-medium`,onClick:()=>Ie(Ne.id),disabled:_===Ne.id,children:[(0,U.jsx)(Si,{className:_===Ne.id?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),_===Ne.id?`Syncing...`:`Sync`]}),(0,U.jsxs)(G,{size:`sm`,variant:`danger`,className:`rounded-full h-8 text-xs font-medium`,onClick:()=>C(Ne),children:[(0,U.jsx)(Fi,{className:`h-3.5 w-3.5`}),`Disconnect`]})]})]}),(0,U.jsxs)(`div`,{className:`mt-3 grid grid-cols-3 gap-2 text-center text-xs`,children:[(0,U.jsxs)(`div`,{className:`rounded-xl bg-white dark:bg-[#1E1F20] p-2.5 border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsx)(`p`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:wo(Ne.storageAccount?.usedBytes)}),(0,U.jsx)(`p`,{className:`mt-0.5 text-[11px] text-[#747775] dark:text-[#8E918F]`,children:`Used`})]}),(0,U.jsxs)(`div`,{className:`rounded-xl bg-white dark:bg-[#1E1F20] p-2.5 border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsx)(`p`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:uc(Ne)}),(0,U.jsx)(`p`,{className:`mt-0.5 text-[11px] text-[#747775] dark:text-[#8E918F]`,children:`Total`})]}),(0,U.jsxs)(`div`,{className:`rounded-xl bg-white dark:bg-[#1E1F20] p-2.5 border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsx)(`p`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:dc(Ne)}),(0,U.jsx)(`p`,{className:`mt-0.5 text-[11px] text-[#747775] dark:text-[#8E918F]`,children:`Free`})]})]})]}):null]})})]}),(0,U.jsxs)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-5`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-[#E0E3E7] dark:border-[#36373A] pb-3 mb-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(jr,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Google OAuth Credentials`})]}),(0,U.jsx)(G,{variant:`outline`,size:`sm`,className:`rounded-full h-7 text-xs font-medium`,type:`button`,onClick:()=>le(!ce),children:ce?`Hide Guide`:`Setup Guide`})]}),ce&&(0,U.jsxs)(`div`,{className:`mb-4 rounded-xl bg-[#F8FAFD] dark:bg-[#18191A] p-4 text-xs leading-relaxed text-[#444746] dark:text-[#C4C7C5] border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsx)(`p`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3] mb-1.5`,children:`Langkah Setup Google OAuth Credentials:`}),(0,U.jsxs)(`ol`,{className:`list-decimal pl-4 space-y-1.5`,children:[(0,U.jsxs)(`li`,{children:[`Buka `,(0,U.jsx)(`a`,{href:`https://console.cloud.google.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-[#0B57D0] hover:underline font-medium`,children:`Google Cloud Console`}),` dan pilih/buat project Anda.`]}),(0,U.jsxs)(`li`,{children:[`Aktifkan `,(0,U.jsx)(`strong`,{children:`Google Drive API`}),` di menu `,(0,U.jsx)(`em`,{children:`Enabled APIs & services`}),`.`]}),(0,U.jsxs)(`li`,{children:[`Masuk ke `,(0,U.jsx)(`strong`,{children:`APIs & Services > Credentials`}),`, klik `,(0,U.jsx)(`strong`,{children:`Create Credentials > OAuth client ID`}),`.`]}),(0,U.jsxs)(`li`,{children:[`Pilih application type: `,(0,U.jsx)(`strong`,{children:`Web application`}),`.`]}),(0,U.jsxs)(`li`,{children:[`Masukkan URL ini persis di bagian `,(0,U.jsx)(`strong`,{children:`Authorized redirect URIs`}),`:`,(0,U.jsx)(`div`,{className:`mt-1 flex items-center gap-1.5 font-mono text-[11px] bg-white dark:bg-[#1E1F20] p-1.5 rounded-lg border border-[#E0E3E7] dark:border-[#36373A] select-all overflow-x-auto text-[#0B57D0]`,children:te||re})]}),(0,U.jsxs)(`li`,{children:[`Copy `,(0,U.jsx)(`strong`,{children:`Client ID`}),` dan `,(0,U.jsx)(`strong`,{children:`Client Secret`}),` yang diberikan Google ke form di bawah ini, lalu klik Simpan.`]})]}),(0,U.jsxs)(`div`,{className:`mt-3 rounded-xl border border-[#D3E3FD] bg-[#EDF2FC] p-3 text-[11px] text-[#1F1F1F] dark:border-[#2C384A] dark:bg-[#1E232B] dark:text-[#E3E3E3]`,children:[(0,U.jsxs)(`p`,{className:`font-semibold flex items-center gap-1.5 mb-1 text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[(0,U.jsx)(ei,{className:`h-3.5 w-3.5 text-[#0B57D0] dark:text-[#A8C7FA]`}),(0,U.jsx)(`span`,{children:`Catatan Google Cloud Console (Mode Testing):`})]}),(0,U.jsxs)(`p`,{className:`text-[#444746] dark:text-[#C4C7C5] leading-relaxed`,children:[`Jika status aplikasi di Google Console masih `,(0,U.jsx)(`strong`,{children:`"Testing"`}),` (belum diverifikasi publik), buka menu `,(0,U.jsx)(`strong`,{children:`APIs & Services > OAuth consent screen > Test users`}),`. Klik `,(0,U.jsx)(`strong`,{children:`+ Add Users`}),` dan daftarkan alamat Gmail Anda. Jika terlewat, Google akan menolak koneksi dengan pesan: `,(0,U.jsx)(`em`,{children:`"Access blocked: 403 access_denied / Not a test user"`}),`.`]})]})]}),(0,U.jsxs)(`form`,{onSubmit:Me,className:`grid gap-3.5`,children:[(0,U.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-[#747775] dark:text-[#8E918F]`,children:[`Client ID`,(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] px-3 text-xs text-[#1F1F1F] dark:text-[#E3E3E3] focus:border-[#0B57D0] focus:outline-none`,placeholder:`Enter Google Client ID`,value:I,onChange:e=>L(e.target.value),required:!0})]}),(0,U.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-[#747775] dark:text-[#8E918F]`,children:[`Client Secret `,ie&&(0,U.jsx)(`span`,{className:`font-normal text-[#137333] dark:text-[#81C995]`,children:`(Configured)`}),(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] px-3 text-xs text-[#1F1F1F] dark:text-[#E3E3E3] focus:border-[#0B57D0] focus:outline-none`,type:`password`,placeholder:ie?`••••••••••••••••••••••••`:`Enter Google Client Secret`,value:R,onChange:e=>ee(e.target.value),required:!ie})]}),(0,U.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-[#747775] dark:text-[#8E918F]`,children:[`Redirect URI (Optional)`,(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] px-3 text-xs text-[#1F1F1F] dark:text-[#E3E3E3] focus:border-[#0B57D0] focus:outline-none`,placeholder:re,value:te,onChange:e=>ne(e.target.value)})]}),(0,U.jsx)(`div`,{className:`flex justify-end mt-1`,children:(0,U.jsx)(G,{type:`submit`,disabled:oe,size:`sm`,className:`rounded-full`,children:oe?`Saving...`:`Save Credentials`})})]})]}),(0,U.jsx)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-5`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-3.5 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(Si,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`System Update`})]}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-[#747775] dark:text-[#8E918F]`,children:`Pull the latest release code from GitHub repository. Dev servers will automatically restart.`})]}),(0,U.jsxs)(G,{className:`rounded-full h-8 text-xs font-medium shrink-0`,variant:`outline`,size:`sm`,onClick:je,disabled:A,children:[(0,U.jsx)(Si,{className:A?`h-3.5 w-3.5 animate-spin`:`h-3.5 w-3.5`}),A?`Updating...`:`Update Code`]})]})}),(0,U.jsx)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-5`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-[#E0E3E7] dark:border-[#36373A] pb-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(Ir,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Backup & Restore Database`})]}),(0,U.jsx)(`span`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F] font-medium uppercase tracking-wider`,children:`System Database Snapshot`})]}),(0,U.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,U.jsxs)(`div`,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#18191A] p-5 flex flex-col justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3.5`,children:[(0,U.jsx)(`div`,{className:`h-10 w-10 shrink-0 rounded-full bg-[#EDF2FC] dark:bg-[#004A77]/30 text-[#0B57D0] dark:text-[#A8C7FA] flex items-center justify-center`,children:(0,U.jsx)(Zr,{className:`h-5 w-5`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Download Backup`}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-[#747775] dark:text-[#8E918F]`,children:`Export a full snapshot of your active database (users, connected accounts, folder hierarchy, and file metadata).`})]})]}),(0,U.jsxs)(G,{className:`mt-5 w-full rounded-full`,onClick:Oe,disabled:V,children:[(0,U.jsx)(Zr,{className:V?`h-4 w-4 animate-bounce`:`h-4 w-4`}),V?`Downloading Backup...`:`Download Backup`]})]}),(0,U.jsxs)(`div`,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#18191A] p-5 flex flex-col justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3.5`,children:[(0,U.jsx)(`div`,{className:`h-10 w-10 shrink-0 rounded-full bg-[#FEF7E0] dark:bg-[#724300]/30 text-[#B06000] dark:text-[#FDD663] flex items-center justify-center`,children:(0,U.jsx)(Si,{className:`h-5 w-5`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Restore Backup`}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-[#747775] dark:text-[#8E918F]`,children:`Upload a previously saved 9Drive backup file (.json) to restore all database records.`})]})]}),(0,U.jsxs)(`div`,{className:`mt-5 grid gap-3`,children:[(0,U.jsx)(`input`,{type:`file`,accept:`.json,.db,.sql`,onChange:ke,className:`block w-full text-xs text-[#747775] file:mr-2 file:py-1 file:px-3 file:rounded-full file:border-0 file:text-xs file:font-medium file:bg-[#EDF2FC] file:text-[#0B57D0] hover:file:bg-[#D3E3FD] cursor-pointer border border-[#E0E3E7] dark:border-[#36373A] rounded-xl p-1 bg-white dark:bg-[#1E1F20]`}),Se&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-white dark:bg-[#28292A] border border-[#E0E3E7] dark:border-[#36373A] px-3 py-1.5 text-xs`,children:[(0,U.jsx)(`span`,{className:`truncate max-w-[200px] font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:Se.name}),(0,U.jsx)(`span`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:wo(Se.size)})]}),(0,U.jsxs)(G,{variant:Se?`danger`:`outline`,className:`w-full rounded-full`,onClick:Ae,disabled:be||!Se,children:[(0,U.jsx)(Si,{className:be?`h-4 w-4 animate-spin`:`h-4 w-4`}),be?`Restoring Database...`:`Restore Backup`]})]})]})]}),we&&(0,U.jsx)(`p`,{className:`rounded-xl px-4 py-2.5 text-xs font-medium ${Ee?`bg-[#E6F4EA] text-[#137333] dark:bg-[#0F5223]/30 dark:text-[#81C995]`:`bg-[#FCE8E6] text-[#C5221F] dark:bg-[#8C1D18]/30 dark:text-[#F28B82]`}`,children:we})]})})]}),(0,U.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-3 lg:grid-cols-1 lg:gap-3 self-start`,children:[(0,U.jsxs)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-4`,children:[(0,U.jsx)(Zr,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsx)(`h2`,{className:`mt-2 text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Storage`}),(0,U.jsxs)(`p`,{className:`mt-0.5 text-xs text-[#747775] dark:text-[#8E918F]`,children:[`Connected accounts: `,o.length]})]}),(0,U.jsxs)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-4`,children:[(0,U.jsx)(vr,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsx)(`h2`,{className:`mt-2 text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Notifications`}),(0,U.jsx)(`p`,{className:`mt-0.5 text-xs text-[#747775] dark:text-[#8E918F]`,children:`System and sync alerts are active.`})]}),(0,U.jsxs)(Js,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-4`,children:[(0,U.jsx)(Xr,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsx)(`h2`,{className:`mt-2 text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Region`}),(0,U.jsx)(`p`,{className:`mt-0.5 text-xs text-[#747775] dark:text-[#8E918F]`,children:`Workspace region: Local Gateway.`})]})]})]}),(0,U.jsx)(os,{open:d,title:`Connect S3 Storage`,description:`Use any S3-compatible provider with custom endpoint support.`,onClose:()=>f(!1),children:(0,U.jsxs)(`form`,{className:`grid gap-4`,onSubmit:Re,children:[(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] px-3 text-xs text-[#1F1F1F] dark:text-[#E3E3E3]`,placeholder:`Display name`,value:h.name,onChange:e=>g({...h,name:e.target.value}),required:!0}),(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] px-3 text-xs text-[#1F1F1F] dark:text-[#E3E3E3]`,placeholder:`Bucket`,value:h.bucket,onChange:e=>g({...h,bucket:e.target.value}),required:!0}),(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] px-3 text-xs text-[#1F1F1F] dark:text-[#E3E3E3]`,placeholder:`Region`,value:h.region,onChange:e=>g({...h,region:e.target.value}),required:!0}),(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] px-3 text-xs text-[#1F1F1F] dark:text-[#E3E3E3]`,placeholder:`Endpoint URL (optional)`,value:h.endpoint,onChange:e=>g({...h,endpoint:e.target.value})}),(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] px-3 text-xs text-[#1F1F1F] dark:text-[#E3E3E3]`,placeholder:`Access key ID`,value:h.accessKeyId,onChange:e=>g({...h,accessKeyId:e.target.value}),required:!0}),(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] px-3 text-xs text-[#1F1F1F] dark:text-[#E3E3E3]`,placeholder:`Secret access key`,type:`password`,value:h.secretAccessKey,onChange:e=>g({...h,secretAccessKey:e.target.value}),required:!0}),(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#747775]/40 bg-white dark:bg-[#1E1F20] px-3 text-xs text-[#1F1F1F] dark:text-[#E3E3E3]`,placeholder:`Quota bytes (optional)`,inputMode:`numeric`,value:h.quotaBytes,onChange:e=>g({...h,quotaBytes:e.target.value})}),(0,U.jsxs)(`label`,{className:`flex items-center gap-2 text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:h.forcePathStyle,onChange:e=>g({...h,forcePathStyle:e.target.checked})}),`Force path style`]}),(0,U.jsxs)(`div`,{className:`grid gap-3 sm:flex sm:justify-end`,children:[(0,U.jsx)(G,{variant:`outline`,type:`button`,className:`rounded-full`,onClick:()=>f(!1),disabled:p,children:`Cancel`}),(0,U.jsx)(G,{type:`submit`,className:`rounded-full`,disabled:p,children:p?`Connecting...`:`Connect S3`})]})]})}),(0,U.jsx)(os,{open:!!S,title:`Disconnect storage?`,description:`This will remove this storage account from 9Drive. Existing file records for this account may no longer be usable.`,onClose:()=>C(null),children:(0,U.jsxs)(`div`,{className:`grid gap-4`,children:[(0,U.jsxs)(`div`,{className:`rounded-xl bg-[#F8FAFD] dark:bg-[#18191A] p-4 text-xs text-[#444746] dark:text-[#C4C7C5] border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsx)(`p`,{className:`font-medium text-sm text-[#1F1F1F] dark:text-[#E3E3E3]`,children:S?.email}),(0,U.jsxs)(`p`,{className:`mt-1`,children:[`Used storage: `,wo(S?.storageAccount?.usedBytes)]})]}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{variant:`outline`,className:`rounded-full`,onClick:()=>C(null),disabled:!!b,children:`Cancel`}),(0,U.jsxs)(G,{variant:`danger`,className:`rounded-full`,onClick:Le,disabled:!!b,children:[(0,U.jsx)(Fi,{className:`h-3.5 w-3.5`}),b?`Disconnecting...`:`Disconnect`]})]})]})}),(0,U.jsx)(os,{open:M,title:P,description:pe?he?`System updated successfully`:`Update failed`:`Live installation logs`,className:`max-w-2xl`,onClose:()=>{!pe&&!confirm(`The update is still running in the background. Close log viewer?`)||(N(!1),de(!1),pe&&he&&window.location.reload())},children:(0,U.jsxs)(`div`,{className:`grid gap-4`,children:[(0,U.jsxs)(`div`,{ref:ye,className:`relative rounded-xl bg-slate-950 p-4 font-mono text-xs text-slate-300 leading-relaxed border border-slate-800 h-80 overflow-y-auto select-text`,children:[(0,U.jsx)(`pre`,{className:`whitespace-pre-wrap`,children:fe}),!pe&&(0,U.jsxs)(`div`,{className:`mt-3 flex items-center gap-2 text-blue-400`,children:[(0,U.jsx)(Si,{className:`h-3.5 w-3.5 animate-spin`}),(0,U.jsx)(`span`,{children:_e>0?`Rebooting server and reconnecting... (attempt ${_e})`:`Installing updates...`})]})]}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{variant:`outline`,onClick:()=>{!pe&&!confirm(`The update is still running. Close log viewer?`)||(N(!1),de(!1),pe&&he&&window.location.reload())},children:`Close`}),pe&&he&&(0,U.jsx)(G,{onClick:()=>window.location.reload(),children:`Reload Page`})]})]})})]})}function pc(e){return e.startsWith(`image/`)?`image`:e.startsWith(`video/`)?`video`:e.includes(`pdf`)?`pdf`:`doc`}function mc(e){let t=e.driveUrl??(e.providerFileId?`https://drive.google.com/file/d/${e.providerFileId}/view?usp=sharing`:void 0);return{id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes,createdAt:e.createdAt,accountEmail:e.connectedAccount?.email,accountProvider:e.connectedAccount?.provider===`s3`?`S3 Storage`:`Google Drive`,date:e.sharedWithMeTime?To(e.sharedWithMeTime):To(e.createdAt),size:wo(e.sizeBytes),access:e.connectedAccount?.email??`Google Drive`,kind:pc(e.mimeType),shared:1,owner:e.owner||`Shared`,folderId:e.folderId,folderName:e.folder?.name,providerFileId:e.providerFileId,driveUrl:t}}function hc(){let e=tt(),{selectedAccountId:t}=Ao(),[n,r]=(0,v.useState)([]),[i,a]=(0,v.useState)([]),[o,s]=(0,v.useState)(`list`),[c,l]=(0,v.useState)(`all`),[u,d]=(0,v.useState)(!0),[f,p]=(0,v.useState)(new Set),[m,h]=(0,v.useState)(null),[g,_]=(0,v.useState)({x:0,y:0,file:null}),[y,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(!1),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(``),[D,O]=(0,v.useState)(!1),[k,A]=(0,v.useState)(``),[j,M]=(0,v.useState)(``),[N,P]=(0,v.useState)(!1),{toast:F}=as(),{t:I}=Fo(),[L,R]=(0,v.useState)(`shared`),[ee,te]=(0,v.useState)([]),[ne,re]=(0,v.useState)([]);async function z(){d(!0);try{let e=await W(t&&t!==`all`?`/files/shared?accountId=${t}`:`/files/shared`);e.files&&e.files.length>0?r(e.files.map(mc)):r([]),e.folders&&e.folders.length>0?a(e.folders.map(e=>({id:e.id,name:e.name,updated:To(e.updated),color:e.color||`text-blue-500`,iconUrl:e.iconUrl,providerFolderId:e.providerFolderId,driveUrl:e.driveUrl}))):a([])}catch{r([]),a([])}finally{d(!1)}}async function ie(){try{let e=await W(`/invites`);te(e.sent??[]),re(e.received??[])}catch{te([]),re([])}}(0,v.useEffect)(()=>{z(),ie();let e=()=>{z()},t=()=>{ie()};return window.addEventListener(`9drive:storage-changed`,e),window.addEventListener(`9drive:invites-changed`,t),()=>{window.removeEventListener(`9drive:storage-changed`,e),window.removeEventListener(`9drive:invites-changed`,t)}},[t]);function ae(e){e.toLowerCase().includes(`success`)||e.toLowerCase().includes(`copied`)||e.toLowerCase().includes(`renamed`)||e.toLowerCase().includes(`moved`)||e.toLowerCase().includes(`revoked`)?F.success(e):e.toLowerCase().includes(`failed`)||e.toLowerCase().includes(`error`)?F.error(e):F.info(e)}let oe=n.filter(e=>!(c===`docs`&&e.kind!==`doc`||c===`images`&&e.kind!==`image`||c===`videos`&&e.kind!==`video`||c===`pdfs`&&e.kind!==`pdf`)),se=oe.map(e=>e.id).filter(Boolean),ce=se.length>0&&se.every(e=>f.has(e));function le(e){e.id&&p(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})}function ue(){p(ce?new Set:new Set(se))}function de(){p(new Set)}function fe(e,t){e.preventDefault(),e.stopPropagation(),h(t),_({x:e.clientX,y:e.clientY,file:t})}async function B(e){let t=e??m;if(t?.id){h(t),A(``),M(``),P(!0),O(!0),_({x:0,y:0,file:null});try{let e=await W(`/files/${t.id}/preview-token`,{method:`POST`});A(`${e.path??new URL(e.url).pathname}`)}catch(e){M(e instanceof Error?e.message:`Failed to load preview`)}finally{P(!1)}}}async function pe(e){let t=e??m;if(t?.id)try{let e=await fetch(`/files/${t.id}/download`,{headers:{Authorization:`Bearer ${Yn()}`}});if(!e.ok)throw Error(`Download failed`);let n=await e.blob(),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t.name,i.click(),URL.revokeObjectURL(r)}catch(e){ae(e instanceof Error?e.message:`Download failed`)}finally{_({x:0,y:0,file:null})}}async function me(e){if(e.preventDefault(),m?.id)try{await W(`/files/${m.id}`,{method:`PATCH`,body:JSON.stringify({name:T})}),w(!1),ae(`File renamed to "${T}"`),await z()}catch(e){ae(e instanceof Error?e.message:`Rename failed`)}}function he(e){let t=e??m;t?.id&&(h(t),S(!0),_({x:0,y:0,file:null}))}async function ge(e){let t=e??m;if(t){try{let e=t.driveUrl;!e&&t.id&&(e=(await W(`/files/${t.id}/share`,{method:`POST`})).url),e&&(await navigator.clipboard.writeText(e),ae(`Link copied to clipboard!`))}catch(e){ae(`Failed to copy link: `+(e.message||e))}_({x:0,y:0,file:null})}}function _e(){A(``),M(``),P(!1),O(!1)}function ve(t){t.id?e(`/?folderId=${t.id}`):t.driveUrl&&window.open(t.driveUrl,`_blank`)}async function ye(e){await W(`/invites/${e}`,{method:`DELETE`}),await ie(),ae(`Invite revoked`)}let V=m?Ps(m.mimeType):null,H=n.length+i.length;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 pb-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`h1`,{className:`text-[22px] font-normal tracking-tight text-[#1F1F1F] dark:text-[#E3E3E3]`,children:I(`shared.title`,`Shared with me`)}),(0,U.jsxs)(`span`,{className:`rounded-full bg-[#EDF2FC] px-2.5 py-0.5 text-xs font-medium text-[#0B57D0] dark:bg-[#1E1F20] dark:text-[#A8C7FA]`,children:[H,` `,I(`shared.items`,`items`)]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(`div`,{className:`inline-flex items-center rounded-full border border-[#E0E3E7] dark:border-[#444746] bg-white dark:bg-[#1E1F20] p-0.5 text-xs`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>R(`shared`),className:xo(`rounded-full px-3 py-1.5 font-medium transition-colors`,L===`shared`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:hover:bg-[#282A2C]`),children:I(`shared.tab_files`,`Google Drive Files`)}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>R(`invites`),className:xo(`rounded-full px-3 py-1.5 font-medium transition-colors flex items-center gap-1`,L===`invites`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:hover:bg-[#282A2C]`),children:[(0,U.jsx)(`span`,{children:I(`shared.tab_invites`,`Workspace Invites`)}),(ee.length>0||ne.length>0)&&(0,U.jsx)(`span`,{className:`ml-1 rounded-full bg-blue-100 px-1.5 py-0.2 text-[10px] text-blue-700 dark:bg-blue-900/60 dark:text-blue-300`,children:ee.length+ne.length})]})]}),L===`shared`&&(0,U.jsxs)(`div`,{className:`inline-flex items-center rounded-full border border-[#E0E3E7] dark:border-[#444746] bg-white dark:bg-[#1E1F20] p-0.5 shadow-xs`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>s(`list`),className:`flex h-8 w-8 items-center justify-center rounded-full transition-colors ${o===`list`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:hover:bg-[#282A2C]`}`,title:`List view`,children:(0,U.jsx)(ai,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>s(`grid`),className:`flex h-8 w-8 items-center justify-center rounded-full transition-colors ${o===`grid`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:hover:bg-[#282A2C]`}`,title:`Grid view`,children:(0,U.jsx)(ri,{className:`h-4 w-4`})})]})]})]}),L===`shared`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pb-2`,children:(0,U.jsx)(`div`,{className:`w-36`,children:(0,U.jsx)(ks,{variant:`chip`,value:c,onChange:l,options:[{value:`all`,label:I(`filter.all`,`Type: All`)},{value:`docs`,label:I(`filter.docs`,`Documents`)},{value:`images`,label:I(`filter.images`,`Images`)},{value:`videos`,label:I(`filter.videos`,`Videos`)},{value:`pdfs`,label:I(`filter.pdfs`,`PDFs`)}]})})}),f.size>0&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-[#C2E7FF]/50 px-4 py-2 text-sm text-[#001D35] dark:bg-[#004A77]/40 dark:text-[#C2E7FF]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsxs)(`span`,{className:`font-medium`,children:[f.size,` `,I(`action.selected`,`selected`)]}),(0,U.jsx)(`button`,{type:`button`,onClick:de,className:`text-xs underline hover:opacity-80`,children:I(`action.clear_selection`,`Clear selection`)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[f.size===1&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(G,{variant:`outline`,size:`sm`,onClick:()=>{let e=Array.from(f)[0],t=oe.find(t=>t.id===e);t&&he(t)},className:`h-8 gap-1.5 rounded-full border-[#747775]/40 text-[#0B57D0] hover:bg-[#0B57D0]/10 hover:border-[#0B57D0] dark:border-[#747775]/60 dark:text-[#A8C7FA]`,children:[(0,U.jsx)(Ri,{className:`h-3.5 w-3.5`}),I(`action.share`,`Share`)]}),(0,U.jsxs)(G,{variant:`outline`,size:`sm`,onClick:()=>{let e=Array.from(f)[0],t=oe.find(t=>t.id===e);t&&ge(t)},className:`h-8 gap-1.5 rounded-full border-[#747775]/40 text-[#444746] hover:bg-black/5 dark:border-[#747775]/60 dark:text-[#C4C7C5]`,children:[(0,U.jsx)(ii,{className:`h-3.5 w-3.5`}),I(`action.copy_link`,`Copy link`)]})]}),(0,U.jsx)(G,{variant:`outline`,size:`sm`,onClick:()=>{let e=Array.from(f)[0],t=oe.find(t=>t.id===e);t&&pe(t)},className:`h-8 gap-1.5 text-xs`,children:I(`action.download`,`Download`)})]})]}),u?(0,U.jsx)(`div`,{className:`flex h-64 items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-[#0B57D0] border-t-transparent`})}):i.length===0&&oe.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 text-center`,children:[(0,U.jsx)(`div`,{className:`flex h-24 w-24 items-center justify-center rounded-full bg-[#EDF2FC] dark:bg-[#1E1F20] text-[#0B57D0] dark:text-[#A8C7FA]`,children:(0,U.jsx)(Oi,{className:`h-12 w-12 stroke-[1.5]`})}),(0,U.jsx)(`h2`,{className:`mt-5 text-lg font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:I(`shared.empty_title`,`No files shared with you`)}),(0,U.jsx)(`p`,{className:`mt-1.5 max-w-sm text-sm text-[#747775] dark:text-[#8E918F]`,children:I(`shared.empty_desc`,`Files and folders that people share with your connected Google accounts will automatically appear here.`)})]}):(0,U.jsxs)(`div`,{className:`space-y-6`,children:[i.length>0&&(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-xs font-medium uppercase tracking-wider text-[#747775] dark:text-[#8E918F] mb-2`,children:I(`section.folders`,`Folders`)}),(0,U.jsx)(Ds,{items:i,onFolderOpen:ve,onFolderMenu:(e,t)=>{e.preventDefault(),t.driveUrl&&window.open(t.driveUrl,`_blank`)}})]}),oe.length>0&&(0,U.jsxs)(`div`,{children:[i.length>0&&(0,U.jsx)(`h2`,{className:`text-xs font-medium uppercase tracking-wider text-[#747775] dark:text-[#8E918F] mb-2`,children:I(`section.files`,`Files`)}),o===`list`?(0,U.jsx)(gs,{mode:`shared`,files:oe,selectedFileIds:f,allSelected:ce,onToggleFile:le,onToggleAll:ue,onFileDoubleClick:B,onFileContextMenu:fe,onShare:he}):(0,U.jsx)(ms,{files:oe,selectedFileIds:f,onToggleFile:le,onFileDoubleClick:B,onFileContextMenu:fe,onShare:he})]})]})]}):(0,U.jsxs)(`div`,{className:`space-y-8 mt-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-xs font-medium uppercase tracking-wider text-[#747775] dark:text-[#8E918F] mb-3`,children:`Invites Received`}),ne.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-8 text-center rounded-2xl border border-[#E0E3E7] bg-[#F8FAFD] dark:border-[#36373A] dark:bg-[#28292A]`,children:[(0,U.jsx)(li,{className:`h-8 w-8 text-[#747775] mb-2`}),(0,U.jsx)(`p`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`No workspace invites received`}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] mt-0.5`,children:`Invites shared specifically with your 9Drive email will appear here.`})]}):(0,U.jsx)(`div`,{className:`grid gap-2`,children:ne.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border border-[#E0E3E7] bg-white p-3.5 transition-colors hover:bg-[#F0F4F9] sm:flex-row sm:items-center sm:justify-between dark:border-[#36373A] dark:bg-[#1E1F20] dark:hover:bg-[#28292A]`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,U.jsx)(Yr,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`p`,{className:`truncate text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:e.target?.name??`Unavailable resource`}),(0,U.jsxs)(`p`,{className:`text-xs text-[#747775] capitalize dark:text-[#8E918F]`,children:[e.targetType,` • `,e.role,e.target?.sizeBytes?` • ${wo(e.target.sizeBytes)}`:``]})]})]}),(0,U.jsx)(`span`,{className:xo(`w-fit rounded-full px-2.5 py-0.5 text-xs font-medium capitalize`,e.status===`accepted`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`bg-amber-100 text-amber-800 dark:bg-amber-950/40 dark:text-amber-300`),children:e.status})]},e.id))})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-xs font-medium uppercase tracking-wider text-[#747775] dark:text-[#8E918F] mb-3`,children:`Invites Sent by You`}),ee.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-8 text-center rounded-2xl border border-[#E0E3E7] bg-[#F8FAFD] dark:border-[#36373A] dark:bg-[#28292A]`,children:[(0,U.jsx)(zi,{className:`h-8 w-8 text-[#747775] mb-2`}),(0,U.jsx)(`p`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`No invites sent`}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] mt-0.5`,children:`Use Share on any file or folder to collaborate with teammates.`})]}):(0,U.jsx)(`div`,{className:`grid gap-2`,children:ee.map(e=>(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border border-[#E0E3E7] bg-white p-3.5 transition-colors hover:bg-[#F0F4F9] sm:flex-row sm:items-center sm:justify-between dark:border-[#36373A] dark:bg-[#1E1F20] dark:hover:bg-[#28292A]`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,U.jsx)(Yr,{className:`h-5 w-5 text-[#0B57D0]`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`p`,{className:`truncate text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:e.target?.name??`Unavailable resource`}),(0,U.jsxs)(`p`,{className:`truncate text-xs text-[#747775] dark:text-[#8E918F]`,children:[`Shared with `,e.email,` • `,e.role]}),(0,U.jsxs)(`p`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:[`Invited `,To(e.createdAt)]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{className:xo(`rounded-full px-2.5 py-0.5 text-xs font-medium capitalize`,e.status===`accepted`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`bg-amber-100 text-amber-800 dark:bg-amber-950/40 dark:text-amber-300`),children:e.status}),(0,U.jsxs)(G,{variant:`ghost`,size:`sm`,onClick:()=>ye(e.id),children:[(0,U.jsx)(Fi,{className:`h-4 w-4 text-[#B3261E]`}),` Revoke`]})]})]},e.id))})]})]}),(0,U.jsx)(ds,{file:g.file,x:g.x,y:g.y,onClose:()=>_({x:0,y:0,file:null}),onView:()=>B(),onDownload:()=>pe(),onRename:()=>{m&&(E(m.name),w(!0),_({x:0,y:0,file:null}))},onMove:()=>{_({x:0,y:0,file:null})},onShare:()=>he(),onCopyLink:()=>ge(),onDetails:()=>{b(!0),_({x:0,y:0,file:null})},onDelete:()=>{_({x:0,y:0,file:null})}}),(0,U.jsx)(ps,{open:y,file:m,onClose:()=>b(!1)}),(0,U.jsx)(os,{open:C,title:`Rename file`,description:`Enter a new name for this file`,onClose:()=>w(!1),children:(0,U.jsxs)(`form`,{onSubmit:me,className:`mt-4 flex flex-col gap-4`,children:[(0,U.jsx)(Os,{value:T,onChange:e=>E(e.target.value),placeholder:`File name`,autoFocus:!0}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`outline`,onClick:()=>w(!1),children:`Cancel`}),(0,U.jsx)(G,{type:`submit`,children:`Save`})]})]})}),(0,U.jsx)(ss,{open:x,file:m,onClose:()=>S(!1)}),(0,U.jsx)(os,{open:D,title:`File Preview`,description:m?.name??``,onClose:_e,className:`overflow-hidden sm:max-w-[95vw] xl:max-w-[1400px]`,children:(0,U.jsxs)(`div`,{className:`flex h-[72dvh] w-full items-center justify-center overflow-hidden rounded-xl border border-[#E0E3E7] bg-[#F8FAFD] dark:border-[#36373A] dark:bg-[#131314] sm:h-[80vh]`,children:[N?(0,U.jsx)(`div`,{className:`p-6 text-center text-sm font-semibold text-[#747775] dark:text-[#8E918F]`,children:`Loading preview...`}):null,j?(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,children:[(0,U.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:j}),m?.driveUrl?(0,U.jsxs)(G,{variant:`outline`,onClick:()=>window.open(m.driveUrl,`_blank`),children:[(0,U.jsx)(zr,{className:`mr-2 h-4 w-4`}),` Open in Google Drive`]}):null]}):null,!N&&!j&&V===`image`&&k?(0,U.jsx)(`img`,{src:k,alt:m?.name??`File preview`,className:`max-h-full max-w-full object-contain`,onError:()=>M(`Failed to load preview.`)}):null,!N&&!j&&V===`video`&&k?(0,U.jsx)(`div`,{className:`shared-video-shell`,children:(0,U.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,onError:()=>M(`Failed to load preview.`),children:(0,U.jsx)(`source`,{src:k,type:m?.mimeType})})}):null,!N&&!j&&V===`document`&&k?(0,U.jsx)(`iframe`,{src:k,title:m?.name??`File preview`,className:`h-full w-full border-0 bg-white dark:bg-[#1E1F20]`}):null,!N&&!j&&V===`office`&&k?(0,U.jsx)(`iframe`,{src:Fs(k),title:m?.name??`File preview`,className:`h-full w-full border-0 bg-white dark:bg-[#1E1F20]`}):null,!N&&!j&&!V?(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center text-sm text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(`p`,{children:`Preview not available directly in app for this file type.`}),m?.driveUrl?(0,U.jsxs)(G,{onClick:()=>window.open(m.driveUrl,`_blank`),children:[(0,U.jsx)(zr,{className:`mr-2 h-4 w-4`}),` Open in Google Drive`]}):(0,U.jsx)(G,{onClick:()=>pe(m??void 0),children:`Download file`})]}):null]})})]})}function gc(e){return e.startsWith(`image/`)?`image`:e.startsWith(`video/`)?`video`:e.includes(`pdf`)?`pdf`:`doc`}function _c(e){let t=e.driveUrl??(e.providerFileId?`https://drive.google.com/file/d/${e.providerFileId}/view?usp=sharing`:void 0);return{id:e.id,name:e.name,mimeType:e.mimeType,sizeBytes:e.sizeBytes,createdAt:e.createdAt,accountEmail:e.connectedAccount?.email,accountProvider:e.connectedAccount?.provider===`s3`?`S3 Storage`:`Google Drive`,date:To(e.createdAt),size:wo(e.sizeBytes),access:e.connectedAccount?.email??`Google Drive`,kind:gc(e.mimeType),shared:1,folderId:e.folderId,folderName:e.folder?.name,starredDate:To(e.createdAt),providerFileId:e.providerFileId,driveUrl:t}}function vc(){let{selectedAccountId:e}=Ao(),[t,n]=(0,v.useState)([]),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(`list`),[s,c]=(0,v.useState)(`all`),[l,u]=(0,v.useState)(!0),[d,f]=(0,v.useState)(new Set),[p,m]=(0,v.useState)(null),[h,g]=(0,v.useState)({x:0,y:0,file:null}),[_,y]=(0,v.useState)(!1),[b,x]=(0,v.useState)(!1),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(``),[E,D]=(0,v.useState)(!1),[O,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(``),[M,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(``),[I,L]=(0,v.useState)(``),[R,ee]=(0,v.useState)(!1),{toast:te}=as(),{t:ne}=Fo();async function re(){u(!0);try{let t=await W(e&&e!==`all`?`/files/starred?accountId=${e}`:`/files/starred`);t.files&&t.files.length>0?n(t.files.map(_c)):n([])}catch{n([])}finally{u(!1)}}async function z(){try{i((await W(`/folders`)).folders??[])}catch{i([])}}(0,v.useEffect)(()=>{re(),z();let e=()=>{re()},t=()=>{re()};return window.addEventListener(`9drive:starred-changed`,e),window.addEventListener(`9drive:storage-changed`,t),()=>{window.removeEventListener(`9drive:starred-changed`,e),window.removeEventListener(`9drive:storage-changed`,t)}},[e]);function ie(e){e.toLowerCase().includes(`success`)||e.toLowerCase().includes(`copied`)||e.toLowerCase().includes(`renamed`)||e.toLowerCase().includes(`moved`)?te.success(e):e.toLowerCase().includes(`failed`)||e.toLowerCase().includes(`error`)?te.error(e):te.info(e)}let ae=t.filter(e=>!(s===`docs`&&e.kind!==`doc`||s===`images`&&e.kind!==`image`||s===`videos`&&e.kind!==`video`||s===`pdfs`&&e.kind!==`pdf`)),oe=ae.map(e=>e.id).filter(Boolean),se=oe.length>0&&oe.every(e=>d.has(e));function ce(e){e.id&&f(t=>{let n=new Set(t);return n.has(e.id)?n.delete(e.id):n.add(e.id),n})}function le(){f(se?new Set:new Set(oe))}function ue(){f(new Set)}function de(e,t){e.preventDefault(),e.stopPropagation(),m(t),g({x:e.clientX,y:e.clientY,file:t})}async function fe(e){let t=e??p;if(t?.id){m(t),F(``),L(``),ee(!0),N(!0),g({x:0,y:0,file:null});try{let e=await W(`/files/${t.id}/preview-token`,{method:`POST`});F(`${e.path??new URL(e.url).pathname}`)}catch(e){L(e instanceof Error?e.message:`Failed to load preview`)}finally{ee(!1)}}}async function B(e){let t=e??p;if(t?.id)try{let e=await fetch(`/files/${t.id}/download`,{headers:{Authorization:`Bearer ${Yn()}`}});if(!e.ok)throw Error(`Download failed`);let n=await e.blob(),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=t.name,i.click(),URL.revokeObjectURL(r)}catch(e){ie(e instanceof Error?e.message:`Download failed`)}finally{g({x:0,y:0,file:null})}}async function pe(e){if(e.preventDefault(),p?.id)try{await W(`/files/${p.id}`,{method:`PATCH`,body:JSON.stringify({name:w})}),C(!1),ie(`File renamed to "${w}"`),await re()}catch(e){ie(e instanceof Error?e.message:`Rename failed`)}}async function me(e){e.preventDefault();let t=[...d];try{t.length>0?await W(`/files/batch`,{method:`PATCH`,body:JSON.stringify({fileIds:t,folderId:A||null})}):p?.id&&await W(`/files/${p.id}`,{method:`PATCH`,body:JSON.stringify({folderId:A||null})}),k(!1),j(``),ue(),ie(`File(s) moved successfully`),await re()}catch(e){ie(e instanceof Error?e.message:`Move failed`)}}async function he(){let e=[...d];try{e.length>0?await W(`/files/batch`,{method:`DELETE`,body:JSON.stringify({fileIds:e})}):p?.id&&await W(`/files/${p.id}`,{method:`DELETE`}),D(!1),ue(),ie(`Moved to trash`),await re(),window.dispatchEvent(new Event(`9drive:storage-changed`))}catch(e){ie(e instanceof Error?e.message:`Delete failed`)}}function ge(e){let t=e??p;t?.id&&(m(t),x(!0),g({x:0,y:0,file:null}))}async function _e(e){let t=e??p;if(t){try{let e=t.driveUrl;!e&&t.id&&(e=(await W(`/files/${t.id}/share`,{method:`POST`})).url),e&&(await navigator.clipboard.writeText(e),ie(`Google Drive link copied to clipboard!`))}catch(e){ie(`Failed to copy link: `+(e.message||e))}g({x:0,y:0,file:null})}}function ve(){F(``),L(``),ee(!1),N(!1)}let ye=p?Ps(p.mimeType):null;return(0,U.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 pb-1`,children:[(0,U.jsx)(`h1`,{className:`text-[22px] font-normal tracking-tight text-[#1F1F1F] dark:text-[#E3E3E3]`,children:ne(`nav.starred`,`Starred`)}),(0,U.jsx)(`div`,{className:`flex items-center gap-1.5`,children:(0,U.jsxs)(`div`,{className:`inline-flex items-center rounded-full border border-[#E0E3E7] dark:border-[#444746] bg-white dark:bg-[#1E1F20] p-0.5 shadow-xs`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>o(`list`),className:`flex h-8 w-8 items-center justify-center rounded-full transition-colors ${a===`list`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:hover:bg-[#282A2C]`}`,title:`List view`,children:(0,U.jsx)(ai,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>o(`grid`),className:`flex h-8 w-8 items-center justify-center rounded-full transition-colors ${a===`grid`?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`text-[#444746] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:hover:bg-[#282A2C]`}`,title:`Grid view`,children:(0,U.jsx)(ri,{className:`h-4 w-4`})})]})})]}),(0,U.jsx)(`div`,{className:`flex flex-wrap items-center gap-2 pb-2`,children:(0,U.jsx)(`div`,{className:`w-36`,children:(0,U.jsx)(ks,{variant:`chip`,value:s,onChange:c,options:[{value:`all`,label:ne(`filter.all`,`Type: All`)},{value:`docs`,label:ne(`filter.docs`,`Documents`)},{value:`images`,label:ne(`filter.images`,`Images`)},{value:`videos`,label:ne(`filter.videos`,`Videos`)},{value:`pdfs`,label:ne(`filter.pdfs`,`PDFs`)}]})})}),d.size>0&&(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl bg-[#C2E7FF]/50 px-4 py-2 text-sm text-[#001D35] dark:bg-[#004A77]/40 dark:text-[#C2E7FF]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsxs)(`span`,{className:`font-medium`,children:[d.size,` `,ne(`action.selected`,`selected`)]}),(0,U.jsx)(`button`,{type:`button`,onClick:ue,className:`text-xs underline hover:opacity-80`,children:ne(`action.clear_selection`,`Clear selection`)})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[d.size===1&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(G,{variant:`outline`,size:`sm`,onClick:()=>{let e=Array.from(d)[0],t=ae.find(t=>t.id===e);t&&ge(t)},className:`h-8 gap-1.5 rounded-full border-[#747775]/40 text-[#0B57D0] hover:bg-[#0B57D0]/10 hover:border-[#0B57D0] dark:border-[#747775]/60 dark:text-[#A8C7FA]`,children:[(0,U.jsx)(Ri,{className:`h-3.5 w-3.5`}),ne(`action.share`,`Share`)]}),(0,U.jsxs)(G,{variant:`outline`,size:`sm`,onClick:()=>{let e=Array.from(d)[0],t=ae.find(t=>t.id===e);t&&_e(t)},className:`h-8 gap-1.5 rounded-full border-[#747775]/40 text-[#444746] hover:bg-black/5 dark:border-[#747775]/60 dark:text-[#C4C7C5]`,children:[(0,U.jsx)(ii,{className:`h-3.5 w-3.5`}),ne(`action.copy_link`,`Copy link`)]})]}),(0,U.jsxs)(G,{variant:`ghost`,size:`sm`,onClick:()=>D(!0),className:`h-8 gap-1.5 text-xs text-[#B3261E] hover:bg-[#F9DEDC]/50 dark:text-[#F2B8B5]`,children:[(0,U.jsx)(Fi,{className:`h-3.5 w-3.5`}),ne(`action.delete`,`Move to trash`)]})]})]}),l?(0,U.jsx)(`div`,{className:`flex h-64 items-center justify-center`,children:(0,U.jsx)(`div`,{className:`h-8 w-8 animate-spin rounded-full border-2 border-[#0B57D0] border-t-transparent`})}):ae.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 text-center`,children:[(0,U.jsx)(`div`,{className:`flex h-24 w-24 items-center justify-center rounded-full bg-[#EDF2FC] dark:bg-[#1E1F20] text-[#FBBC04]`,children:(0,U.jsx)(Ni,{className:`h-10 w-10 stroke-[1.5] fill-[#FBBC04]`})}),(0,U.jsx)(`h2`,{className:`mt-5 text-lg font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:ne(`starred.empty_title`,`No starred files`)}),(0,U.jsx)(`p`,{className:`mt-1 max-w-sm text-sm text-[#747775] dark:text-[#8E918F]`,children:ne(`starred.empty_desc`,`Add stars to files that you want to easily find later.`)})]}):a===`list`?(0,U.jsx)(`div`,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] overflow-hidden`,children:(0,U.jsx)(gs,{files:ae,mode:`starred`,selectedFileIds:d,allSelected:se,onToggleFile:ce,onToggleAll:le,onFileContextMenu:de,onFileDoubleClick:fe,onShare:e=>ge(e)})}):(0,U.jsx)(ms,{files:ae,selectedFileIds:d,onToggleFile:ce,onFileContextMenu:de,onFileDoubleClick:fe,onShare:e=>ge(e)}),(0,U.jsx)(ds,{x:h.x,y:h.y,file:h.file,onClose:()=>g({x:0,y:0,file:null}),onView:()=>fe(),onDownload:()=>B(),onRename:()=>{T(p?.name??``),C(!0),g({x:0,y:0,file:null})},onMove:()=>{k(!0),g({x:0,y:0,file:null})},onDetails:()=>{y(!0),g({x:0,y:0,file:null})},onShare:()=>ge(),onCopyLink:()=>_e(),onDelete:()=>{D(!0),g({x:0,y:0,file:null})}}),(0,U.jsx)(ps,{open:_,file:p,onClose:()=>y(!1),onShare:e=>ge(e)}),(0,U.jsx)(os,{open:S,title:`Rename`,description:p?.name??``,onClose:()=>C(!1),children:(0,U.jsxs)(`form`,{onSubmit:pe,className:`grid gap-4`,children:[(0,U.jsx)(Os,{value:w,onChange:e=>T(e.target.value),required:!0,autoFocus:!0}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`ghost`,onClick:()=>C(!1),children:`Cancel`}),(0,U.jsx)(G,{children:`OK`})]})]})}),(0,U.jsx)(os,{open:O,title:`Move`,description:d.size>0?`Move ${d.size} files`:p?.name??``,onClose:()=>k(!1),children:(0,U.jsxs)(`form`,{onSubmit:me,className:`grid gap-4`,children:[(0,U.jsx)(ks,{variant:`default`,value:A,onChange:j,options:[{value:``,label:`My Drive (Root)`},...r.map(e=>({value:e.id??``,label:e.name}))]}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`ghost`,onClick:()=>k(!1),children:`Cancel`}),(0,U.jsx)(G,{children:`Move here`})]})]})}),(0,U.jsx)(os,{open:E,title:`Move to trash?`,description:d.size>0?`Delete ${d.size} files from Google Drive?`:`Delete "${p?.name??`file`}"?`,onClose:()=>D(!1),children:(0,U.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,U.jsx)(G,{variant:`ghost`,onClick:()=>D(!1),children:`Cancel`}),(0,U.jsx)(G,{variant:`danger`,onClick:he,children:`Move to trash`})]})}),(0,U.jsx)(ss,{open:b,file:p,onClose:()=>x(!1)}),(0,U.jsx)(os,{open:M,title:`File Preview`,description:p?.name??``,onClose:ve,className:`overflow-hidden sm:max-w-[95vw] xl:max-w-[1400px]`,children:(0,U.jsxs)(`div`,{className:`flex h-[72dvh] w-full items-center justify-center overflow-hidden rounded-xl border border-[#E0E3E7] bg-[#F8FAFD] dark:border-[#36373A] dark:bg-[#131314] sm:h-[80vh]`,children:[R?(0,U.jsx)(`div`,{className:`p-6 text-center text-sm font-semibold text-[#747775] dark:text-[#8E918F]`,children:`Loading preview...`}):null,I?(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,children:[(0,U.jsx)(`p`,{className:`text-sm text-red-600 dark:text-red-400`,children:I}),p?.driveUrl?(0,U.jsxs)(G,{variant:`outline`,onClick:()=>window.open(p.driveUrl,`_blank`),children:[(0,U.jsx)(zr,{className:`mr-2 h-4 w-4`}),` Open in Google Drive`]}):null]}):null,!R&&!I&&ye===`image`&&P?(0,U.jsx)(`img`,{src:P,alt:p?.name??`File preview`,className:`max-h-full max-w-full object-contain`,onError:()=>L(`Failed to load preview.`)}):null,!R&&!I&&ye===`video`&&P?(0,U.jsx)(`div`,{className:`shared-video-shell`,children:(0,U.jsx)(`video`,{controls:!0,playsInline:!0,preload:`metadata`,onError:()=>L(`Failed to load preview.`),children:(0,U.jsx)(`source`,{src:P,type:p?.mimeType})})}):null,!R&&!I&&ye===`document`&&P?(0,U.jsx)(`iframe`,{src:P,title:p?.name??`File preview`,className:`h-full w-full border-0 bg-white dark:bg-[#1E1F20]`}):null,!R&&!I&&ye===`office`&&P?(0,U.jsx)(`iframe`,{src:Fs(P),title:p?.name??`File preview`,className:`h-full w-full border-0 bg-white dark:bg-[#1E1F20]`}):null,!R&&!I&&!ye?(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center text-sm text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(`p`,{children:`Preview not available directly in app for this file type.`}),p?.driveUrl?(0,U.jsxs)(G,{onClick:()=>window.open(p.driveUrl,`_blank`),children:[(0,U.jsx)(zr,{className:`mr-2 h-4 w-4`}),` Open in Google Drive`]}):(0,U.jsx)(G,{onClick:()=>B(p??void 0),children:`Download file`})]}):null]})})]})}function yc(e){return e.startsWith(`image/`)?`image`:e.startsWith(`video/`)?`video`:e.includes(`pdf`)?`pdf`:`doc`}function bc({file:e,downloadUrl:t}){return(0,U.jsxs)(`div`,{className:`flex h-full min-h-[360px] flex-col items-center justify-center px-6 text-center text-[#C4C7C5]`,children:[(0,U.jsx)(`div`,{className:`flex h-20 w-20 items-center justify-center rounded-full bg-[#1E1F20] text-[#E3E3E3] border border-[#36373A]`,children:(0,U.jsx)(Vr,{className:`h-9 w-9 stroke-[1.5]`})}),(0,U.jsx)(`h2`,{className:`mt-5 text-lg font-medium text-white`,children:`Preview not available`}),(0,U.jsxs)(`p`,{className:`mt-1.5 max-w-sm text-xs text-[#8E918F]`,children:[e.name,` cannot be previewed in the browser. Download the file to open it locally.`]}),(0,U.jsx)(`a`,{href:t,download:!0,className:`mt-6`,children:(0,U.jsxs)(G,{className:`rounded-full px-5`,children:[(0,U.jsx)(Lr,{className:`h-4 w-4`}),`Download`]})})]})}function xc({embed:e=!1}){let{token:t}=ot(),[n,r]=(0,v.useState)(null),[i,a]=(0,v.useState)(!1),o=(0,v.useRef)(null),s=`/public/files/${t}/preview`,c=`/public/files/${t}/download`,l=Ps(n?.mimeType);if((0,v.useEffect)(()=>{a(!1),W(`/public/files/${t}`,{skipAuth:!0}).then(e=>r(e.file)).catch(()=>{r(null),a(!0)})},[t]),(0,v.useEffect)(()=>(document.title=n?`${n.name} - Google Drive`:`Google Drive`,()=>{document.title=`Google Drive - 9Drive`}),[n]),(0,v.useEffect)(()=>{if(l!==`video`||!o.current)return;let e=!1,t=null;return As().then(()=>{e||!o.current||(t=js(o.current))}).catch(()=>void 0),()=>{e=!0,t?.destroy()}},[l,s]),i)return(0,U.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-[#131314] p-6 text-white`,children:(0,U.jsxs)(`div`,{className:`max-w-md rounded-2xl border border-[#36373A] bg-[#1E1F20] p-8 text-center shadow-lg`,children:[(0,U.jsx)(Vr,{className:`mx-auto h-12 w-12 text-[#8E918F] stroke-[1.5]`}),(0,U.jsx)(`h1`,{className:`mt-4 text-xl font-normal text-[#E3E3E3]`,children:`Shared file not found`}),(0,U.jsx)(`p`,{className:`mt-1.5 text-xs text-[#8E918F]`,children:`The link may be expired, revoked, or the file was deleted.`})]})});if(!n)return(0,U.jsx)(`main`,{className:`flex min-h-screen items-center justify-center bg-[#131314] text-xs text-[#8E918F]`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`div`,{className:`h-4 w-4 animate-spin rounded-full border-2 border-[#A8C7FA] border-t-transparent`}),(0,U.jsx)(`span`,{children:`Loading shared file...`})]})});let u=(0,U.jsxs)(`div`,{className:`flex h-full w-full items-center justify-center`,children:[l===`image`?(0,U.jsx)(`img`,{src:s,alt:n.name,className:`max-h-full max-w-full object-contain`}):null,l===`video`?(0,U.jsx)(`div`,{className:`shared-video-shell w-full max-w-4xl max-h-full flex items-center justify-center`,children:(0,U.jsx)(`video`,{ref:o,controls:!0,playsInline:!0,preload:`metadata`,children:(0,U.jsx)(`source`,{src:s,type:n.mimeType})})}):null,l===`document`?(0,U.jsx)(`iframe`,{src:s,title:n.name,className:`h-full w-full border-0 bg-white`}):null,l===`office`?(0,U.jsx)(`iframe`,{src:Fs(s),title:n.name,className:`h-full w-full border-0 bg-white`}):null,l?null:(0,U.jsx)(bc,{file:n,downloadUrl:c})]});return e?(0,U.jsx)(`main`,{className:`h-screen overflow-hidden bg-black text-white`,children:u}):(0,U.jsxs)(`main`,{className:`min-h-screen overflow-hidden bg-[#131314] text-white flex flex-col`,children:[(0,U.jsxs)(`header`,{className:`flex h-14 shrink-0 items-center justify-between border-b border-[#36373A] bg-[#1E1F20] px-4 sm:px-6 z-20`,children:[(0,U.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[(0,U.jsx)(Io,{kind:yc(n.mimeType),className:`h-6 w-6 shrink-0`}),(0,U.jsxs)(`div`,{className:`min-w-0`,children:[(0,U.jsx)(`h1`,{className:`truncate text-sm font-medium text-[#E3E3E3]`,children:n.name}),(0,U.jsxs)(`p`,{className:`truncate text-[11px] text-[#8E918F]`,children:[wo(n.sizeBytes),` · Uploaded `,To(n.createdAt)]})]})]}),(0,U.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[(0,U.jsx)(`a`,{href:`/public/files/${t}/embed`,target:`_blank`,rel:`noreferrer`,className:`hidden sm:block`,children:(0,U.jsxs)(G,{variant:`ghost`,size:`sm`,className:`rounded-full text-xs text-[#C4C7C5] hover:bg-[#282A2C] hover:text-white`,children:[(0,U.jsx)(zr,{className:`h-3.5 w-3.5`}),`Embed`]})}),(0,U.jsx)(`a`,{href:c,download:!0,children:(0,U.jsxs)(G,{size:`sm`,className:`rounded-full px-4 text-xs font-medium bg-[#A8C7FA] hover:bg-[#8AB4F8] text-[#001D35]`,children:[(0,U.jsx)(Lr,{className:`h-3.5 w-3.5`}),`Download`]})})]})]}),(0,U.jsx)(`section`,{className:`flex flex-1 items-center justify-center p-2 sm:p-6 overflow-hidden`,children:(0,U.jsx)(`div`,{className:`relative h-full w-full overflow-hidden rounded-xl border border-[#36373A] bg-[#0E0E0E] flex items-center justify-center`,children:u})})]})}function Sc(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(``),[c,l]=(0,v.useState)(``),{toast:u}=as(),{t:d}=Fo(),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(`curl`),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(!1);async function C(){t((await W(`/api-keys`)).apiKeys)}(0,v.useEffect)(()=>{C().catch(e=>u.error(e instanceof Error?e.message:`Failed to load API keys`))},[]);async function w(e){if(e.preventDefault(),o.trim()){p(!0);try{l((await W(`/api-keys`,{method:`POST`,body:JSON.stringify({name:o.trim()})})).secret),s(``),u.success(`API key created successfully.`),await C()}catch(e){u.error(e instanceof Error?e.message:`Failed to create API key`)}finally{p(!1)}}}async function T(e){let n=e.status===`active`?`revoked`:`active`;t(t=>t.map(t=>t.id===e.id?{...t,status:n}:t));try{await W(`/api-keys/${e.id}/status`,{method:`PATCH`,body:JSON.stringify({status:n})}),u.success(n===`active`?`API key activated.`:`API key revoked/paused.`),await C()}catch(n){t(t=>t.map(t=>t.id===e.id?{...t,status:e.status}:t)),u.error(n instanceof Error?n.message:`Failed to update API key status`)}}async function E(){if(!y)return;let n=y;b(null),S(!0);let r=e;t(e=>e.filter(e=>e.id!==n.id));try{await W(`/api-keys/${n.id}`,{method:`DELETE`}),u.success(`API key deleted successfully.`),await C()}catch(e){t(r),u.error(e instanceof Error?e.message:`Failed to delete API key`)}finally{S(!1)}}function D(e,t=`Copied to clipboard`){navigator.clipboard.writeText(e).then(()=>u.success(t)).catch(()=>u.error(`Failed to copy.`))}let O={curl:{title:`cURL`,lang:`bash`,code:`curl -X POST "/api/v1/uploads" \\
|
|
13
|
+
-H "x-api-key: 9d_live_YOUR_KEY" \\
|
|
14
|
+
-F "file=@foto-produk.png"`},js:{title:`JavaScript (Fetch)`,lang:`javascript`,code:`const form = new FormData()
|
|
15
|
+
form.append('file', fileInput.files[0])
|
|
16
|
+
|
|
17
|
+
const res = await fetch('/api/v1/uploads', {
|
|
18
|
+
method: 'POST',
|
|
19
|
+
headers: { 'x-api-key': '9d_live_YOUR_KEY' },
|
|
20
|
+
body: form,
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
const { file } = await res.json()
|
|
24
|
+
console.log('CDN View URL:', file.url)
|
|
25
|
+
// -> /cdn/view/\${file.id}`},response:{title:`JSON Response`,lang:`json`,code:`{
|
|
26
|
+
"success": true,
|
|
27
|
+
"file": {
|
|
28
|
+
"id": "829bd3e0-c6e4-4840-b85b-24599fb4b251",
|
|
29
|
+
"name": "foto-produk.png",
|
|
30
|
+
"mimeType": "image/png",
|
|
31
|
+
"size": 1048576,
|
|
32
|
+
"url": "/cdn/view/829bd3e0-c6e4-4840-b85b-24599fb4b251",
|
|
33
|
+
"downloadUrl": "/cdn/raw/829bd3e0-c6e4-4840-b85b-24599fb4b251"
|
|
34
|
+
}
|
|
35
|
+
}`},html:{title:`HTML <img> Embed`,lang:`html`,code:`<!-- Fast cached CDN image delivery -->
|
|
36
|
+
<img
|
|
37
|
+
src="/cdn/view/829bd3e0-c6e4-4840-b85b-24599fb4b251"
|
|
38
|
+
alt="Foto Produk"
|
|
39
|
+
loading="lazy"
|
|
40
|
+
/>`}},k=O[m];function A(){D(k.code,`${k.title} copied!`),_(!0),setTimeout(()=>_(!1),2e3)}let j=`NINEDRIVE_URL=/api/v1/uploads`;return(0,U.jsxs)(`div`,{className:`flex flex-col min-h-full w-full min-w-0`,children:[(0,U.jsx)(Zs,{title:d(`api_keys.title`,`API Keys`),description:d(`api_keys.desc`,`Manage API keys for your applications. Use your keys to authenticate external uploads and deliver media through the local CDN gateway.`),actions:(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsxs)(G,{variant:`outline`,size:`sm`,className:`rounded-full h-8 px-3.5 text-xs font-medium gap-1.5 border-[#E0E3E7] dark:border-[#36373A]`,onClick:()=>a(!0),children:[(0,U.jsx)(br,{className:`h-3.5 w-3.5 text-[#747775] dark:text-[#8E918F]`}),(0,U.jsx)(`span`,{children:d(`api_keys.docs_btn`,`Documentation`)})]}),(0,U.jsxs)(G,{size:`sm`,className:`rounded-full h-8 px-3.5 text-xs font-medium gap-1.5 bg-[#0B57D0] hover:bg-[#0B57D0]/90 text-white`,onClick:()=>r(!0),children:[(0,U.jsx)(xi,{className:`h-4 w-4`}),(0,U.jsx)(`span`,{children:d(`api_keys.generate_btn`,`Generate New Key`)})]})]})}),(0,U.jsxs)(`div`,{className:`flex flex-col gap-4 mt-4`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`p`,{className:`text-xs font-medium text-[#747775] dark:text-[#8E918F] mb-1.5`,children:d(`api_keys.env_var`,`API environment variable`)}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between rounded-xl border border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#18191A] px-3.5 py-2.5`,children:[(0,U.jsx)(`code`,{className:`font-mono text-xs text-[#1F1F1F] dark:text-[#E3E3E3] truncate`,children:j}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>D(j,`Environment variable copied!`),className:`text-[#747775] hover:text-[#0B57D0] dark:hover:text-[#A8C7FA] p-1 transition-colors`,title:`Copy variable`,children:(0,U.jsx)(Nr,{className:`h-4 w-4`})})]})]}),(0,U.jsxs)(`div`,{className:`rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] overflow-hidden shadow-xs`,children:[(0,U.jsx)(`div`,{className:`overflow-x-auto`,children:(0,U.jsxs)(`table`,{className:`w-full text-left text-xs`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`border-b border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD]/50 dark:bg-[#18191A]/50 text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(`th`,{className:`py-3 px-4 font-medium`,children:d(`api_keys.table_name`,`Key Name`)}),(0,U.jsx)(`th`,{className:`py-3 px-4 font-medium`,children:d(`api_keys.table_created`,`Date Created`)}),(0,U.jsx)(`th`,{className:`py-3 px-4 font-medium`,children:d(`api_keys.table_prefix`,`API Key (Prefix)`)}),(0,U.jsx)(`th`,{className:`py-3 px-4 font-medium`,children:d(`api_keys.table_secret`,`API Secret`)}),(0,U.jsx)(`th`,{className:`py-3 px-4 font-medium`,children:d(`api_keys.table_status`,`Status`)}),(0,U.jsx)(`th`,{className:`py-3 px-4 font-medium text-right`,children:d(`api_keys.table_actions`,`Actions`)})]})}),(0,U.jsx)(`tbody`,{className:`divide-y divide-[#E0E3E7]/60 dark:divide-[#36373A]/60`,children:e.length===0?(0,U.jsx)(`tr`,{children:(0,U.jsxs)(`td`,{colSpan:6,className:`py-12 text-center text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(ti,{className:`mx-auto h-8 w-8 opacity-40 mb-2`}),(0,U.jsx)(`p`,{className:`text-sm font-medium`,children:d(`api_keys.empty_title`,`No API keys generated yet`)}),(0,U.jsx)(`p`,{className:`text-xs mt-0.5`,children:d(`api_keys.empty_desc`,`Click "Generate New Key" above to create one.`)})]})}):e.map(e=>{let t=e.status===`active`;return(0,U.jsxs)(`tr`,{className:`hover:bg-black/[0.015] dark:hover:bg-white/[0.015] transition-colors`,children:[(0,U.jsx)(`td`,{className:`py-3.5 px-4 font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{children:e.name}),e.name.toLowerCase().includes(`default`)&&(0,U.jsx)(`span`,{className:`text-[10px] rounded bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400 px-1.5 py-0.5`,children:`Default`})]})}),(0,U.jsx)(`td`,{className:`py-3.5 px-4 text-[#747775] dark:text-[#8E918F]`,children:To(e.createdAt)}),(0,U.jsx)(`td`,{className:`py-3.5 px-4 font-mono text-[#1F1F1F] dark:text-[#E3E3E3]`,children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>D(e.keyPrefix,`Key prefix copied!`),className:`inline-flex items-center gap-1 hover:text-[#0B57D0] dark:hover:text-[#A8C7FA]`,title:`Click to copy prefix`,children:[(0,U.jsxs)(`span`,{children:[e.keyPrefix,`...`]}),(0,U.jsx)(Nr,{className:`h-3 w-3 opacity-50`})]})}),(0,U.jsx)(`td`,{className:`py-3.5 px-4 font-mono text-[#747775] dark:text-[#8E918F] tracking-wider text-xs`,children:`••••••••••••••••••••`}),(0,U.jsx)(`td`,{className:`py-3.5 px-4`,children:(0,U.jsxs)(`button`,{type:`button`,onClick:()=>T(e),className:`inline-flex items-center gap-2 select-none cursor-pointer`,title:t?`Click to pause/revoke`:`Click to activate`,children:[(0,U.jsx)(`div`,{className:`relative inline-flex h-4 w-7 shrink-0 rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out ${t?`bg-emerald-500`:`bg-gray-300 dark:bg-gray-700`}`,children:(0,U.jsx)(`span`,{className:`pointer-events-none inline-block h-3 w-3 transform rounded-full bg-white shadow-xs transition duration-200 ease-in-out ${t?`translate-x-3`:`translate-x-0`}`})}),(0,U.jsx)(`span`,{className:`text-xs font-medium ${t?`text-emerald-600 dark:text-emerald-400`:`text-[#747775]`}`,children:t?`Active`:`Revoked`})]})}),(0,U.jsx)(`td`,{className:`py-3.5 px-4 text-right`,children:(0,U.jsx)(`button`,{type:`button`,onClick:()=>b(e),className:`p-1.5 rounded-lg text-[#747775] hover:text-rose-600 hover:bg-rose-50 dark:hover:bg-rose-950/30 transition-colors`,title:`Delete API Key`,children:(0,U.jsx)(Fi,{className:`h-4 w-4`})})})]},e.id)})})]})}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-t border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD]/30 dark:bg-[#18191A]/30 text-xs text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsxs)(`span`,{children:[`Total: `,e.length,` key`,e.length===1?``:`s`]}),(0,U.jsx)(`span`,{children:`Page 1 of 1`})]})]})]}),(0,U.jsx)(os,{open:!!y,title:`Delete API Key`,description:`This action cannot be undone.`,onClose:()=>b(null),className:`sm:max-w-md`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`p`,{className:`text-xs text-[#444746] dark:text-[#C4C7C5] leading-relaxed`,children:[`Are you sure you want to permanently delete API key`,` `,(0,U.jsxs)(`span`,{className:`font-semibold text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[`"`,y?.name,`"`]}),`? Any external applications or web platforms using this key will immediately lose access.`]}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2 pt-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-full h-8 px-4 text-xs font-medium`,onClick:()=>b(null),disabled:x,children:`Cancel`}),(0,U.jsx)(G,{type:`button`,size:`sm`,className:`rounded-full h-8 px-4 text-xs font-medium bg-rose-600 hover:bg-rose-700 text-white`,onClick:E,disabled:x,children:x?`Deleting...`:`Delete Key`})]})]})}),(0,U.jsx)(os,{open:n,title:c?`API Key Secret`:`Generate New API Key`,description:c?`Save this key now. For your security, it will never be displayed again.`:`Enter a descriptive label to identify this key.`,onClose:()=>{r(!1),l(``),s(``)},children:c?(0,U.jsxs)(`div`,{className:`grid gap-4 mt-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`code`,{className:`flex-1 overflow-x-auto rounded-xl bg-black/5 dark:bg-black/40 border border-[#E0E3E7] dark:border-[#36373A] px-3.5 py-2.5 text-xs font-mono text-emerald-700 dark:text-emerald-300`,children:c}),(0,U.jsxs)(G,{size:`sm`,className:`rounded-full h-9 px-3 text-xs gap-1 shrink-0`,onClick:()=>D(c,`Secret key copied!`),children:[(0,U.jsx)(Nr,{className:`h-3.5 w-3.5`}),`Copy`]})]}),(0,U.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,U.jsx)(G,{size:`sm`,className:`rounded-full h-8 px-5 text-xs font-medium`,onClick:()=>{r(!1),l(``)},children:`Done`})})]}):(0,U.jsxs)(`form`,{className:`grid gap-4 mt-2`,onSubmit:w,children:[(0,U.jsx)(`input`,{className:`h-10 rounded-xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] px-3.5 text-xs text-[#1F1F1F] dark:text-[#E3E3E3] placeholder:text-[#747775] focus:border-[#0B57D0] focus:outline-none focus:ring-1 focus:ring-[#0B57D0]`,placeholder:`Key Name (e.g. Production Store, Blog Sync)`,value:o,onChange:e=>s(e.target.value),required:!0,autoFocus:!0}),(0,U.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-full h-8 px-4 text-xs font-medium`,onClick:()=>r(!1),children:`Cancel`}),(0,U.jsx)(G,{type:`submit`,size:`sm`,className:`rounded-full h-8 px-4 text-xs font-medium bg-[#0B57D0] text-white hover:bg-[#0B57D0]/90`,disabled:f||!o.trim(),children:f?`Generating...`:`Generate Key`})]})]})}),(0,U.jsx)(os,{open:i,title:`Developer API & Code Examples`,description:`Integrate 9Drive object storage directly with standard HTTP requests.`,onClose:()=>a(!1),className:`sm:max-w-2xl`,children:(0,U.jsxs)(`div`,{className:`flex flex-col gap-4 text-xs`,children:[(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2 text-xs`,children:[(0,U.jsxs)(`div`,{className:`rounded-xl border border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#18191A] p-2.5`,children:[(0,U.jsx)(`span`,{className:`font-bold text-indigo-600 dark:text-indigo-400`,children:`POST`}),` `,(0,U.jsxs)(`span`,{className:`font-mono text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[``,`/api/v1/uploads`]}),(0,U.jsxs)(`p`,{className:`text-[10px] text-[#747775] dark:text-[#8E918F] mt-1`,children:[`Upload endpoint (requires `,(0,U.jsx)(`code`,{className:`font-mono`,children:`x-api-key`}),`)`]})]}),(0,U.jsxs)(`div`,{className:`rounded-xl border border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#18191A] p-2.5`,children:[(0,U.jsx)(`span`,{className:`font-bold text-emerald-600 dark:text-emerald-400`,children:`GET`}),` `,(0,U.jsxs)(`span`,{className:`font-mono text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[``,`/cdn/view/:id`]}),(0,U.jsx)(`p`,{className:`text-[10px] text-[#747775] dark:text-[#8E918F] mt-1`,children:`Direct CDN delivery (1-year cache & open CORS)`})]})]}),(0,U.jsxs)(`div`,{className:`rounded-xl overflow-hidden border border-[#36373A] bg-[#121314] text-[#E3E3E3] shadow-sm`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between border-b border-[#28292A] bg-[#1A1B1C] px-3 py-2`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-1`,children:[`curl`,`js`,`response`,`html`].map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>h(e),className:`px-2.5 py-1 rounded-md text-[11px] font-medium transition-colors ${m===e?`bg-[#2C2D2F] text-white shadow-xs`:`text-[#8E918F] hover:text-[#E3E3E3]`}`,children:O[e].title},e))}),(0,U.jsx)(`button`,{type:`button`,onClick:A,className:`inline-flex items-center gap-1 text-[11px] text-[#A8C7FA] hover:text-white transition-colors p-1`,children:g?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(xr,{className:`h-3 w-3 text-emerald-400`}),(0,U.jsx)(`span`,{className:`text-emerald-400`,children:`Copied`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Nr,{className:`h-3 w-3`}),(0,U.jsx)(`span`,{children:`Copy`})]})})]}),(0,U.jsx)(`pre`,{className:`p-3.5 font-mono text-xs leading-relaxed overflow-x-auto max-h-72`,children:(0,U.jsx)(`code`,{children:k.code})})]}),(0,U.jsx)(`div`,{className:`flex justify-end pt-2`,children:(0,U.jsx)(G,{size:`sm`,className:`rounded-full h-8 px-4 text-xs font-medium`,onClick:()=>a(!1),children:`Close`})})]})})]})}function Cc(){let{selectedAccountId:e}=Ao(),{language:t,t:n}=Fo(),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(new Set),[s,c]=(0,v.useState)(!1),{toast:l}=as();async function u(){c(!0);try{i((await W(e&&e!==`all`?`/files/trash?accountId=${e}`:`/files/trash`)).files)}catch(e){l.error(e instanceof Error?e.message:`Failed to load trash`)}finally{c(!1)}}(0,v.useEffect)(()=>{u().catch(()=>void 0)},[e]);function d(e){let t=new Set(a);t.has(e)?t.delete(e):t.add(e),o(t)}function f(){a.size===r.length?o(new Set):o(new Set(r.map(e=>e.id)))}async function p(e){if(e.length!==0){c(!0);try{await W(`/files/batch/restore`,{method:`POST`,body:JSON.stringify({fileIds:e})}),i(t=>t.filter(t=>!e.includes(t.id))),o(t=>{let n=new Set(t);return e.forEach(e=>n.delete(e)),n}),l.success(t===`id`?`Memulihkan ${e.length} item ke Drive Saya.`:`Restored ${e.length} item(s) to My Drive.`),window.dispatchEvent(new Event(`9drive:storage-changed`))}catch(e){l.error(e instanceof Error?e.message:`Failed to restore files`)}finally{c(!1)}}}async function m(e){if(e.length!==0&&confirm(t===`id`?`Yakin ingin menghapus ${e.length} file selamanya? Tindakan ini tidak dapat dibatalkan.`:`Are you sure you want to delete ${e.length} file(s) forever? This action cannot be undone.`)){c(!0);try{await W(`/files/batch/permanent`,{method:`DELETE`,body:JSON.stringify({fileIds:e})}),i(t=>t.filter(t=>!e.includes(t.id))),o(t=>{let n=new Set(t);return e.forEach(e=>n.delete(e)),n}),l.success(t===`id`?`Menghapus ${e.length} item selamanya.`:`Deleted ${e.length} item(s) forever.`),window.dispatchEvent(new Event(`9drive:storage-changed`))}catch(e){l.error(e instanceof Error?e.message:`Failed to delete files`)}finally{c(!1)}}}async function h(){r.length!==0&&confirm(t===`id`?`Kosongkan sampah? Semua item di sampah akan dihapus selamanya.`:`Empty trash? All items in trash will be deleted forever.`)&&await m(r.map(e=>e.id))}return(0,U.jsxs)(`div`,{className:`flex flex-col min-h-full w-full min-w-0`,children:[(0,U.jsx)(Zs,{title:n(`trash.title`,`Trash`),actions:r.length>0?(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:a.size>0?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(G,{size:`sm`,variant:`outline`,onClick:()=>p(Array.from(a)),disabled:s,children:[(0,U.jsx)(Ci,{className:`h-4 w-4`}),` `,n(`trash.restore`,`Restore`),` (`,a.size,`)`]}),(0,U.jsxs)(G,{size:`sm`,variant:`danger`,onClick:()=>m(Array.from(a)),disabled:s,children:[(0,U.jsx)(Fi,{className:`h-4 w-4`}),` `,n(`trash.delete_forever`,`Delete forever`),` (`,a.size,`)`]})]}):(0,U.jsx)(G,{size:`sm`,variant:`ghost`,onClick:h,disabled:s,children:n(`trash.empty_trash`,`Empty trash`)})}):null}),(0,U.jsx)(`div`,{className:`mt-3 rounded-lg bg-[#EDF2FC] px-4 py-2.5 text-xs text-[#444746] dark:bg-[#28292A] dark:text-[#C4C7C5]`,children:n(`trash.info_bar`,`Items in trash are deleted forever after 30 days.`)}),r.length===0?(0,U.jsxs)(`div`,{className:`flex flex-1 flex-col items-center justify-center py-20 px-4 text-center select-none`,children:[(0,U.jsx)(`div`,{className:`flex h-24 w-24 items-center justify-center rounded-full bg-[#EDF2FC] dark:bg-[#28292A] text-[#747775] dark:text-[#8E918F] mb-4`,children:(0,U.jsx)(Fi,{className:`h-12 w-12 stroke-[1.2]`})}),(0,U.jsx)(`h3`,{className:`text-lg font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:n(`trash.empty_title`,`Trash is empty`)}),(0,U.jsx)(`p`,{className:`mt-1 text-xs text-[#747775] dark:text-[#8E918F]`,children:n(`trash.empty_desc`,`Items moved to the trash will show up here.`)})]}):(0,U.jsx)(`div`,{className:`mt-4 overflow-x-auto select-none`,children:(0,U.jsxs)(`table`,{className:`w-full text-left border-collapse text-sm`,children:[(0,U.jsx)(`thead`,{children:(0,U.jsxs)(`tr`,{className:`border-b border-[#E0E3E7] text-[13px] font-medium text-[#444746] dark:border-[#36373A] dark:text-[#C4C7C5]`,children:[(0,U.jsx)(`th`,{className:`py-2.5 pl-3 w-10`,children:(0,U.jsx)(`input`,{type:`checkbox`,checked:a.size===r.length&&r.length>0,onChange:f,className:`h-4 w-4 rounded accent-[#0B57D0] cursor-pointer`})}),(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:n(`table.name`,`Name`)}),(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:n(`trash.storage_account`,`Storage account`)}),(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:n(`trash.original_size`,`Original size`)}),(0,U.jsx)(`th`,{className:`py-2.5 font-medium`,children:n(`trash.date_trashed`,`Date trashed`)}),(0,U.jsx)(`th`,{className:`py-2.5 pr-3 text-right`,children:n(`trash.actions`,`Actions`)})]})}),(0,U.jsx)(`tbody`,{children:r.map(e=>{let t=a.has(e.id);return(0,U.jsxs)(`tr`,{onClick:()=>d(e.id),className:xo(`group h-12 border-b transition-colors cursor-pointer`,t?`bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7]/60 hover:bg-[#F0F4F9] dark:border-[#36373A]/60 dark:hover:bg-[#28292A]`),children:[(0,U.jsx)(`td`,{className:`py-2 pl-3`,children:(0,U.jsx)(`input`,{type:`checkbox`,checked:t,onChange:()=>d(e.id),onClick:e=>e.stopPropagation(),className:`h-4 w-4 rounded accent-[#0B57D0] cursor-pointer`})}),(0,U.jsx)(`td`,{className:`py-2`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(Io,{kind:e.mimeType.split(`/`)[0],className:`h-5 w-5 shrink-0`}),(0,U.jsx)(`span`,{className:xo(`truncate max-w-xs sm:max-w-md font-normal text-sm`,t?`text-[#001D35] dark:text-[#C2E7FF]`:`text-[#1F1F1F] dark:text-[#E3E3E3]`),title:e.name,children:e.name})]})}),(0,U.jsx)(`td`,{className:`py-2 text-xs text-[#444746] dark:text-[#C4C7C5]`,children:e.connectedAccount.email}),(0,U.jsx)(`td`,{className:`py-2 text-xs text-[#444746] dark:text-[#C4C7C5]`,children:wo(e.sizeBytes)}),(0,U.jsx)(`td`,{className:`py-2 text-xs text-[#444746] dark:text-[#C4C7C5]`,children:new Intl.DateTimeFormat(`en`,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(e.deletedAt))}),(0,U.jsx)(`td`,{className:`py-2 pr-3 text-right`,children:(0,U.jsxs)(`div`,{className:`flex items-center justify-end gap-1`,children:[(0,U.jsx)(`button`,{type:`button`,className:`flex h-8 w-8 items-center justify-center rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,onClick:t=>{t.stopPropagation(),p([e.id])},disabled:s,title:n(`trash.restore`,`Restore`),children:(0,U.jsx)(Ci,{className:`h-4 w-4`})}),(0,U.jsx)(`button`,{type:`button`,className:`flex h-8 w-8 items-center justify-center rounded-full text-[#B3261E] hover:bg-[#F9DEDC]/50 dark:hover:bg-[#8C1D18]/30`,onClick:t=>{t.stopPropagation(),m([e.id])},disabled:s,title:n(`trash.delete_forever`,`Delete forever`),children:(0,U.jsx)(Fi,{className:`h-4 w-4`})})]})})]},e.id)})})]})})]})}function wc(){let[e,t]=(0,v.useState)([]),[n,r]=(0,v.useState)(!1),[i,a]=(0,v.useState)(``),{t:o}=Fo();async function s(){r(!0),a(``);try{t((await W(`/audit-logs`)).logs)}catch(e){a(e instanceof Error?e.message:`Failed to load activity logs`)}finally{r(!1)}}(0,v.useEffect)(()=>{s().catch(()=>void 0)},[]);function c(e){let t=e.toUpperCase();return t.includes(`CREATE`)||t.includes(`UPLOAD`)?{bg:`bg-[#E6F4EA] text-[#137333] dark:bg-[#0F5223]/30 dark:text-[#81C995]`,icon:xi,label:e.replace(/_/g,` `)}:t.includes(`DELETE`)||t.includes(`PERMANENT`)||t.includes(`TRASH`)?{bg:`bg-[#FCE8E6] text-[#C5221F] dark:bg-[#8C1D18]/30 dark:text-[#F28B82]`,icon:Fi,label:e.replace(/_/g,` `)}:t.includes(`RESTORE`)||t.includes(`SYNC`)?{bg:`bg-[#FEF7E0] text-[#B06000] dark:bg-[#724300]/30 dark:text-[#FDD663]`,icon:Si,label:e.replace(/_/g,` `)}:t.includes(`MOVE`)?{bg:`bg-[#E8F0FE] text-[#1A73E8] dark:bg-[#174EA6]/30 dark:text-[#8AB4F8]`,icon:hi,label:e.replace(/_/g,` `)}:t.includes(`DOWNLOAD`)?{bg:`bg-[#E8F0FE] text-[#1A73E8] dark:bg-[#174EA6]/30 dark:text-[#8AB4F8]`,icon:Lr,label:e.replace(/_/g,` `)}:{bg:`bg-[#F1F3F4] text-[#3C4043] dark:bg-[#303134] dark:text-[#BDC1C6]`,icon:Qr,label:e.replace(/_/g,` `)}}function l(e){if(!e)return null;let t=e;if(typeof e==`string`)try{t=JSON.parse(e)}catch{return(0,U.jsx)(`span`,{className:`text-[#747775] dark:text-[#8E918F]`,children:e})}if(typeof t!=`object`)return(0,U.jsx)(`span`,{className:`text-[#747775] dark:text-[#8E918F]`,children:String(t)});let n=[];if(t.name&&n.push(`Name: ${t.name}`),t.fileName&&n.push(`File: ${t.fileName}`),t.folderName&&n.push(`Folder: ${t.folderName}`),t.count!==void 0&&n.push(`Count: ${t.count}`),t.sizeBytes!==void 0){let e=Number(t.sizeBytes);n.push(`Size: ${u(e)}`)}return n.length>0?(0,U.jsx)(`span`,{className:`text-xs text-[#747775] dark:text-[#8E918F] font-medium`,children:n.join(` · `)}):(0,U.jsx)(`span`,{className:`text-xs text-[#747775] dark:text-[#8E918F] font-mono`,children:JSON.stringify(t)})}function u(e){if(e===0)return`0 B`;let t=1024,n=[`B`,`KB`,`MB`,`GB`,`TB`],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/t**r).toFixed(2))+` `+n[r]}return(0,U.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 pb-1`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h1`,{className:`text-[22px] font-normal tracking-tight text-[#1F1F1F] dark:text-[#E3E3E3]`,children:o(`activity.title`,`Activity Log`)}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mt-0.5`,children:o(`activity.desc`,`Audit trail of file activities, moves, syncs, and deletions.`)})]}),(0,U.jsxs)(G,{variant:`outline`,size:`sm`,className:`rounded-full h-8 text-xs font-medium`,onClick:s,disabled:n,children:[(0,U.jsx)(Si,{className:xo(`h-3.5 w-3.5`,n&&`animate-spin`)}),o(`action.refresh`,`Refresh`)]})]}),i&&(0,U.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-red-200 bg-red-50 dark:border-red-900/50 dark:bg-red-950/20 p-4 text-sm text-red-700 dark:text-red-300`,children:[(0,U.jsx)(Ii,{className:`h-5 w-5 shrink-0`}),(0,U.jsx)(`p`,{className:`font-medium`,children:i})]}),(0,U.jsxs)(Js,{className:`overflow-hidden rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20]`,children:[(0,U.jsx)(`div`,{className:`border-b border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#18191A] px-6 py-3.5`,children:(0,U.jsxs)(`h2`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-2`,children:[(0,U.jsx)(Qr,{className:`h-4 w-4 text-[#747775] dark:text-[#8E918F]`}),o(`activity.trail_title`,`Recent Activity Trail`)]})}),(0,U.jsx)(`div`,{className:`divide-y divide-[#E0E3E7] dark:divide-[#36373A]`,children:n?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-16 text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(Si,{className:`h-7 w-7 animate-spin text-[#0B57D0] mb-2`}),(0,U.jsx)(`p`,{className:`text-sm`,children:o(`activity.loading`,`Loading activity logs...`)})]}):e.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center py-20 text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(Qr,{className:`h-12 w-12 stroke-[1.5] mb-3 text-[#C4C7C5] dark:text-[#444746]`}),(0,U.jsx)(`p`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:o(`activity.empty_title`,`No activity yet`)}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mt-1`,children:o(`activity.empty_desc`,`Actions you perform on files and folders will appear here.`)})]}):e.map(e=>{let t=c(e.action),n=e.entityType===`folder`?Yr:Wr;return(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-4 px-6 py-4 hover:bg-[#F8FAFD] dark:hover:bg-[#282A2C] transition-colors`,children:[(0,U.jsxs)(`div`,{className:`flex items-start gap-3.5`,children:[(0,U.jsx)(`div`,{className:xo(`flex h-8 w-8 items-center justify-center rounded-full shrink-0`,t.bg),children:(0,U.jsx)(t.icon,{className:`h-4 w-4`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,U.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wider px-2 py-0.5 rounded-full border border-[#E0E3E7] dark:border-[#444746] bg-white dark:bg-[#1E1F20] text-[#1F1F1F] dark:text-[#E3E3E3]`,children:t.label}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1 text-xs text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(n,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{className:`capitalize`,children:e.entityType})]})]}),(0,U.jsx)(`div`,{className:`mt-1.5 flex flex-col gap-0.5`,children:l(e.metadata)})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 text-xs text-[#747775] dark:text-[#8E918F] self-end sm:self-center shrink-0`,children:[(0,U.jsx)(Ar,{className:`h-3.5 w-3.5`}),(0,U.jsx)(`span`,{children:To(e.createdAt)})]})]},e.id)})})]})]})}function Tc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#E5322D`}),(0,U.jsx)(`rect`,{x:`15`,y:`12`,width:`18`,height:`24`,rx:`2.5`,fill:`#FFFFFF`,fillOpacity:`0.45`}),(0,U.jsx)(`rect`,{x:`23`,y:`19`,width:`18`,height:`24`,rx:`2.5`,fill:`#FFFFFF`}),(0,U.jsx)(`rect`,{x:`27`,y:`24`,width:`10`,height:`2`,rx:`1`,fill:`#E5322D`,fillOpacity:`0.5`}),(0,U.jsx)(`rect`,{x:`27`,y:`29`,width:`8`,height:`2`,rx:`1`,fill:`#E5322D`,fillOpacity:`0.5`}),(0,U.jsx)(`circle`,{cx:`21`,cy:`35`,r:`7`,fill:`#B71C1C`}),(0,U.jsx)(`path`,{d:`M21 31V39M21 39L18.5 36.5M21 39L23.5 36.5`,stroke:`#FFFFFF`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Ec({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#FF5436`}),(0,U.jsx)(`path`,{d:`M14 15C14 13.3431 15.3431 12 17 12H25V42H17C15.3431 42 14 40.6569 14 39V15Z`,fill:`#FFFFFF`}),(0,U.jsx)(`path`,{d:`M31 12H39C40.6569 12 42 13.3431 42 15V39C42 40.6569 40.6569 42 39 42H31V12Z`,fill:`#FFFFFF`}),(0,U.jsx)(`path`,{d:`M28 12V42`,stroke:`#FF5436`,strokeWidth:`2.5`,strokeDasharray:`3 3`}),(0,U.jsx)(`circle`,{cx:`28`,cy:`27`,r:`7`,fill:`#C62828`}),(0,U.jsx)(`path`,{d:`M25.5 25L30.5 29M25.5 29L30.5 25`,stroke:`#FFFFFF`,strokeWidth:`1.8`,strokeLinecap:`round`})]})}function Dc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#10B981`}),(0,U.jsx)(`rect`,{x:`18`,y:`14`,width:`20`,height:`28`,rx:`3`,fill:`#FFFFFF`}),(0,U.jsx)(`rect`,{x:`22`,y:`20`,width:`12`,height:`2.5`,rx:`1`,fill:`#10B981`,fillOpacity:`0.4`}),(0,U.jsx)(`rect`,{x:`22`,y:`25`,width:`8`,height:`2.5`,rx:`1`,fill:`#10B981`,fillOpacity:`0.4`}),(0,U.jsx)(`path`,{d:`M13 13L19 19M19 19V14M19 19H14`,stroke:`#047857`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,U.jsx)(`path`,{d:`M43 13L37 19M37 19V14M37 19H42`,stroke:`#047857`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,U.jsx)(`path`,{d:`M13 43L19 37M19 37V42M19 37H14`,stroke:`#047857`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,U.jsx)(`path`,{d:`M43 43L37 37M37 37V42M37 37H42`,stroke:`#047857`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Oc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#F59E0B`}),(0,U.jsx)(`rect`,{x:`13`,y:`14`,width:`22`,height:`26`,rx:`3`,fill:`#FFFFFF`}),(0,U.jsx)(`circle`,{cx:`19`,cy:`20`,r:`2.5`,fill:`#F59E0B`}),(0,U.jsx)(`path`,{d:`M15 34L21 27L26 32L29 29L33 34H15Z`,fill:`#F59E0B`}),(0,U.jsx)(`rect`,{x:`25`,y:`18`,width:`18`,height:`24`,rx:`2.5`,fill:`#E5322D`}),(0,U.jsx)(`text`,{x:`34`,y:`33`,fill:`#FFFFFF`,fontSize:`8`,fontWeight:`800`,textAnchor:`middle`,fontFamily:`sans-serif`,children:`PDF`})]})}function kc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#7C3AED`}),(0,U.jsx)(`rect`,{x:`21`,y:`16`,width:`16`,height:`22`,rx:`2.5`,fill:`#FFFFFF`,transform:`rotate(12 29 27)`}),(0,U.jsx)(`path`,{d:`M39 20C42 24 42 30 38 35C34 40 27 41 21 38C16 35 14 29 16 23C17.5 19 21 16 25 15`,stroke:`#FFFFFF`,strokeWidth:`3`,strokeLinecap:`round`}),(0,U.jsx)(`path`,{d:`M26 11L28 16L23 18`,fill:`#FFFFFF`})]})}function Ac({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#8B5CF6`}),(0,U.jsx)(`rect`,{x:`16`,y:`12`,width:`24`,height:`32`,rx:`3`,fill:`#FFFFFF`}),(0,U.jsx)(`rect`,{x:`21`,y:`18`,width:`14`,height:`2`,rx:`1`,fill:`#8B5CF6`,fillOpacity:`0.3`}),(0,U.jsx)(`rect`,{x:`21`,y:`23`,width:`14`,height:`2`,rx:`1`,fill:`#8B5CF6`,fillOpacity:`0.3`}),(0,U.jsx)(`rect`,{x:`21`,y:`28`,width:`9`,height:`2`,rx:`1`,fill:`#8B5CF6`,fillOpacity:`0.3`}),(0,U.jsxs)(`g`,{transform:`rotate(-25 28 28)`,children:[(0,U.jsx)(`rect`,{x:`12`,y:`23`,width:`32`,height:`10`,rx:`2`,fill:`#5B21B6`,stroke:`#FFFFFF`,strokeWidth:`1.5`}),(0,U.jsx)(`text`,{x:`28`,y:`30.5`,fill:`#FFFFFF`,fontSize:`7`,fontWeight:`900`,textAnchor:`middle`,fontFamily:`sans-serif`,letterSpacing:`0.5`,children:`WATERMARK`})]})]})}function jc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`defs`,{children:(0,U.jsxs)(`linearGradient`,{id:`ai-cutout-grad`,x1:`0`,y1:`0`,x2:`56`,y2:`56`,gradientUnits:`userSpaceOnUse`,children:[(0,U.jsx)(`stop`,{stopColor:`#8B5CF6`}),(0,U.jsx)(`stop`,{offset:`1`,stopColor:`#EC4899`})]})}),(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`url(#ai-cutout-grad)`}),(0,U.jsx)(`rect`,{x:`14`,y:`14`,width:`28`,height:`28`,rx:`4`,fill:`#FFFFFF`,fillOpacity:`0.2`}),(0,U.jsx)(`rect`,{x:`14`,y:`14`,width:`7`,height:`7`,fill:`#FFFFFF`,fillOpacity:`0.3`}),(0,U.jsx)(`rect`,{x:`28`,y:`14`,width:`7`,height:`7`,fill:`#FFFFFF`,fillOpacity:`0.3`}),(0,U.jsx)(`rect`,{x:`21`,y:`21`,width:`7`,height:`7`,fill:`#FFFFFF`,fillOpacity:`0.3`}),(0,U.jsx)(`rect`,{x:`35`,y:`21`,width:`7`,height:`7`,fill:`#FFFFFF`,fillOpacity:`0.3`}),(0,U.jsx)(`rect`,{x:`14`,y:`28`,width:`7`,height:`7`,fill:`#FFFFFF`,fillOpacity:`0.3`}),(0,U.jsx)(`rect`,{x:`28`,y:`28`,width:`7`,height:`7`,fill:`#FFFFFF`,fillOpacity:`0.3`}),(0,U.jsx)(`rect`,{x:`21`,y:`35`,width:`7`,height:`7`,fill:`#FFFFFF`,fillOpacity:`0.3`}),(0,U.jsx)(`rect`,{x:`35`,y:`35`,width:`7`,height:`7`,fill:`#FFFFFF`,fillOpacity:`0.3`}),(0,U.jsx)(`circle`,{cx:`26`,cy:`22`,r:`5`,fill:`#FFFFFF`}),(0,U.jsx)(`path`,{d:`M17 38C17 32.5 21 29 26 29C31 29 35 32.5 35 38H17Z`,fill:`#FFFFFF`}),(0,U.jsx)(`circle`,{cx:`39`,cy:`18`,r:`2`,fill:`#FEF08A`}),(0,U.jsx)(`path`,{d:`M39 13V15M39 21V23M34 18H36M42 18H44`,stroke:`#FEF08A`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,U.jsx)(`circle`,{cx:`43`,cy:`28`,r:`1.5`,fill:`#FEF08A`})]})}function Mc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#059669`}),(0,U.jsx)(`rect`,{x:`16`,y:`16`,width:`24`,height:`24`,rx:`4`,fill:`#FFFFFF`}),(0,U.jsx)(`circle`,{cx:`22`,cy:`22`,r:`2.5`,fill:`#059669`}),(0,U.jsx)(`path`,{d:`M18 36L25 29L29 33L33 28L38 36H18Z`,fill:`#059669`}),(0,U.jsx)(`path`,{d:`M28 10V14M28 14L25 12M28 14L31 12`,stroke:`#FFFFFF`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,U.jsx)(`path`,{d:`M28 46V42M28 42L25 44M28 42L31 44`,stroke:`#FFFFFF`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Nc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#0284C7`}),(0,U.jsx)(`rect`,{x:`12`,y:`16`,width:`16`,height:`20`,rx:`3`,fill:`#FFFFFF`}),(0,U.jsx)(`text`,{x:`20`,y:`29`,fill:`#0284C7`,fontSize:`7`,fontWeight:`800`,textAnchor:`middle`,fontFamily:`sans-serif`,children:`JPG`}),(0,U.jsx)(`rect`,{x:`28`,y:`20`,width:`16`,height:`20`,rx:`3`,fill:`#FFFFFF`}),(0,U.jsx)(`text`,{x:`36`,y:`33`,fill:`#0284C7`,fontSize:`6.5`,fontWeight:`800`,textAnchor:`middle`,fontFamily:`sans-serif`,children:`PNG`}),(0,U.jsx)(`path`,{d:`M22 13H34M34 13L31 10M34 13L31 16`,stroke:`#FFFFFF`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,U.jsx)(`path`,{d:`M34 43H22M22 43L25 40M22 43L25 46`,stroke:`#FFFFFF`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Pc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#2563EB`}),(0,U.jsx)(`rect`,{x:`15`,y:`15`,width:`26`,height:`26`,rx:`3`,fill:`#FFFFFF`,fillOpacity:`0.2`,stroke:`#FFFFFF`,strokeWidth:`2`,strokeDasharray:`3 3`}),(0,U.jsx)(`rect`,{x:`15`,y:`15`,width:`16`,height:`16`,rx:`2`,fill:`#FFFFFF`}),(0,U.jsx)(`rect`,{x:`13`,y:`13`,width:`5`,height:`5`,rx:`1`,fill:`#FFFFFF`}),(0,U.jsx)(`rect`,{x:`38`,y:`13`,width:`5`,height:`5`,rx:`1`,fill:`#FFFFFF`}),(0,U.jsx)(`rect`,{x:`13`,y:`38`,width:`5`,height:`5`,rx:`1`,fill:`#FFFFFF`}),(0,U.jsx)(`rect`,{x:`38`,y:`38`,width:`5`,height:`5`,rx:`1`,fill:`#FFFFFF`}),(0,U.jsx)(`path`,{d:`M26 26L37 37M37 37V32M37 37H32`,stroke:`#FFFFFF`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`})]})}function Fc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#4F46E5`}),(0,U.jsx)(`rect`,{x:`14`,y:`14`,width:`28`,height:`28`,rx:`4`,fill:`#FFFFFF`}),(0,U.jsx)(`circle`,{cx:`21`,cy:`21`,r:`2.5`,fill:`#4F46E5`}),(0,U.jsx)(`path`,{d:`M17 37L24 29L29 34L32 30L39 37H17Z`,fill:`#4F46E5`,fillOpacity:`0.6`}),(0,U.jsx)(`circle`,{cx:`33`,cy:`31`,r:`7`,fill:`#312E81`,stroke:`#FFFFFF`,strokeWidth:`1.5`}),(0,U.jsx)(`text`,{x:`33`,y:`34`,fill:`#FFFFFF`,fontSize:`8`,fontWeight:`800`,textAnchor:`middle`,fontFamily:`sans-serif`,children:`©`})]})}function Ic({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#0D9488`}),(0,U.jsx)(`rect`,{x:`12`,y:`16`,width:`16`,height:`24`,rx:`2`,fill:`#FFFFFF`}),(0,U.jsx)(`rect`,{x:`14`,y:`21`,width:`12`,height:`2`,fill:`#0D9488`}),(0,U.jsx)(`rect`,{x:`14`,y:`26`,width:`12`,height:`2`,fill:`#0D9488`,fillOpacity:`0.4`}),(0,U.jsx)(`rect`,{x:`14`,y:`31`,width:`12`,height:`2`,fill:`#0D9488`,fillOpacity:`0.4`}),(0,U.jsx)(`rect`,{x:`28`,y:`16`,width:`16`,height:`24`,rx:`2`,fill:`#134E4A`}),(0,U.jsx)(`text`,{x:`36`,y:`32`,fill:`#5EEAD4`,fontSize:`14`,fontWeight:`700`,textAnchor:`middle`,fontFamily:`monospace`,children:`{ }`})]})}function Lc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#1E3A8A`}),(0,U.jsx)(`path`,{d:`M28 12L40 17V27C40 35 34.5 41 28 44C21.5 41 16 35 16 27V17L28 12Z`,fill:`#FFFFFF`}),(0,U.jsx)(`path`,{d:`M28 20C25 20 23 22 23 25V28M28 24C26.5 24 25.5 25 25.5 26.5V29.5M28 28V36M30.5 26.5V33M33 25V30`,stroke:`#1E3A8A`,strokeWidth:`2`,strokeLinecap:`round`})]})}function Rc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#4338CA`}),(0,U.jsx)(`rect`,{x:`13`,y:`15`,width:`30`,height:`26`,rx:`4`,fill:`#1E1B4B`,stroke:`#6366F1`,strokeWidth:`1.5`}),(0,U.jsx)(`text`,{x:`28`,y:`27`,fill:`#818CF8`,fontSize:`10`,fontWeight:`800`,textAnchor:`middle`,fontFamily:`monospace`,children:`0101`}),(0,U.jsx)(`text`,{x:`28`,y:`36`,fill:`#A5B4FC`,fontSize:`7`,fontWeight:`700`,textAnchor:`middle`,fontFamily:`monospace`,children:`BASE64`})]})}function zc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#E5322D`}),(0,U.jsx)(`rect`,{x:`11`,y:`14`,width:`18`,height:`26`,rx:`2.5`,fill:`#FFFFFF`}),(0,U.jsx)(`text`,{x:`20`,y:`27`,fill:`#E5322D`,fontSize:`7`,fontWeight:`800`,textAnchor:`middle`,fontFamily:`sans-serif`,children:`PDF`}),(0,U.jsx)(`rect`,{x:`25`,y:`18`,width:`20`,height:`24`,rx:`3`,fill:`#FFFFFF`,stroke:`#D32F2F`,strokeWidth:`1`}),(0,U.jsx)(`circle`,{cx:`31`,cy:`24`,r:`2.5`,fill:`#F59E0B`}),(0,U.jsx)(`path`,{d:`M26 38L32 30L36 34L39 31L44 38H26Z`,fill:`#10B981`})]})}function Bc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#F59E0B`}),(0,U.jsx)(`rect`,{x:`12`,y:`14`,width:`16`,height:`18`,rx:`2`,fill:`#FFFFFF`}),(0,U.jsx)(`path`,{d:`M17 19L23 23L17 27V19Z`,fill:`#D97706`}),(0,U.jsx)(`rect`,{x:`24`,y:`22`,width:`20`,height:`20`,rx:`4`,fill:`#78350F`}),(0,U.jsx)(`path`,{d:`M34 26V35M34 26L40 24V33M34 35C34 36.1 33.1 37 32 37C30.9 37 30 36.1 30 35C30 33.9 30.9 33 32 33C33.1 33 34 33.9 34 35ZM40 33C40 34.1 39.1 35 38 35C36.9 35 36 34.1 36 33C36 31.9 36.9 31 38 31C39.1 31 40 31.9 40 33Z`,stroke:`#FDE68A`,strokeWidth:`1.5`,strokeLinecap:`round`})]})}function Vc({className:e=``,size:t=48}){return(0,U.jsxs)(`svg`,{width:t,height:t,viewBox:`0 0 56 56`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,className:`shrink-0 transition-transform duration-200 ${e}`,children:[(0,U.jsx)(`rect`,{width:`56`,height:`56`,rx:`14`,fill:`#7C3AED`}),(0,U.jsx)(`path`,{d:`M20 12V36H44M36 44V20H12`,stroke:`#FFFFFF`,strokeWidth:`3.5`,strokeLinecap:`round`,strokeLinejoin:`round`}),(0,U.jsx)(`rect`,{x:`23`,y:`23`,width:`10`,height:`10`,rx:`1.5`,fill:`#C4B5FD`,fillOpacity:`0.6`})]})}function Hc(){let e=tt(),[t,n]=(0,v.useState)(`all`),[r,i]=(0,v.useState)(``),a=[{id:`pdf`,label:`Dokumen PDF`,description:`Alat pengolahan dokumen PDF`,iconColor:`#EA4335`},{id:`image`,label:`AI & Gambar`,description:`Alat olah gambar dan AI`,iconColor:`#7248B9`},{id:`video`,label:`Video & Audio`,description:`Alat multimedia, ekstraksi suara & audio berkas`,iconColor:`#FA7B17`},{id:`data`,label:`Utilitas Data`,description:`Alat konversi dan utilitas data`,iconColor:`#1A73E8`}],o=[{id:`merge-pdf`,title:`Merge PDF`,description:`Satukan beberapa berkas PDF menjadi satu dokumen berurutan sesuai susunan yang Anda tentukan.`,category:`pdf`,iconComponent:Tc,badgeLabel:`Populer`,badgeClass:`bg-[#E8F0FE] text-[#1A73E8] dark:bg-[#174EA6]/30 dark:text-[#8AB4F8]`,featureTag:`Penggabung PDF`,path:`/tools/pdf?mode=merge`},{id:`split-pdf`,title:`Split PDF`,description:`Ekstrak rentang halaman tertentu atau pecah seluruh halaman dokumen PDF menjadi berkas tersendiri.`,category:`pdf`,iconComponent:Ec,featureTag:`Pemisah Halaman`,path:`/tools/pdf?mode=split`},{id:`compress-pdf`,title:`Compress PDF`,description:`Kecilkan ukuran file dokumen PDF agar hemat penyimpanan dan cepat dikirim tanpa merusak teks.`,category:`pdf`,iconComponent:Dc,badgeLabel:`Populer`,badgeClass:`bg-[#E8F0FE] text-[#1A73E8] dark:bg-[#174EA6]/30 dark:text-[#8AB4F8]`,featureTag:`Optimasi Ukuran`,path:`/tools/pdf?mode=compress`},{id:`images-to-pdf`,title:`JPG ke PDF`,description:`Konversi dan gabungkan banyak foto JPG, PNG, atau WebP menjadi satu dokumen PDF album yang rapi.`,category:`pdf`,iconComponent:Oc,featureTag:`Foto ke Dokumen`,path:`/tools/pdf?mode=images-to-pdf`},{id:`pdf-to-images`,title:`PDF ke Gambar (JPG/PNG)`,description:`Ekstrak setiap lembar dokumen PDF menjadi berkas foto berkualitas tinggi (JPG atau PNG) dengan pratinjau cepat.`,category:`pdf`,iconComponent:zc,badgeLabel:`Baru`,badgeClass:`bg-[#E8F0FE] text-[#1A73E8] dark:bg-[#174EA6]/30 dark:text-[#8AB4F8]`,featureTag:`Ekstrak Gambar`,path:`/tools/pdf?mode=pdf-to-images`},{id:`rotate-pdf`,title:`Rotate PDF`,description:`Putar orientasi lembar dokumen PDF yang terbalik (90°, 180°, 270°) secara cepat dan serentak.`,category:`pdf`,iconComponent:kc,featureTag:`Rotasi Orientasi`,path:`/tools/pdf?mode=rotate`},{id:`watermark-pdf`,title:`Watermark PDF`,description:`Bubuhkan stempel tanda hak cipta atau teks khusus (contoh: "RAHASIA", "DRAFT") di lembar PDF.`,category:`pdf`,iconComponent:Ac,featureTag:`Stempel Keamanan`,path:`/tools/pdf?mode=watermark`},{id:`remove-bg`,title:`Hapus Background AI`,description:`Hapus latar belakang foto manusia atau produk secara otomatis dan instan langsung di browser.`,category:`image`,iconComponent:jc,badgeLabel:`AI Powered`,badgeClass:`bg-[#F3E8FF] text-[#7248B9] dark:bg-[#4A148C]/30 dark:text-[#D7AEFB]`,featureTag:`Hapus Latar Otomatis`,path:`/tools/remove-bg`},{id:`compress-img`,title:`Kompres Gambar`,description:`Kecilkan ukuran foto JPG, PNG, dan WebP hingga 80% tanpa penurunan kualitas visual yang terlihat.`,category:`image`,iconComponent:Mc,badgeLabel:`Populer`,badgeClass:`bg-[#E8F0FE] text-[#1A73E8] dark:bg-[#174EA6]/30 dark:text-[#8AB4F8]`,featureTag:`Kecilkan Ukuran`,path:`/tools/image?mode=compress`},{id:`crop-img`,title:`Potong Foto / Pas Foto`,description:`Potong foto dengan preset rasio pas foto resmi (3:4, 4:6), persegi 1:1, atau rasio kustom bebas.`,category:`image`,iconComponent:Vc,badgeLabel:`Baru`,badgeClass:`bg-[#F3E8FF] text-[#7248B9] dark:bg-[#4A148C]/30 dark:text-[#D7AEFB]`,featureTag:`Crop & Pas Foto`,path:`/tools/image?mode=crop`},{id:`convert-img`,title:`Konversi Format Gambar`,description:`Ubah format gambar secara batch antara WebP, PNG, dan JPG untuk kebutuhan web ataupun cetak.`,category:`image`,iconComponent:Nc,featureTag:`WebP ⇄ PNG ⇄ JPG`,path:`/tools/image?mode=convert`},{id:`resize-img`,title:`Ubah Ukuran Gambar`,description:`Sesuaikan dimensi pixel lebar dan tinggi atau persentase skala foto dengan rasio aspek tetap terkunci.`,category:`image`,iconComponent:Pc,featureTag:`Skala & Dimensi`,path:`/tools/image?mode=resize`},{id:`watermark-img`,title:`Watermark Foto`,description:`Tambahkan cap teks hak cipta pada puluhan gambar sekaligus di posisi tengah ataupun sudut berkas.`,category:`image`,iconComponent:Fc,featureTag:`Cap Hak Cipta`,path:`/tools/image?mode=watermark`},{id:`video-to-audio`,title:`Ekstrak Audio Video`,description:`Ambil dan ubah suara dari video MP4, WebM, atau MOV menjadi berkas audio jernih (.WAV) langsung di browser.`,category:`video`,iconComponent:Bc,badgeLabel:`Baru`,badgeClass:`bg-[#FEF7E0] text-[#B06000] dark:bg-[#7C4A00]/30 dark:text-[#FDD663]`,featureTag:`Ambil Suara Video`,path:`/tools/video`},{id:`csv-json`,title:`CSV ⇄ JSON Converter`,description:`Ubah data tabel CSV ke format JSON dan sebaliknya secara instan dengan susunan rapi otomatis.`,category:`data`,iconComponent:Ic,featureTag:`Konversi Tabel`,path:`/tools/data?mode=csv-json`},{id:`hash`,title:`File Hash & Checksum`,description:`Cek keaslian dan keamanan berkas menggunakan sidik jari digital (SHA-256) secara aman di browser.`,category:`data`,iconComponent:Lc,featureTag:`Cek Keaslian Berkas`,path:`/tools/data?mode=hash`},{id:`base64`,title:`Base64 Encoder`,description:`Ubah berkas atau gambar menjadi teks kode data Base64 untuk keperluan halaman web atau dokumen.`,category:`data`,iconComponent:Rc,featureTag:`Kode Teks Berkas`,path:`/tools/data?mode=base64`}],s=o.filter(e=>{let n=t===`all`||e.category===t,i=e.title.toLowerCase().includes(r.toLowerCase())||e.description.toLowerCase().includes(r.toLowerCase())||e.featureTag.toLowerCase().includes(r.toLowerCase());return n&&i}),c=r.trim().length>0,l=t=>{let n=t.iconComponent;return(0,U.jsxs)(`div`,{onClick:()=>e(t.path),className:`group relative flex flex-col justify-between rounded-2xl border border-[#E0E3E7] bg-white p-5 hover:bg-[#F0F4F9] dark:border-[#36373A] dark:bg-[#1E1F20] dark:hover:bg-[#333537] transition-colors duration-200 cursor-pointer select-none`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-start justify-between mb-4`,children:[(0,U.jsx)(`div`,{className:`group-hover:scale-105 transition-transform duration-200`,children:(0,U.jsx)(n,{size:50})}),t.badgeLabel&&(0,U.jsx)(`span`,{className:`px-2.5 py-0.5 rounded-full text-[10px] font-bold tracking-wider uppercase ${t.badgeClass}`,children:t.badgeLabel})]}),(0,U.jsx)(`h3`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3] group-hover:text-[#0B57D0] dark:group-hover:text-[#A8C7FA] transition-colors leading-snug`,children:t.title}),(0,U.jsx)(`p`,{className:`text-xs text-[#444746] dark:text-[#C4C7C5] mt-1.5 leading-relaxed line-clamp-2`,children:t.description})]}),(0,U.jsxs)(`div`,{className:`mt-4 pt-3 border-t border-[#E0E3E7]/60 dark:border-[#36373A]/60 flex items-center justify-between`,children:[(0,U.jsxs)(`span`,{className:`text-[11px] font-medium text-[#747775] dark:text-[#8E918F] flex items-center gap-1.5`,children:[(0,U.jsx)(`span`,{className:`w-1.5 h-1.5 rounded-full bg-[#0B57D0]/60 dark:bg-[#A8C7FA]/60`}),t.featureTag]}),(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#747775] group-hover:text-[#0B57D0] dark:text-[#8E918F] dark:group-hover:text-[#A8C7FA] flex items-center gap-1 transition-colors`,children:[(0,U.jsx)(`span`,{children:`Buka`}),(0,U.jsx)(gr,{className:`w-3.5 h-3.5 transition-transform group-hover:translate-x-1`})]})]})]},t.id)},u=(e,t)=>(0,U.jsxs)(`div`,{className:`mb-6`,children:[(0,U.jsx)(`div`,{className:`flex items-center`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-2 rounded-t-xl border border-b-0 border-[#E0E3E7] bg-[#F8FAFD] dark:border-[#36373A] dark:bg-[#28292A]`,children:[(0,U.jsx)(Yr,{className:`w-4 h-4 shrink-0`,style:{color:e.iconColor}}),(0,U.jsx)(`span`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:e.label}),(0,U.jsxs)(`span`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:[t.length,` alat`]})]})}),(0,U.jsx)(`div`,{className:`rounded-2xl rounded-tl-none border border-[#E0E3E7] bg-[#F8FAFD] p-4 dark:border-[#36373A] dark:bg-[#28292A]`,children:(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3`,children:t.map(l)})})]},e.id);return(0,U.jsxs)(`div`,{className:`flex flex-col min-h-full w-full min-w-0`,children:[(0,U.jsx)(Zs,{title:`Tools Studio`,description:`Semua alat PDF, gambar, dan utilitas data — diproses langsung di browser.`}),(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 py-3 border-b border-[#E0E3E7]/60 dark:border-[#36373A]/60 mb-6 mt-4`,children:[(0,U.jsx)(`div`,{className:`flex items-center gap-1.5 overflow-x-auto pb-1 sm:pb-0`,children:[{id:`all`,label:`Semua Alat`},{id:`pdf`,label:`Dokumen PDF`},{id:`image`,label:`AI & Gambar`},{id:`video`,label:`Video & Audio`},{id:`data`,label:`Utilitas Data`}].map(e=>{let r=t===e.id,i=e.id===`all`?o.length:o.filter(t=>t.category===e.id).length;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>n(e.id),className:`h-8 px-4 rounded-full text-xs font-medium whitespace-nowrap transition-all select-none flex items-center gap-1.5 border ${r?`bg-[#C2E7FF] text-[#001D35] border-[#C2E7FF] dark:bg-[#004A77] dark:text-[#C2E7FF] dark:border-[#004A77]`:`bg-transparent text-[#444746] border-[#E0E3E7] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:border-[#36373A] dark:hover:bg-[#28292A]`}`,children:[(0,U.jsx)(`span`,{children:e.label}),(0,U.jsx)(`span`,{className:`text-[10px] px-1.5 rounded-full ${r?`bg-[#001D35]/10 text-[#001D35] dark:bg-[#C2E7FF]/15 dark:text-[#C2E7FF]`:`bg-black/5 dark:bg-white/10 text-[#747775] dark:text-[#8E918F]`}`,children:i})]},e.id)})}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 w-full sm:w-auto`,children:[(0,U.jsxs)(`div`,{className:`relative flex-1 sm:w-72`,children:[(0,U.jsx)(Ti,{className:`absolute left-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-[#747775]`}),(0,U.jsx)(Os,{type:`text`,placeholder:`Cari alat (cth: merge, kompres, bg)...`,value:r,onChange:e=>i(e.target.value),className:`pl-9.5 h-9 text-xs rounded-full bg-[#EDF2FC] dark:bg-[#28292A] border-0 text-[#1F1F1F] dark:text-[#E3E3E3] focus-visible:ring-2 focus-visible:ring-[#0B57D0]`})]}),(t!==`all`||c)&&(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{n(`all`),i(``)},title:`Reset Filter`,className:`flex items-center gap-1.5 h-8 px-3 rounded-full text-xs font-medium border border-[#E0E3E7] bg-white hover:bg-[#F0F4F9] text-[#444746] dark:border-[#36373A] dark:bg-[#1E1F20] dark:text-[#C4C7C5] dark:hover:bg-[#28292A] transition-colors shrink-0`,children:[(0,U.jsx)(Ai,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{className:`hidden sm:inline`,children:`Reset`})]})]})]}),c?(0,U.jsxs)(`div`,{className:`space-y-4 pb-12`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`h2`,{className:`text-[16px] leading-6 font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Hasil Pencarian`}),(0,U.jsxs)(`span`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:[`Menampilkan `,s.length,` dari `,o.length,` alat`]})]}),s.length===0?(0,U.jsxs)(`div`,{className:`text-center py-12 rounded-2xl border border-dashed border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#1E1F20]/50`,children:[(0,U.jsxs)(`p`,{className:`text-sm font-medium text-[#444746] dark:text-[#C4C7C5]`,children:[`Tidak ada alat yang cocok dengan pencarian "`,r,`"`]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{n(`all`),i(``)},className:`mt-3 text-xs text-[#0B57D0] hover:underline font-medium dark:text-[#A8C7FA]`,children:`Reset semua filter`})]}):(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4`,children:s.map(l)})]}):(0,U.jsx)(`div`,{className:`pb-12`,children:a.filter(e=>t===`all`||t===e.id).map(e=>{let t=o.filter(t=>t.category===e.id);return t.length===0?null:u(e,t)})})]})}var Uc=Object.create,Wc=Object.defineProperty,Gc=Object.getOwnPropertyDescriptor,Kc=Object.getOwnPropertyNames,qc=Object.getPrototypeOf,Jc=Object.prototype.hasOwnProperty,Yc=(e,t)=>function(){return t||(0,e[Kc(e)[0]])((t={exports:{}}).exports,t),t.exports},Xc=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let i of Kc(t))!Jc.call(e,i)&&i!==n&&Wc(e,i,{get:()=>t[i],enumerable:!(r=Gc(t,i))||r.enumerable});return e},Zc=(e,t,n)=>(n=e==null?{}:Uc(qc(e)),Xc(t||!e||!e.__esModule?Wc(n,`default`,{value:e,enumerable:!0}):n,e)),Qc=Yc({"../../node_modules/.pnpm/iota-array@1.0.0/node_modules/iota-array/iota.js"(e,t){function n(e){for(var t=Array(e),n=0;n<e;++n)t[n]=n;return t}t.exports=n}}),$c=Yc({"../../node_modules/.pnpm/is-buffer@1.1.6/node_modules/is-buffer/index.js"(e,t){t.exports=function(e){return e!=null&&(n(e)||r(e)||!!e._isBuffer)};function n(e){return!!e.constructor&&typeof e.constructor.isBuffer==`function`&&e.constructor.isBuffer(e)}function r(e){return typeof e.readFloatLE==`function`&&typeof e.slice==`function`&&n(e.slice(0,0))}}}),el=Yc({"../../node_modules/.pnpm/ndarray@1.0.19/node_modules/ndarray/ndarray.js"(e,t){var n=Qc(),r=$c(),i=typeof Float64Array<`u`;function a(e,t){return e[0]-t[0]}function o(){var e=this.stride,t=Array(e.length),n;for(n=0;n<t.length;++n)t[n]=[Math.abs(e[n]),n];t.sort(a);var r=Array(t.length);for(n=0;n<r.length;++n)r[n]=t[n][1];return r}function s(e,t){var r=[`View`,t,`d`,e].join(``);t<0&&(r=`View_Nil`+e);var i=e===`generic`;if(t===-1){var a=`function `+r+`(a){this.data=a;};var proto=`+r+`.prototype;proto.dtype='`+e+`';proto.index=function(){return -1};proto.size=0;proto.dimension=-1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function(){return new `+r+`(this.data);};proto.get=proto.set=function(){};proto.pick=function(){return null};return function construct_`+r+`(a){return new `+r+`(a);}`,s=Function(a);return s()}else if(t===0){var a=`function `+r+`(a,d) {this.data = a;this.offset = d};var proto=`+r+`.prototype;proto.dtype='`+e+`';proto.index=function(){return this.offset};proto.dimension=0;proto.size=1;proto.shape=proto.stride=proto.order=[];proto.lo=proto.hi=proto.transpose=proto.step=function `+r+`_copy() {return new `+r+`(this.data,this.offset)};proto.pick=function `+r+`_pick(){return TrivialArray(this.data);};proto.valueOf=proto.get=function `+r+`_get(){return `+(i?`this.data.get(this.offset)`:`this.data[this.offset]`)+`};proto.set=function `+r+`_set(v){return `+(i?`this.data.set(this.offset,v)`:`this.data[this.offset]=v`)+`};return function construct_`+r+`(a,b,c,d){return new `+r+`(a,d)}`,s=Function(`TrivialArray`,a);return s(l[e][0])}var a=[`'use strict'`],c=n(t),u=c.map(function(e){return`i`+e}),d=`this.offset+`+c.map(function(e){return`this.stride[`+e+`]*i`+e}).join(`+`),f=c.map(function(e){return`b`+e}).join(`,`),p=c.map(function(e){return`c`+e}).join(`,`);a.push(`function `+r+`(a,`+f+`,`+p+`,d){this.data=a`,`this.shape=[`+f+`]`,`this.stride=[`+p+`]`,`this.offset=d|0}`,`var proto=`+r+`.prototype`,`proto.dtype='`+e+`'`,`proto.dimension=`+t),a.push(`Object.defineProperty(proto,'size',{get:function `+r+`_size(){return `+c.map(function(e){return`this.shape[`+e+`]`}).join(`*`),`}})`),t===1?a.push(`proto.order=[0]`):(a.push(`Object.defineProperty(proto,'order',{get:`),t<4?(a.push(`function `+r+`_order(){`),t===2?a.push(`return (Math.abs(this.stride[0])>Math.abs(this.stride[1]))?[1,0]:[0,1]}})`):t===3&&a.push(`var s0=Math.abs(this.stride[0]),s1=Math.abs(this.stride[1]),s2=Math.abs(this.stride[2]);if(s0>s1){if(s1>s2){return [2,1,0];}else if(s0>s2){return [1,2,0];}else{return [1,0,2];}}else if(s0>s2){return [2,0,1];}else if(s2>s1){return [0,1,2];}else{return [0,2,1];}}})`)):a.push(`ORDER})`)),a.push(`proto.set=function `+r+`_set(`+u.join(`,`)+`,v){`),i?a.push(`return this.data.set(`+d+`,v)}`):a.push(`return this.data[`+d+`]=v}`),a.push(`proto.get=function `+r+`_get(`+u.join(`,`)+`){`),i?a.push(`return this.data.get(`+d+`)}`):a.push(`return this.data[`+d+`]}`),a.push(`proto.index=function `+r+`_index(`,u.join(),`){return `+d+`}`),a.push(`proto.hi=function `+r+`_hi(`+u.join(`,`)+`){return new `+r+`(this.data,`+c.map(function(e){return[`(typeof i`,e,`!=='number'||i`,e,`<0)?this.shape[`,e,`]:i`,e,`|0`].join(``)}).join(`,`)+`,`+c.map(function(e){return`this.stride[`+e+`]`}).join(`,`)+`,this.offset)}`);var m=c.map(function(e){return`a`+e+`=this.shape[`+e+`]`}),h=c.map(function(e){return`c`+e+`=this.stride[`+e+`]`});a.push(`proto.lo=function `+r+`_lo(`+u.join(`,`)+`){var b=this.offset,d=0,`+m.join(`,`)+`,`+h.join(`,`));for(var g=0;g<t;++g)a.push(`if(typeof i`+g+`==='number'&&i`+g+`>=0){d=i`+g+`|0;b+=c`+g+`*d;a`+g+`-=d}`);a.push(`return new `+r+`(this.data,`+c.map(function(e){return`a`+e}).join(`,`)+`,`+c.map(function(e){return`c`+e}).join(`,`)+`,b)}`),a.push(`proto.step=function `+r+`_step(`+u.join(`,`)+`){var `+c.map(function(e){return`a`+e+`=this.shape[`+e+`]`}).join(`,`)+`,`+c.map(function(e){return`b`+e+`=this.stride[`+e+`]`}).join(`,`)+`,c=this.offset,d=0,ceil=Math.ceil`);for(var g=0;g<t;++g)a.push(`if(typeof i`+g+`==='number'){d=i`+g+`|0;if(d<0){c+=b`+g+`*(a`+g+`-1);a`+g+`=ceil(-a`+g+`/d)}else{a`+g+`=ceil(a`+g+`/d)}b`+g+`*=d}`);a.push(`return new `+r+`(this.data,`+c.map(function(e){return`a`+e}).join(`,`)+`,`+c.map(function(e){return`b`+e}).join(`,`)+`,c)}`);for(var _=Array(t),v=Array(t),g=0;g<t;++g)_[g]=`a[i`+g+`]`,v[g]=`b[i`+g+`]`;a.push(`proto.transpose=function `+r+`_transpose(`+u+`){`+u.map(function(e,t){return e+`=(`+e+`===undefined?`+t+`:`+e+`|0)`}).join(`;`),`var a=this.shape,b=this.stride;return new `+r+`(this.data,`+_.join(`,`)+`,`+v.join(`,`)+`,this.offset)}`),a.push(`proto.pick=function `+r+`_pick(`+u+`){var a=[],b=[],c=this.offset`);for(var g=0;g<t;++g)a.push(`if(typeof i`+g+`==='number'&&i`+g+`>=0){c=(c+this.stride[`+g+`]*i`+g+`)|0}else{a.push(this.shape[`+g+`]);b.push(this.stride[`+g+`])}`);a.push(`var ctor=CTOR_LIST[a.length+1];return ctor(this.data,a,b,c)}`),a.push(`return function construct_`+r+`(data,shape,stride,offset){return new `+r+`(data,`+c.map(function(e){return`shape[`+e+`]`}).join(`,`)+`,`+c.map(function(e){return`stride[`+e+`]`}).join(`,`)+`,offset)}`);var s=Function(`CTOR_LIST`,`ORDER`,a.join(`
|
|
41
|
+
`));return s(l[e],o)}function c(e){if(r(e))return`buffer`;if(i)switch(Object.prototype.toString.call(e)){case`[object Float64Array]`:return`float64`;case`[object Float32Array]`:return`float32`;case`[object Int8Array]`:return`int8`;case`[object Int16Array]`:return`int16`;case`[object Int32Array]`:return`int32`;case`[object Uint8Array]`:return`uint8`;case`[object Uint16Array]`:return`uint16`;case`[object Uint32Array]`:return`uint32`;case`[object Uint8ClampedArray]`:return`uint8_clamped`;case`[object BigInt64Array]`:return`bigint64`;case`[object BigUint64Array]`:return`biguint64`}return Array.isArray(e)?`array`:`generic`}var l={float32:[],float64:[],int8:[],int16:[],int32:[],uint8:[],uint16:[],uint32:[],array:[],uint8_clamped:[],bigint64:[],biguint64:[],buffer:[],generic:[]};function u(e,t,n,r){if(e===void 0){var i=l.array[0];return i([])}else typeof e==`number`&&(e=[e]);t===void 0&&(t=[e.length]);var a=t.length;if(n===void 0){n=Array(a);for(var o=a-1,u=1;o>=0;--o)n[o]=u,u*=t[o]}if(r===void 0){r=0;for(var o=0;o<a;++o)n[o]<0&&(r-=(t[o]-1)*n[o])}for(var d=c(e),f=l[d];f.length<=a+1;)f.push(s(d,f.length-1));var i=f[a+1];return i(e,t,n,r)}t.exports=u}}),tl=typeof global==`object`&&global&&global.Object===Object&&global,nl=typeof self==`object`&&self&&self.Object===Object&&self,rl=tl||nl||Function(`return this`)(),il=rl.Symbol,al=Object.prototype,ol=al.hasOwnProperty,sl=al.toString,cl=il?il.toStringTag:void 0;function ll(e){var t=ol.call(e,cl),n=e[cl];try{e[cl]=void 0;var r=!0}catch{}var i=sl.call(e);return r&&(t?e[cl]=n:delete e[cl]),i}var ul=ll,dl=Object.prototype.toString;function fl(e){return dl.call(e)}var pl=fl,ml=`[object Null]`,hl=`[object Undefined]`,gl=il?il.toStringTag:void 0;function _l(e){return e==null?e===void 0?hl:ml:gl&&gl in Object(e)?ul(e):pl(e)}var vl=_l;function yl(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var bl=yl,xl=`[object AsyncFunction]`,Sl=`[object Function]`,Cl=`[object GeneratorFunction]`,wl=`[object Proxy]`;function Tl(e){if(!bl(e))return!1;var t=vl(e);return t==Sl||t==Cl||t==xl||t==wl}var El=Tl,Dl=rl[`__core-js_shared__`],Ol=function(){var e=/[^.]+$/.exec(Dl&&Dl.keys&&Dl.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function kl(e){return!!Ol&&Ol in e}var Al=kl,jl=Function.prototype.toString;function Ml(e){if(e!=null){try{return jl.call(e)}catch{}try{return e+``}catch{}}return``}var Nl=Ml,Pl=/[\\^$.*+?()[\]{}|]/g,Fl=/^\[object .+?Constructor\]$/,Il=Function.prototype,Ll=Object.prototype,Rl=Il.toString,zl=Ll.hasOwnProperty,Bl=RegExp(`^`+Rl.call(zl).replace(Pl,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function Vl(e){return!bl(e)||Al(e)?!1:(El(e)?Bl:Fl).test(Nl(e))}var Hl=Vl;function Ul(e,t){return e?.[t]}var Wl=Ul;function Gl(e,t){var n=Wl(e,t);return Hl(n)?n:void 0}var Kl=Gl,ql=Kl(Object,`create`);function Jl(){this.__data__=ql?ql(null):{},this.size=0}var Yl=Jl;function Xl(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var Zl=Xl,Ql=`__lodash_hash_undefined__`,$l=Object.prototype.hasOwnProperty;function eu(e){var t=this.__data__;if(ql){var n=t[e];return n===Ql?void 0:n}return $l.call(t,e)?t[e]:void 0}var tu=eu,nu=Object.prototype.hasOwnProperty;function ru(e){var t=this.__data__;return ql?t[e]!==void 0:nu.call(t,e)}var iu=ru,au=`__lodash_hash_undefined__`;function ou(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=ql&&t===void 0?au:t,this}var su=ou;function cu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}cu.prototype.clear=Yl,cu.prototype.delete=Zl,cu.prototype.get=tu,cu.prototype.has=iu,cu.prototype.set=su;var lu=cu;function uu(){this.__data__=[],this.size=0}var du=uu;function fu(e,t){return e===t||e!==e&&t!==t}var pu=fu;function mu(e,t){for(var n=e.length;n--;)if(pu(e[n][0],t))return n;return-1}var hu=mu,gu=Array.prototype.splice;function _u(e){var t=this.__data__,n=hu(t,e);return n<0?!1:(n==t.length-1?t.pop():gu.call(t,n,1),--this.size,!0)}var vu=_u;function yu(e){var t=this.__data__,n=hu(t,e);return n<0?void 0:t[n][1]}var bu=yu;function xu(e){return hu(this.__data__,e)>-1}var Su=xu;function Cu(e,t){var n=this.__data__,r=hu(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var wu=Cu;function Tu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Tu.prototype.clear=du,Tu.prototype.delete=vu,Tu.prototype.get=bu,Tu.prototype.has=Su,Tu.prototype.set=wu;var Eu=Tu,Du=Kl(rl,`Map`);function Ou(){this.size=0,this.__data__={hash:new lu,map:new(Du||Eu),string:new lu}}var ku=Ou;function Au(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}var ju=Au;function Mu(e,t){var n=e.__data__;return ju(t)?n[typeof t==`string`?`string`:`hash`]:n.map}var Nu=Mu;function Pu(e){var t=Nu(this,e).delete(e);return this.size-=+!!t,t}var Fu=Pu;function Iu(e){return Nu(this,e).get(e)}var Lu=Iu;function Ru(e){return Nu(this,e).has(e)}var zu=Ru;function Bu(e,t){var n=Nu(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var Vu=Bu;function Hu(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Hu.prototype.clear=ku,Hu.prototype.delete=Fu,Hu.prototype.get=Lu,Hu.prototype.has=zu,Hu.prototype.set=Vu;var Uu=Hu,Wu=`Expected a function`;function Gu(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(Wu);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(Gu.Cache||Uu),n}Gu.Cache=Uu;var Ku=Gu,qu=Zc(el()),Ju=class e{constructor(e,t){this.type=`application/octet-stream`,this.params={},this.type=e,this.params=t}toString(){let e=[];for(let t in this.params){let n=this.params[t];e.push(`${t}=${n}`)}return[this.type,...e].join(`;`)}static create(t,n){return new e(t,n)}isIdentical(e){return this.type===e.type&&this.params===e.params}isEqual(e){return this.type===e.type}static fromString(t){let[n,...r]=t.split(`;`),i={};for(let e of r){let[t,n]=e.split(`=`);i[t.trim()]=n.trim()}return new e(n,i)}},Yu=Zc(el());async function Xu(e){let t=Ju.fromString(e.type);switch(t.type){case`image/x-alpha8`:{let n=parseInt(t.params.width),r=parseInt(t.params.height);return(0,Yu.default)(new Uint8Array(await e.arrayBuffer()),[r,n,1])}case`image/x-rgba8`:{let n=parseInt(t.params.width),r=parseInt(t.params.height);return(0,Yu.default)(new Uint8Array(await e.arrayBuffer()),[r,n,4])}case`application/octet-stream`:case`image/png`:case`image/jpeg`:case`image/jpg`:case`image/webp`:{let t=ed(await createImageBitmap(e));return(0,Yu.default)(new Uint8Array(t.data),[t.height,t.width,4])}default:throw Error(`Invalid format: ${t.type} with params: ${t.params}`)}}async function Zu(e,t=.8,n=`image/png`){let[r,i,a]=e.shape;switch(n){case`image/x-alpha8`:case`image/x-rgba8`:{let t=Ju.create(n,{width:i.toString(),height:r.toString()});return new Blob([e.data],{type:t.toString()})}case`image/png`:case`image/jpeg`:case`image/webp`:{let a=new ImageData(new Uint8ClampedArray(e.data),i,r);var o=od(a.width,a.height);return o.getContext(`2d`).putImageData(a,0,0),o.convertToBlob({quality:t,type:n})}default:throw Error(`Invalid format: ${n}`)}}function Qu(e){return RegExp(`^(?:[a-z+]+:)?//`,`i`).test(e)}function $u(e,t){return Qu(e)?e:new URL(e,t).href}function ed(e){var t=od(e.width,e.height),n=t.getContext(`2d`);return n.drawImage(e,0,0),n.getImageData(0,0,t.width,t.height)}function td(e){if(typeof Uint8Array<`u`)return new Uint8Array(e);if(typeof Uint8ClampedArray<`u`)return new Uint8ClampedArray(e);if(typeof Uint16Array<`u`)return new Uint16Array(e);if(typeof Uint32Array<`u`)return new Uint32Array(e);if(typeof Float32Array<`u`)return new Float32Array(e);if(typeof Float64Array<`u`)return new Float64Array(e);throw Error(`TypedArray not supported`)}function nd(e,t,n,r=!1){let[i,a,o]=e.shape,s=a/t,c=i/n;r&&(s=c=Math.max(s,c)>1?Math.max(s,c):Math.min(s,c));let l=(0,qu.default)(td(o*t*n),[n,t,o]);for(let r=0;r<n;r++)for(let n=0;n<t;n++){let t=n*s,u=r*c,d=Math.max(Math.floor(t),0),f=Math.min(Math.ceil(t),a-1),p=Math.max(Math.floor(u),0),m=Math.min(Math.ceil(u),i-1),h=t-d,g=u-p;for(let t=0;t<o;t++){let i=e.get(p,d,t),a=e.get(p,f,t),o=e.get(m,d,t),s=e.get(m,f,t),c=(1-h)*(1-g)*i+h*(1-g)*a+(1-h)*g*o+h*g*s;l.set(r,n,t,c)}}return l}function rd(e,t=[128,128,128],n=[256,256,256]){var r=e.data;let[i,a,o]=e.shape,s=i*a,c=new Float32Array(3*s);for(let e=0,i=0;e<r.length;e+=4,i+=1)c[i]=(r[e]-t[0])/n[0],c[i+s]=(r[e+1]-t[1])/n[1],c[i+s+s]=(r[e+2]-t[2])/n[2];return(0,qu.default)(c,[1,3,i,a])}async function id(e,t){return typeof e==`string`&&(e=$u(e,t.publicPath),e=new URL(e)),e instanceof URL&&(e=await(await fetch(e,{})).blob()),(e instanceof ArrayBuffer||ArrayBuffer.isView(e))&&(e=new Blob([e])),e instanceof Blob&&(e=await Xu(e)),e}function ad(e){let t=new Uint8Array(e.data.length);for(let n=0;n<e.data.length;n++)t[n]=e.data[n]*255;return(0,qu.default)(t,e.shape)}function od(e,t){let n;if(n=typeof OffscreenCanvas<`u`?new OffscreenCanvas(e,t):document.createElement(`canvas`),!n)throw Error(`Canvas nor OffscreenCanvas are available in the current context.`);return n}var sd=Zc(el()),cd=async()=>navigator.gpu===void 0?!1:await navigator.gpu.requestAdapter()!==null,ld=()=>navigator.hardwareConcurrency??4;async function ud(e,t){return URL.createObjectURL(await dd(e,t))}async function dd(e,t){let n=new URL(`resources.json`,t.publicPath),r=await fetch(n);if(!r.ok)throw Error(`Resource metadata not found. Ensure that the config.publicPath is configured correctly.`);let i=(await r.json())[e];if(!i)throw Error(`Resource ${e} not found. Ensure that the config.publicPath is configured correctly.`);let a=i.chunks,o=0,s=a.map(async n=>{let r=n.offsets[1]-n.offsets[0],a=t.publicPath?new URL(n.name,t.publicPath).toString():n.name,s=await(await fetch(a,t.fetchArgs)).blob();if(r!==s.size)throw Error(`Failed to fetch ${e} with size ${r} but got ${s.size}`);return t.progress&&(o+=r,t.progress(`fetch:${e}`,o,i.size)),s}),c=await Promise.all(s),l=new Blob(c,{type:i.mime});if(l.size!==i.size)throw Error(`Failed to fetch ${e} with size ${i.size} but got ${l.size}`);return l}var fd=null,pd=async e=>(fd===null&&(fd=e?(await C(async()=>{let{default:e}=await import(`./ort.webgpu.bundle.min-C1vdBqT7.js`);return{default:e}},[])).default:(await C(async()=>{let{default:e}=await import(`./ort.bundle.min-CpXgll2e.js`);return{default:e}},[])).default),fd);async function md(e,t){let n=t.device===`gpu`&&await cd(),r=n&&t.proxyToWorker,i=[n?`webgpu`:`wasm`],a=await pd(n);t.debug&&(console.debug(` Using WebGPU:`,n),console.debug(` Proxy to Worker:`,r),a.env.debug=!0,a.env.logLevel=`verbose`),a.env.wasm.numThreads=ld(),a.env.wasm.proxy=r;let o=n?`/onnxruntime-web/ort-wasm-simd-threaded.jsep`:`/onnxruntime-web/ort-wasm-simd-threaded`,s=await ud(`${o}.wasm`,t),c=await ud(`${o}.mjs`,t);a.env.wasm.wasmPaths={mjs:c,wasm:s},t.debug&&console.debug(`ort.env.wasm:`,a.env.wasm);let l={executionProviders:i,graphOptimizationLevel:`all`,executionMode:`parallel`,enableCpuMemArena:!0};return await a.InferenceSession.create(e,l).catch(e=>{throw Error(`Failed to create session: "${e}". Please check if the publicPath is set correctly.`)})}async function hd(e,t,n,r){let i=await pd(r.device===`gpu`&&await cd()),a={};for(let[e,n]of t)a[e]=new i.Tensor(`float32`,new Float32Array(n.data),n.shape);let o=await e.run(a,{}),s=[];for(let e of n){let t=o[e],n=t.dims,r=t.data,i=(0,sd.default)(r,n);s.push(i)}return s}var gd;(function(e){e.assertEqual=e=>e;function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(gd||={});var _d;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(_d||={});var vd=gd.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),yd=e=>{switch(typeof e){case`undefined`:return vd.undefined;case`string`:return vd.string;case`number`:return isNaN(e)?vd.nan:vd.number;case`boolean`:return vd.boolean;case`function`:return vd.function;case`bigint`:return vd.bigint;case`symbol`:return vd.symbol;case`object`:return Array.isArray(e)?vd.array:e===null?vd.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?vd.promise:typeof Map<`u`&&e instanceof Map?vd.map:typeof Set<`u`&&e instanceof Set?vd.set:typeof Date<`u`&&e instanceof Date?vd.date:vd.object;default:return vd.unknown}},K=gd.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),bd=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,`$1:`),xd=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,gd.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};xd.create=e=>new xd(e);var Sd=(e,t)=>{let n;switch(e.code){case K.invalid_type:n=e.received===vd.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case K.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,gd.jsonStringifyReplacer)}`;break;case K.unrecognized_keys:n=`Unrecognized key(s) in object: ${gd.joinValues(e.keys,`, `)}`;break;case K.invalid_union:n=`Invalid input`;break;case K.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${gd.joinValues(e.options)}`;break;case K.invalid_enum_value:n=`Invalid enum value. Expected ${gd.joinValues(e.options)}, received '${e.received}'`;break;case K.invalid_arguments:n=`Invalid function arguments`;break;case K.invalid_return_type:n=`Invalid function return type`;break;case K.invalid_date:n=`Invalid date`;break;case K.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:gd.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case K.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case K.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case K.custom:n=`Invalid input`;break;case K.invalid_intersection_types:n=`Intersection results could not be merged`;break;case K.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case K.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,gd.assertNever(e)}return{message:n}},Cd=Sd;function wd(e){Cd=e}function Td(){return Cd}var Ed=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}},Dd=[];function Od(e,t){let n=Td(),r=Ed({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Sd?void 0:Sd].filter(e=>!!e)});e.common.issues.push(r)}var kd=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return Ad;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return Ad;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},Ad=Object.freeze({status:`aborted`}),jd=e=>({status:`dirty`,value:e}),Md=e=>({status:`valid`,value:e}),Nd=e=>e.status===`aborted`,Pd=e=>e.status===`dirty`,Fd=e=>e.status===`valid`,Id=e=>typeof Promise<`u`&&e instanceof Promise;function Ld(e,t,n,r){if(n===`a`&&!r)throw TypeError(`Private accessor was defined without a getter`);if(typeof t==`function`?e!==t||!r:!t.has(e))throw TypeError(`Cannot read private member from an object whose class did not declare it`);return n===`m`?r:n===`a`?r.call(e):r?r.value:t.get(e)}function Rd(e,t,n,r,i){if(r===`m`)throw TypeError(`Private method is not writable`);if(r===`a`&&!i)throw TypeError(`Private accessor was defined without a setter`);if(typeof t==`function`?e!==t||!i:!t.has(e))throw TypeError(`Cannot write private member to an object whose class did not declare it`);return r===`a`?i.call(e,n):i?i.value=n:t.set(e,n),n}var q;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(q||={});var zd,Bd,Vd=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Hd=(e,t)=>{if(Fd(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new xd(e.common.issues);return this._error=t,this._error}}};function Ud(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Wd=class{get description(){return this._def.description}_getType(e){return yd(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:yd(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new kd,ctx:{common:e.parent.common,data:e.data,parsedType:yd(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Id(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yd(e)};return Hd(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yd(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Fd(n)?{value:n.value}:{issues:t.common.issues}}catch(e){((e?.message)?.toLowerCase())?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Fd(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:yd(e)},r=this._parse({data:e,path:n.path,parent:n});return Hd(n,await(Id(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:K.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new Jf({schema:this,typeName:sp.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Yf.create(this,this._def)}nullable(){return Xf.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return kf.create(this)}promise(){return qf.create(this,this._def)}or(e){return Mf.create([this,e],this._def)}and(e){return If.create(this,e,this._def)}transform(e){return new Jf({...Ud(this._def),schema:this,typeName:sp.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Zf({...Ud(this._def),innerType:this,defaultValue:t,typeName:sp.ZodDefault})}brand(){return new tp({typeName:sp.ZodBranded,type:this,...Ud(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Qf({...Ud(this._def),innerType:this,catchValue:t,typeName:sp.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return np.create(this,e)}readonly(){return rp.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Gd=/^c[^\s-]{8,}$/i,Kd=/^[0-9a-z]+$/,qd=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Jd=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Yd=/^[a-z0-9_-]{21}$/i,Xd=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Zd=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Qd=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,$d=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,ef,tf=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}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[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,of=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sf=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,cf=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,lf=RegExp(`^${cf}$`);function uf(e){let t=`([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`),t}function df(e){return RegExp(`^${uf(e)}$`)}function ff(e){let t=`${cf}T${uf(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function pf(e,t){return!!((t===`v4`||!t)&&tf.test(e)||(t===`v6`||!t)&&rf.test(e))}function mf(e,t){if(!Xd.test(e))return!1;try{let[n]=e.split(`.`),r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||!i.typ||!i.alg||t&&i.alg!==t)}catch{return!1}}function hf(e,t){return!!((t===`v4`||!t)&&nf.test(e)||(t===`v6`||!t)&&af.test(e))}var gf=class e extends Wd{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==vd.string){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.string,received:t.parsedType}),Ad}let t=new kd,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),Od(n,{code:K.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),Od(n,{code:K.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?Od(n,{code:K.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&Od(n,{code:K.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Qd.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`email`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)ef||=new RegExp($d,`u`),ef.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`emoji`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Jd.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`uuid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Yd.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`nanoid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)Gd.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`cuid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)Kd.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`cuid2`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)qd.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`ulid`,code:K.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),Od(n,{validation:`url`,code:K.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`regex`,code:K.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),Od(n,{code:K.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),Od(n,{code:K.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),Od(n,{code:K.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?ff(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{code:K.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?lf.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{code:K.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?df(r).test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{code:K.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Zd.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`duration`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?pf(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`ip`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?mf(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`jwt`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?hf(e.data,r.version)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`cidr`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?of.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`base64`,code:K.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?sf.test(e.data)||(n=this._getOrReturnCtx(e,n),Od(n,{validation:`base64url`,code:K.invalid_string,message:r.message}),t.dirty()):gd.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:K.invalid_string,...q.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...q.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...q.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...q.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...q.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...q.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...q.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...q.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...q.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...q.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...q.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...q.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...q.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...q.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...q.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...q.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...q.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...q.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...q.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...q.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...q.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...q.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...q.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...q.errToObj(t)})}nonempty(e){return this.min(1,q.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};gf.create=e=>new gf({checks:[],typeName:sp.ZodString,coerce:e?.coerce??!1,...Ud(e)});function _f(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return parseInt(e.toFixed(i).replace(`.`,``))%parseInt(t.toFixed(i).replace(`.`,``))/10**i}var vf=class e extends Wd{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==vd.number){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.number,received:t.parsedType}),Ad}let t,n=new kd;for(let r of this._def.checks)r.kind===`int`?gd.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),Od(t,{code:K.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Od(t,{code:K.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Od(t,{code:K.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?_f(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),Od(t,{code:K.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),Od(t,{code:K.not_finite,message:r.message}),n.dirty()):gd.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,q.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,q.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,q.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,q.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:q.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:q.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:q.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:q.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:q.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:q.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:q.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:q.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:q.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:q.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&gd.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};vf.create=e=>new vf({checks:[],typeName:sp.ZodNumber,coerce:e?.coerce||!1,...Ud(e)});var yf=class e extends Wd{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==vd.bigint)return this._getInvalidInput(e);let t,n=new kd;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),Od(t,{code:K.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),Od(t,{code:K.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),Od(t,{code:K.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):gd.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.bigint,received:t.parsedType}),Ad}gte(e,t){return this.setLimit(`min`,e,!0,q.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,q.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,q.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,q.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:q.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:q.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:q.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:q.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:q.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:q.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};yf.create=e=>new yf({checks:[],typeName:sp.ZodBigInt,coerce:e?.coerce??!1,...Ud(e)});var bf=class extends Wd{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==vd.boolean){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.boolean,received:t.parsedType}),Ad}return Md(e.data)}};bf.create=e=>new bf({typeName:sp.ZodBoolean,coerce:e?.coerce||!1,...Ud(e)});var xf=class e extends Wd{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==vd.date){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.date,received:t.parsedType}),Ad}if(isNaN(e.data.getTime()))return Od(this._getOrReturnCtx(e),{code:K.invalid_date}),Ad;let t=new kd,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),Od(n,{code:K.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),Od(n,{code:K.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):gd.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:q.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:q.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};xf.create=e=>new xf({checks:[],coerce:e?.coerce||!1,typeName:sp.ZodDate,...Ud(e)});var Sf=class extends Wd{_parse(e){if(this._getType(e)!==vd.symbol){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.symbol,received:t.parsedType}),Ad}return Md(e.data)}};Sf.create=e=>new Sf({typeName:sp.ZodSymbol,...Ud(e)});var Cf=class extends Wd{_parse(e){if(this._getType(e)!==vd.undefined){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.undefined,received:t.parsedType}),Ad}return Md(e.data)}};Cf.create=e=>new Cf({typeName:sp.ZodUndefined,...Ud(e)});var wf=class extends Wd{_parse(e){if(this._getType(e)!==vd.null){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.null,received:t.parsedType}),Ad}return Md(e.data)}};wf.create=e=>new wf({typeName:sp.ZodNull,...Ud(e)});var Tf=class extends Wd{constructor(){super(...arguments),this._any=!0}_parse(e){return Md(e.data)}};Tf.create=e=>new Tf({typeName:sp.ZodAny,...Ud(e)});var Ef=class extends Wd{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Md(e.data)}};Ef.create=e=>new Ef({typeName:sp.ZodUnknown,...Ud(e)});var Df=class extends Wd{_parse(e){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.never,received:t.parsedType}),Ad}};Df.create=e=>new Df({typeName:sp.ZodNever,...Ud(e)});var Of=class extends Wd{_parse(e){if(this._getType(e)!==vd.undefined){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.void,received:t.parsedType}),Ad}return Md(e.data)}};Of.create=e=>new Of({typeName:sp.ZodVoid,...Ud(e)});var kf=class e extends Wd{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==vd.array)return Od(t,{code:K.invalid_type,expected:vd.array,received:t.parsedType}),Ad;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(Od(t,{code:e?K.too_big:K.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(Od(t,{code:K.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(Od(t,{code:K.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Vd(t,e,t.path,n)))).then(e=>kd.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Vd(t,e,t.path,n)));return kd.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:q.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:q.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:q.toString(n)}})}nonempty(e){return this.min(1,e)}};kf.create=(e,t)=>new kf({type:e,minLength:null,maxLength:null,exactLength:null,typeName:sp.ZodArray,...Ud(t)});function Af(e){if(e instanceof jf){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Yf.create(Af(r))}return new jf({...e._def,shape:()=>t})}else if(e instanceof kf)return new kf({...e._def,type:Af(e.element)});else if(e instanceof Yf)return Yf.create(Af(e.unwrap()));else if(e instanceof Xf)return Xf.create(Af(e.unwrap()));else if(e instanceof Lf)return Lf.create(e.items.map(e=>Af(e)));else return e}var jf=class e extends Wd{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=gd.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==vd.object){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.object,received:t.parsedType}),Ad}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Df&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Vd(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Df){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(Od(n,{code:K.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Vd(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>kd.mergeObjectSync(t,e)):kd.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return q.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{var r;let i=(r=this._def).errorMap?.call(r,e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:q.errToObj(t).message??i}:{message:i}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:sp.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return gd.objectKeys(t).forEach(e=>{t[e]&&this.shape[e]&&(n[e]=this.shape[e])}),new e({...this._def,shape:()=>n})}omit(t){let n={};return gd.objectKeys(this.shape).forEach(e=>{t[e]||(n[e]=this.shape[e])}),new e({...this._def,shape:()=>n})}deepPartial(){return Af(this)}partial(t){let n={};return gd.objectKeys(this.shape).forEach(e=>{let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}),new e({...this._def,shape:()=>n})}required(t){let n={};return gd.objectKeys(this.shape).forEach(e=>{if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Yf;)t=t._def.innerType;n[e]=t}}),new e({...this._def,shape:()=>n})}keyof(){return Wf(gd.objectKeys(this.shape))}};jf.create=(e,t)=>new jf({shape:()=>e,unknownKeys:`strip`,catchall:Df.create(),typeName:sp.ZodObject,...Ud(t)}),jf.strictCreate=(e,t)=>new jf({shape:()=>e,unknownKeys:`strict`,catchall:Df.create(),typeName:sp.ZodObject,...Ud(t)}),jf.lazycreate=(e,t)=>new jf({shape:e,unknownKeys:`strip`,catchall:Df.create(),typeName:sp.ZodObject,...Ud(t)});var Mf=class extends Wd{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new xd(e.ctx.common.issues));return Od(t,{code:K.invalid_union,unionErrors:n}),Ad}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new xd(e));return Od(t,{code:K.invalid_union,unionErrors:i}),Ad}}get options(){return this._def.options}};Mf.create=(e,t)=>new Mf({options:e,typeName:sp.ZodUnion,...Ud(t)});var Nf=e=>e instanceof Hf?Nf(e.schema):e instanceof Jf?Nf(e.innerType()):e instanceof Uf?[e.value]:e instanceof Gf?e.options:e instanceof Kf?gd.objectValues(e.enum):e instanceof Zf?Nf(e._def.innerType):e instanceof Cf?[void 0]:e instanceof wf?[null]:e instanceof Yf?[void 0,...Nf(e.unwrap())]:e instanceof Xf?[null,...Nf(e.unwrap())]:e instanceof tp||e instanceof rp?Nf(e.unwrap()):e instanceof Qf?Nf(e._def.innerType):[],Pf=class e extends Wd{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==vd.object)return Od(t,{code:K.invalid_type,expected:vd.object,received:t.parsedType}),Ad;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(Od(t,{code:K.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ad)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=Nf(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:sp.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Ud(r)})}};function Ff(e,t){let n=yd(e),r=yd(t);if(e===t)return{valid:!0,data:e};if(n===vd.object&&r===vd.object){let n=gd.objectKeys(t),r=gd.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Ff(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}else if(n===vd.array&&r===vd.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ff(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===vd.date&&r===vd.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var If=class extends Wd{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Nd(e)||Nd(r))return Ad;let i=Ff(e.value,r.value);return i.valid?((Pd(e)||Pd(r))&&t.dirty(),{status:t.value,value:i.data}):(Od(n,{code:K.invalid_intersection_types}),Ad)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};If.create=(e,t,n)=>new If({left:e,right:t,typeName:sp.ZodIntersection,...Ud(n)});var Lf=class e extends Wd{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==vd.array)return Od(n,{code:K.invalid_type,expected:vd.array,received:n.parsedType}),Ad;if(n.data.length<this._def.items.length)return Od(n,{code:K.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),Ad;!this._def.rest&&n.data.length>this._def.items.length&&(Od(n,{code:K.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Vd(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>kd.mergeArray(t,e)):kd.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};Lf.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new Lf({items:e,typeName:sp.ZodTuple,rest:null,...Ud(t)})};var Rf=class e extends Wd{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==vd.object)return Od(n,{code:K.invalid_type,expected:vd.object,received:n.parsedType}),Ad;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Vd(n,e,n.path,e)),value:a._parse(new Vd(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?kd.mergeObjectAsync(t,r):kd.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Wd?new e({keyType:t,valueType:n,typeName:sp.ZodRecord,...Ud(r)}):new e({keyType:gf.create(),valueType:t,typeName:sp.ZodRecord,...Ud(n)})}},zf=class extends Wd{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==vd.map)return Od(n,{code:K.invalid_type,expected:vd.map,received:n.parsedType}),Ad;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Vd(n,e,n.path,[a,`key`])),value:i._parse(new Vd(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return Ad;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return Ad;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};zf.create=(e,t,n)=>new zf({valueType:t,keyType:e,typeName:sp.ZodMap,...Ud(n)});var Bf=class e extends Wd{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==vd.set)return Od(n,{code:K.invalid_type,expected:vd.set,received:n.parsedType}),Ad;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(Od(n,{code:K.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(Od(n,{code:K.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return Ad;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Vd(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:q.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:q.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Bf.create=(e,t)=>new Bf({valueType:e,minSize:null,maxSize:null,typeName:sp.ZodSet,...Ud(t)});var Vf=class e extends Wd{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==vd.function)return Od(t,{code:K.invalid_type,expected:vd.function,received:t.parsedType}),Ad;function n(e,n){return Ed({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Td(),Sd].filter(e=>!!e),issueData:{code:K.invalid_arguments,argumentsError:n}})}function r(e,n){return Ed({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Td(),Sd].filter(e=>!!e),issueData:{code:K.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof qf){let e=this;return Md(async function(...t){let o=new xd([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}else{let e=this;return Md(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new xd([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new xd([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:Lf.create(t).rest(Ef.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||Lf.create([]).rest(Ef.create()),returns:n||Ef.create(),typeName:sp.ZodFunction,...Ud(r)})}},Hf=class extends Wd{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Hf.create=(e,t)=>new Hf({getter:e,typeName:sp.ZodLazy,...Ud(t)});var Uf=class extends Wd{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return Od(t,{received:t.data,code:K.invalid_literal,expected:this._def.value}),Ad}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Uf.create=(e,t)=>new Uf({value:e,typeName:sp.ZodLiteral,...Ud(t)});function Wf(e,t){return new Gf({values:e,typeName:sp.ZodEnum,...Ud(t)})}var Gf=class e extends Wd{constructor(){super(...arguments),zd.set(this,void 0)}_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return Od(t,{expected:gd.joinValues(n),received:t.parsedType,code:K.invalid_type}),Ad}if(Ld(this,zd,`f`)||Rd(this,zd,new Set(this._def.values),`f`),!Ld(this,zd,`f`).has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return Od(t,{received:t.data,code:K.invalid_enum_value,options:n}),Ad}return Md(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};zd=new WeakMap,Gf.create=Wf;var Kf=class extends Wd{constructor(){super(...arguments),Bd.set(this,void 0)}_parse(e){let t=gd.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==vd.string&&n.parsedType!==vd.number){let e=gd.objectValues(t);return Od(n,{expected:gd.joinValues(e),received:n.parsedType,code:K.invalid_type}),Ad}if(Ld(this,Bd,`f`)||Rd(this,Bd,new Set(gd.getValidEnumValues(this._def.values)),`f`),!Ld(this,Bd,`f`).has(e.data)){let e=gd.objectValues(t);return Od(n,{received:n.data,code:K.invalid_enum_value,options:e}),Ad}return Md(e.data)}get enum(){return this._def.values}};Bd=new WeakMap,Kf.create=(e,t)=>new Kf({values:e,typeName:sp.ZodNativeEnum,...Ud(t)});var qf=class extends Wd{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==vd.promise&&t.common.async===!1?(Od(t,{code:K.invalid_type,expected:vd.promise,received:t.parsedType}),Ad):Md((t.parsedType===vd.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};qf.create=(e,t)=>new qf({type:e,typeName:sp.ZodPromise,...Ud(t)});var Jf=class extends Wd{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===sp.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{Od(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return Ad;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?Ad:r.status===`dirty`||t.value===`dirty`?jd(r.value):r});{if(t.value===`aborted`)return Ad;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?Ad:r.status===`dirty`||t.value===`dirty`?jd(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?Ad:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?Ad:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Fd(e))return e;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Fd(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):e);gd.assertNever(r)}};Jf.create=(e,t,n)=>new Jf({schema:e,typeName:sp.ZodEffects,effect:t,...Ud(n)}),Jf.createWithPreprocess=(e,t,n)=>new Jf({schema:t,effect:{type:`preprocess`,transform:e},typeName:sp.ZodEffects,...Ud(n)});var Yf=class extends Wd{_parse(e){return this._getType(e)===vd.undefined?Md(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Yf.create=(e,t)=>new Yf({innerType:e,typeName:sp.ZodOptional,...Ud(t)});var Xf=class extends Wd{_parse(e){return this._getType(e)===vd.null?Md(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Xf.create=(e,t)=>new Xf({innerType:e,typeName:sp.ZodNullable,...Ud(t)});var Zf=class extends Wd{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===vd.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Zf.create=(e,t)=>new Zf({innerType:e,typeName:sp.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...Ud(t)});var Qf=class extends Wd{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Id(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new xd(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new xd(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Qf.create=(e,t)=>new Qf({innerType:e,typeName:sp.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...Ud(t)});var $f=class extends Wd{_parse(e){if(this._getType(e)!==vd.nan){let t=this._getOrReturnCtx(e);return Od(t,{code:K.invalid_type,expected:vd.nan,received:t.parsedType}),Ad}return{status:`valid`,value:e.data}}};$f.create=e=>new $f({typeName:sp.ZodNaN,...Ud(e)});var ep=Symbol(`zod_brand`),tp=class extends Wd{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},np=class e extends Wd{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Ad:e.status===`dirty`?(t.dirty(),jd(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Ad:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:sp.ZodPipeline})}},rp=class extends Wd{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Fd(e)&&(e.value=Object.freeze(e.value)),e);return Id(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};rp.create=(e,t)=>new rp({innerType:e,typeName:sp.ZodReadonly,...Ud(t)});function ip(e,t){let n=typeof e==`function`?e(t):typeof e==`string`?{message:e}:e;return typeof n==`string`?{message:n}:n}function ap(e,t={},n){return e?Tf.create().superRefine((r,i)=>{let a=e(r);if(a instanceof Promise)return a.then(e=>{if(!e){let e=ip(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}});if(!a){let e=ip(t,r),a=e.fatal??n??!0;i.addIssue({code:`custom`,...e,fatal:a})}}):Tf.create()}var op={object:jf.lazycreate},sp;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(sp||={});var cp=(e,t={message:`Input not instance of ${e.name}`})=>ap(t=>t instanceof e,t),lp=gf.create,up=vf.create,dp=$f.create,fp=yf.create,pp=bf.create,mp=xf.create,hp=Sf.create,gp=Cf.create,_p=wf.create,vp=Tf.create,yp=Ef.create,bp=Df.create,xp=Of.create,Sp=kf.create,Cp=jf.create,wp=jf.strictCreate,Tp=Mf.create,Ep=Pf.create,Dp=If.create,Op=Lf.create,kp=Rf.create,Ap=zf.create,jp=Bf.create,Mp=Vf.create,Np=Hf.create,Pp=Uf.create,Fp=Gf.create,Ip=Kf.create,Lp=qf.create,Rp=Jf.create,zp=Yf.create,Bp=Xf.create,Vp=Jf.createWithPreprocess,Hp=np.create,Up=Object.freeze({__proto__:null,defaultErrorMap:Sd,setErrorMap:wd,getErrorMap:Td,makeIssue:Ed,EMPTY_PATH:Dd,addIssueToContext:Od,ParseStatus:kd,INVALID:Ad,DIRTY:jd,OK:Md,isAborted:Nd,isDirty:Pd,isValid:Fd,isAsync:Id,get util(){return gd},get objectUtil(){return _d},ZodParsedType:vd,getParsedType:yd,ZodType:Wd,datetimeRegex:ff,ZodString:gf,ZodNumber:vf,ZodBigInt:yf,ZodBoolean:bf,ZodDate:xf,ZodSymbol:Sf,ZodUndefined:Cf,ZodNull:wf,ZodAny:Tf,ZodUnknown:Ef,ZodNever:Df,ZodVoid:Of,ZodArray:kf,ZodObject:jf,ZodUnion:Mf,ZodDiscriminatedUnion:Pf,ZodIntersection:If,ZodTuple:Lf,ZodRecord:Rf,ZodMap:zf,ZodSet:Bf,ZodFunction:Vf,ZodLazy:Hf,ZodLiteral:Uf,ZodEnum:Gf,ZodNativeEnum:Kf,ZodPromise:qf,ZodEffects:Jf,ZodTransformer:Jf,ZodOptional:Yf,ZodNullable:Xf,ZodDefault:Zf,ZodCatch:Qf,ZodNaN:$f,BRAND:ep,ZodBranded:tp,ZodPipeline:np,ZodReadonly:rp,custom:ap,Schema:Wd,ZodSchema:Wd,late:op,get ZodFirstPartyTypeKind(){return sp},coerce:{string:e=>gf.create({...e,coerce:!0}),number:e=>vf.create({...e,coerce:!0}),boolean:e=>bf.create({...e,coerce:!0}),bigint:e=>yf.create({...e,coerce:!0}),date:e=>xf.create({...e,coerce:!0})},any:vp,array:Sp,bigint:fp,boolean:pp,date:mp,discriminatedUnion:Ep,effect:Rp,enum:Fp,function:Mp,instanceof:cp,intersection:Dp,lazy:Np,literal:Pp,map:Ap,nan:dp,nativeEnum:Ip,never:bp,null:_p,nullable:Bp,number:up,object:Cp,oboolean:()=>pp().optional(),onumber:()=>up().optional(),optional:zp,ostring:()=>lp().optional(),pipeline:Hp,preprocess:Vp,promise:Lp,record:kp,set:jp,strictObject:wp,string:lp,symbol:hp,transformer:Rp,tuple:Op,undefined:gp,union:Tp,unknown:yp,void:xp,NEVER:Ad,ZodIssueCode:K,quotelessJson:bd,ZodError:xd}),Wp={name:`@imgly/background-removal`,version:`1.7.0`,description:`Background Removal in the Browser`,keywords:[`background-removal`,`client-side`,`data-privacy`,`image-segmentation`,`image-matting`,`onnx`],repository:{type:`git`,url:`git+https://github.com/imgly/background-removal-js.git`},license:`SEE LICENSE IN LICENSE.md`,author:{name:`IMG.LY GmbH`,email:`support@img.ly`,url:`https://img.ly`},bugs:{email:`support@img.ly`},source:`./src/index.ts`,main:`./dist/index.cjs`,module:`./dist/index.mjs`,types:`./dist/src/index.d.ts`,exports:{".":{require:`./dist/index.cjs`,import:`./dist/index.mjs`,types:`./dist/src/index.d.ts`}},homepage:`https://img.ly/showcases/cesdk/web/background-removal`,files:[`LICENSE.md`,`README.md`,`CHANGELOG.md`,`ThirdPartyLicenses.json`,`dist/`,`bin/`],scripts:{start:`pnpm run watch`,clean:`npx rimraf dist`,test:`true`,resources:`node ../../scripts/package-resources.mjs`,"changelog:create":`node ../../scripts/changelog/changelog-create.mjs`,"changelog:generate":`node ../../scripts/changelog/changelog-generate.mjs`,build:`pnpm run clean && pnpm run types && pnpm run resources && pnpm run changelog:generate && node scripts/build.mjs`,types:` npx tsc --declaration --emitDeclarationOnly --declarationDir dist --declarationMap`,watch:`pnpm run clean && pnpm run resources && pnpm run changelog:generate && node scripts/watch.mjs`,"publish:latest":`pnpm publish --tag latest --access public`,"publish:next":`pnpm publish --tag next --access public`,"package:pack":`pnpm pack . --pack-destination ../../releases`,"check:all":`pnpm run check:pretty`,"check:pretty":`prettier --list-different './src/**/*.{ts,tsx}'`,pretty:`prettier --write './src/**/*.{ts,tsx}'`},dependencies:{"lodash-es":`^4.17.21`,ndarray:`~1.0.0`,zod:`^3.23.8`},peerDependencies:{"onnxruntime-web":`1.21.0`},devDependencies:{"@types/lodash-es":`^4.17.12`,"@types/ndarray":`~1.0.14`,"@types/node":`~20.3.0`,assert:`~2.0.0`,esbuild:`~0.18.0`,glob:`~10.3.0`,"npm-dts":`~1.3.0`,process:`~0.11.0`,"ts-loader":`~9.4.0`,tslib:`~2.5.0`,typescript:`~5.1.0`,util:`~0.12.0`,webpack:`~5.85.0`,"webpack-cli":`~5.1.0`}},Gp=Up.object({publicPath:Up.string().optional().describe(`The public path to the wasm files and the onnx model.`).default("https://staticimgly.com/@imgly/background-removal-data/${PACKAGE_VERSION}/dist/").transform(e=>e.replace("${PACKAGE_NAME}",Wp.name).replace("${PACKAGE_VERSION}",Wp.version)),debug:Up.boolean().default(!1).describe(`Whether to enable debug logging.`),rescale:Up.boolean().default(!0).describe(`Whether to rescale the image.`),device:Up.enum([`cpu`,`gpu`]).default(`cpu`).describe(`The device to run the model on.`),proxyToWorker:Up.boolean().default(!1).describe(`Whether to proxy inference to a web worker.`),fetchArgs:Up.any().default({}).describe(`Arguments to pass to fetch when loading the model.`),progress:Up.function().args(Up.string(),Up.number(),Up.number()).returns(Up.void()).describe(`Progress callback.`).optional(),model:Up.preprocess(e=>{switch(e){case`large`:return`isnet`;case`small`:return`isnet_quint8`;case`medium`:return`isnet_fp16`;default:return e}},Up.enum([`isnet`,`isnet_fp16`,`isnet_quint8`])).default(`medium`),output:Up.object({format:Up.enum([`image/png`,`image/jpeg`,`image/webp`,`image/x-rgba8`,`image/x-alpha8`]).default(`image/png`),quality:Up.number().default(.8)}).default({})}).default({}).transform(e=>(e.debug&&console.log(`Config:`,e),e.debug&&!e.progress&&(e.progress=e.progress??((e,t,n)=>{console.debug(`Downloading ${e}: ${t} of ${n}`)}),crossOriginIsolated||e.debug&&console.debug(`Cross-Origin-Isolated is not enabled. Performance will be degraded. Please see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer.`)),e));function Kp(e){return Gp.parse(e??{})}var qp=Zc(el());async function Jp(e){e.debug&&console.debug(`Loading model...`,e.model);let t=e.model;return await md(await(await dd(`/models/${t}`,e)).arrayBuffer(),e)}async function Yp(e){e=Kp(e);let t=await Jp(e);return{config:e,session:{base:t}}}async function Xp(e,t,n){let r=1024,[i,a,o]=e.shape,s=nd(e,r,r,!1),c=rd(s),l=await hd(n.base,[[`input`,c]],[`output`],t),u=ad((0,qp.default)(l[0].data,[r,r,1]));return t.rescale?(u=nd(u,a,i,!1),[u,e]):[u,s]}var Zp=Ku(Yp,e=>JSON.stringify(e));async function Qp(e,t){let{config:n,session:r}=await Zp(t);n.progress&&n.progress(`compute:decode`,0,4);let i=await id(e,n);n.progress?.(`compute:inference`,1,4);let[a,o]=await Xp(i,n,r);n.progress?.(`compute:mask`,2,4);let s=o,[c,l]=s.shape,u=c*l;for(let e=0;e<u;e+=1)s.data[4*e+3]=a.data[e];n.progress?.(`compute:encode`,3,4);let d=await Zu(s,n.output.quality,n.output.format);return n.progress?.(`compute:encode`,4,4),d}async function $p(e,t={}){let{onProgress:n,backdrop:r=`transparent`,colorHex:i=`#FFFFFF`,addShadow:a=!1}=t;n?.(10,`Menyiapkan alat pemotong foto...`);let o;try{o=await Qp(e,{progress:(e,t,r)=>{if(r>0){let i=Math.min(1,t/r),a=Math.round(15+i*75),o=e.includes(`fetch`)?`Mengunduh komponen pemotong...`:e.includes(`compute`)?`Memisahkan foto dari latar belakang...`:`Memproses foto...`;n?.(a,o)}}})}catch(t){console.warn(`[AI BgRemoval] Model error, attempting canvas fallback:`,t),n?.(50,`Merapikan potongan foto...`),o=await tm(e)}if(n?.(92,`Merapikan hasil akhir...`),r===`transparent`&&!a)return n?.(100,`Selesai!`),o;let s=await em(o,{backdrop:r,colorHex:i,addShadow:a});return n?.(100,`Complete!`),s}async function em(e,t){return new Promise((n,r)=>{let i=new Image,a=URL.createObjectURL(e);i.onload=()=>{URL.revokeObjectURL(a);let e=document.createElement(`canvas`);e.width=i.naturalWidth,e.height=i.naturalHeight;let o=e.getContext(`2d`);if(!o)return r(Error(`Canvas 2D unavailable`));t.backdrop===`color`&&t.colorHex&&(o.fillStyle=t.colorHex,o.fillRect(0,0,e.width,e.height)),t.addShadow&&(o.shadowColor=`rgba(0, 0, 0, 0.25)`,o.shadowBlur=18,o.shadowOffsetX=0,o.shadowOffsetY=10),o.drawImage(i,0,0),e.toBlob(e=>{if(!e)return r(Error(`Canvas export failed`));n(e)},`image/png`)},i.onerror=()=>r(Error(`Failed to load cutout image`)),i.src=a})}async function tm(e){return new Promise((t,n)=>{let r=new Image,i=URL.createObjectURL(e);r.onload=()=>{URL.revokeObjectURL(i);let e=document.createElement(`canvas`);e.width=r.naturalWidth,e.height=r.naturalHeight;let a=e.getContext(`2d`,{willReadFrequently:!0});if(!a)return n(Error(`Canvas 2D unavailable`));a.drawImage(r,0,0);let o=a.getImageData(0,0,e.width,e.height),s=o.data,c=(t,n)=>{let r=(n*e.width+t)*4;return[s[r],s[r+1],s[r+2]]},l=[c(0,0),c(e.width-1,0),c(0,e.height-1),c(e.width-1,e.height-1)],u=[Math.round(l.reduce((e,t)=>e+t[0],0)/4),Math.round(l.reduce((e,t)=>e+t[1],0)/4),Math.round(l.reduce((e,t)=>e+t[2],0)/4)];for(let e=0;e<s.length;e+=4){let t=s[e],n=s[e+1],r=s[e+2],i=Math.sqrt((t-u[0])**2+(n-u[1])**2+(r-u[2])**2);i<38?s[e+3]=0:i<56&&(s[e+3]=Math.round((i-38)/18*255))}a.putImageData(o,0,0),e.toBlob(e=>{if(!e)return n(Error(`Fallback export failed`));t(e)},`image/png`)},r.onerror=()=>n(Error(`Failed to load image`)),r.src=i})}function nm({items:e,onAddFiles:t,onRemoveItem:n,onReorder:r,onClear:i,onOpenDrivePicker:a,accept:o,allowReorder:s=!1,disabled:c=!1,selectedIds:l,onSelectionChange:u,primaryAction:d}){let f=(0,v.useRef)(null),[p,m]=(0,v.useState)(()=>e.map(e=>e.id)),h=l!==void 0,g=h?l:p;(0,v.useEffect)(()=>{let t=new Set(e.map(e=>e.id)),n=e.map(e=>e.id);if(h){if(u){let n=l.filter(e=>t.has(e)),r=e.filter(e=>!l.includes(e.id)).map(e=>e.id);(r.length>0||n.length!==l.length)&&u([...n,...r])}}else m(n)},[e.length]);let _=e=>{h?u?.(e):m(e)},y=()=>{g.length===e.length?_([]):_(e.map(e=>e.id))},b=e=>{g.includes(e)?_(g.filter(t=>t!==e)):_([...g,e])},x=e.filter(e=>g.includes(e.id)).reduce((e,t)=>e+t.file.size,0),S=e=>{e.preventDefault()},C=e=>{if(e.preventDefault(),c)return;let n=Array.from(e.dataTransfer.files);n.length>0&&t(n)},w=e=>{e.target.files&&e.target.files.length>0&&(t(Array.from(e.target.files)),e.target.value=``)},T=(t,n)=>{if(!r)return;let i=[...e],a=n===`up`?t-1:t+1;if(a<0||a>=i.length)return;let o=i[t];i[t]=i[a],i[a]=o,r(i)};return(0,U.jsxs)(`div`,{className:`space-y-3.5`,children:[(0,U.jsxs)(`div`,{onDragOver:S,onDrop:C,onClick:()=>f.current?.click(),className:`flex flex-col items-center justify-center p-6 border border-dashed border-[#E0E3E7] dark:border-[#36373A] rounded-2xl bg-[#F8FAFD] dark:bg-[#1E1F20] hover:border-[#0B57D0] transition-colors text-center cursor-pointer`,children:[(0,U.jsx)(`input`,{ref:f,type:`file`,multiple:!0,accept:o,onChange:w,className:`hidden`}),(0,U.jsx)(`div`,{className:`w-10 h-10 rounded-full bg-[#EDF2FC] dark:bg-[#28292A] text-[#0B57D0] dark:text-[#A8C7FA] flex items-center justify-center mb-2.5 pointer-events-none`,children:(0,U.jsx)(Li,{className:`w-5 h-5`})}),(0,U.jsx)(`h3`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3] mb-1 pointer-events-none`,children:`Tarik & lepaskan berkas ke sini, atau pilih dari sumber`}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mb-4 pointer-events-none`,children:`Klik di mana saja atau seret berkas untuk memproses secara batch`}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2.5`,children:[(0,U.jsxs)(G,{type:`button`,size:`sm`,onClick:e=>{e.stopPropagation(),f.current?.click()},disabled:c,className:`h-9 px-4 text-xs font-medium rounded-full bg-[#0B57D0] hover:bg-[#0B57D0]/90 text-white shadow-xs`,children:[(0,U.jsx)(xi,{className:`w-3.5 h-3.5 mr-1.5`}),`Unggah dari Perangkat`]}),(0,U.jsxs)(G,{type:`button`,variant:`outline`,size:`sm`,onClick:e=>{e.stopPropagation(),a()},disabled:c,className:`h-9 px-4 text-xs font-medium rounded-full border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#28292A] text-[#1F1F1F] dark:text-[#E3E3E3] hover:bg-[#F0F4F9] dark:hover:bg-[#333537]`,children:[(0,U.jsx)(jr,{className:`w-3.5 h-3.5 mr-1.5 text-[#0B57D0] dark:text-[#A8C7FA]`}),`Ambil dari 9Drive`]})]})]}),e.length>0&&(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 p-3 rounded-2xl bg-[#F8FAFD] dark:bg-[#1E1F20]/70 border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer select-none`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:e.length>0&&g.length===e.length,ref:t=>{t&&(t.indeterminate=g.length>0&&g.length<e.length)},onChange:y,disabled:c,className:`w-4 h-4 rounded text-[#0B57D0] focus:ring-[#0B57D0] border-[#C4C7C5] dark:border-[#535756] cursor-pointer accent-[#0B57D0]`}),(0,U.jsx)(`span`,{className:`text-xs sm:text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Pilih Semua`})]}),(0,U.jsxs)(`span`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(`span`,{className:`text-[#0B57D0] dark:text-[#A8C7FA] font-medium`,children:g.length}),` dari `,e.length,` dipilih`]}),(0,U.jsxs)(`span`,{className:`text-xs text-[#747775] dark:text-[#8E918F] hidden sm:inline`,children:[`• `,wo(x)]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5 shrink-0 self-end sm:self-auto`,children:[(0,U.jsxs)(`button`,{type:`button`,onClick:i,disabled:c,className:`text-xs text-[#747775] hover:text-[#B3261E] dark:hover:text-[#F2B8B5] transition-colors flex items-center gap-1 font-medium px-2.5 py-1.5 rounded-full hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`,children:[(0,U.jsx)(Fi,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:`Kosongkan`})]}),d]})]}),e.length>0&&(0,U.jsx)(`div`,{className:`space-y-2 max-h-[420px] overflow-y-auto pr-1`,children:e.map((t,i)=>{let a=g.includes(t.id),o=t.file.type.startsWith(`image/`),l=t.file.type.includes(`pdf`)||t.file.name.toLowerCase().endsWith(`.pdf`);return(0,U.jsxs)(`div`,{onClick:()=>!c&&b(t.id),className:`flex items-center justify-between p-3 rounded-xl border transition-all cursor-pointer select-none ${a?`bg-white dark:bg-[#1E1F20] border-[#0B57D0]/40 shadow-xs`:`bg-[#F8FAFD]/60 dark:bg-[#1E1F20]/40 border-[#E0E3E7] dark:border-[#36373A] opacity-75`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:a,onChange:e=>{e.stopPropagation(),b(t.id)},onClick:e=>e.stopPropagation(),disabled:c,className:`w-4 h-4 rounded text-[#0B57D0] focus:ring-[#0B57D0] border-[#C4C7C5] dark:border-[#535756] cursor-pointer accent-[#0B57D0] shrink-0`,"aria-label":`Pilih ${t.file.name}`}),(0,U.jsx)(`div`,{className:`w-10 h-10 rounded-lg overflow-hidden bg-[#F0F4F9] dark:bg-[#28292A] flex items-center justify-center shrink-0 border border-[#E0E3E7]/60 dark:border-[#36373A]/60 pointer-events-none`,children:t.thumbnailUrl?(0,U.jsx)(`img`,{src:t.thumbnailUrl,alt:``,className:`w-full h-full object-cover`}):o?(0,U.jsx)($r,{className:`w-5 h-5 text-[#0B57D0]`}):l?(0,U.jsx)(Wr,{className:`w-5 h-5 text-[#D93025]`}):(0,U.jsx)(Wr,{className:`w-5 h-5 text-[#747775]`})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1 pointer-events-none`,children:[(0,U.jsx)(`p`,{className:`text-sm font-medium text-[#1F1F1F] dark:text-[#E3E3E3] truncate`,children:t.file.name}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,U.jsx)(`span`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:wo(t.file.size)}),t.statusMessage&&(0,U.jsxs)(`span`,{className:`text-xs text-[#0B57D0] dark:text-[#A8C7FA] truncate`,children:[`• `,t.statusMessage]})]}),t.status===`processing`&&t.progress!==void 0&&(0,U.jsx)(`div`,{className:`w-full h-1 bg-[#E0E3E7] dark:bg-[#36373A] rounded-full overflow-hidden mt-1.5`,children:(0,U.jsx)(`div`,{className:`h-full bg-[#0B57D0] transition-all duration-300`,style:{width:`${t.progress}%`}})})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5 shrink-0 ml-2`,onClick:e=>e.stopPropagation(),children:[t.status===`idle`&&(0,U.jsx)(`span`,{className:`px-2 py-0.5 text-[10px] font-medium rounded-full bg-slate-100 text-slate-700 dark:bg-slate-800 dark:text-slate-300`,children:`Siap`}),t.status===`processing`&&(0,U.jsxs)(`span`,{className:`px-2 py-0.5 text-[10px] font-medium rounded-full bg-[#C2E7FF] text-[#001D35] dark:bg-[#004A77] dark:text-[#C2E7FF] flex items-center gap-1`,children:[(0,U.jsx)(oi,{className:`w-3 h-3 animate-spin`}),t.progress??0,`%`]}),t.status===`completed`&&(0,U.jsxs)(`span`,{className:`px-2 py-0.5 text-[10px] font-medium rounded-full bg-[#E6F4EA] text-[#0F9D58] dark:bg-[#0F9D58]/20 dark:text-[#6DD58C] flex items-center gap-1`,children:[(0,U.jsx)(Tr,{className:`w-3 h-3`}),`Selesai`]}),t.status===`error`&&(0,U.jsxs)(`span`,{className:`px-2 py-0.5 text-[10px] font-medium rounded-full bg-[#FCE8E6] text-[#D93025] dark:bg-[#D93025]/20 dark:text-[#F2B8B5] flex items-center gap-1`,children:[(0,U.jsx)(Or,{className:`w-3 h-3`}),`Gagal`]}),s&&r&&e.length>1&&(0,U.jsxs)(`div`,{className:`flex items-center gap-0.5 border-l border-[#E0E3E7] dark:border-[#36373A] pl-1 ml-1`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>T(i,`up`),disabled:i===0||c,className:`p-1 rounded text-[#747775] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A] disabled:opacity-30`,title:`Geser ke atas`,children:(0,U.jsx)(_r,{className:`w-3.5 h-3.5`})}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>T(i,`down`),disabled:i===e.length-1||c,className:`p-1 rounded text-[#747775] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A] disabled:opacity-30`,title:`Geser ke bawah`,children:(0,U.jsx)(hr,{className:`w-3.5 h-3.5`})})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>n(t.id),disabled:c,className:`p-1.5 rounded-full text-[#747775] hover:text-[#B3261E] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A] transition-colors`,title:`Hapus dari antrean`,children:(0,U.jsx)(Fi,{className:`w-3.5 h-3.5`})})]})]},t.id)})})]})}function rm({originalUrl:e,cutoutUrl:t,className:n=``,alt:r=`Image preview`}){let[i,a]=(0,v.useState)(50),[o,s]=(0,v.useState)(!1),[c,l]=(0,v.useState)(`slider`),[u,d]=(0,v.useState)(!1),[f,p]=(0,v.useState)(`transparent`),m=(0,v.useRef)(null),h=e=>{if(!m.current)return;let t=m.current.getBoundingClientRect(),n=Math.max(0,Math.min(e-t.left,t.width));a(Math.max(0,Math.min(100,n/t.width*100)))};return(0,v.useEffect)(()=>{let e=()=>s(!1),t=e=>{o&&h(e.clientX)},n=e=>{o&&e.touches[0]&&h(e.touches[0].clientX)};return o&&(window.addEventListener(`mouseup`,e),window.addEventListener(`mousemove`,t),window.addEventListener(`touchend`,e),window.addEventListener(`touchmove`,n)),()=>{window.removeEventListener(`mouseup`,e),window.removeEventListener(`mousemove`,t),window.removeEventListener(`touchend`,e),window.removeEventListener(`touchmove`,n)}},[o]),(0,U.jsxs)(`div`,{className:`flex flex-col gap-3 ${n}`,children:[(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 px-1`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-1 bg-[#F0F4F9] dark:bg-[#28292A] p-0.5 rounded-full text-xs`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>l(`slider`),className:`px-3 py-1 rounded-full font-medium transition-all ${c===`slider`?`bg-white dark:bg-[#1E1F20] text-[#0B57D0] dark:text-[#A8C7FA] shadow-xs`:`text-[#444746] dark:text-[#C4C7C5]`}`,children:`Slider`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>l(`side`),className:`px-3 py-1 rounded-full font-medium transition-all ${c===`side`?`bg-white dark:bg-[#1E1F20] text-[#0B57D0] dark:text-[#A8C7FA] shadow-xs`:`text-[#444746] dark:text-[#C4C7C5]`}`,children:`Berdampingan`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{l(`toggle`),d(!1)},className:`px-3 py-1 rounded-full font-medium transition-all ${c===`toggle`?`bg-white dark:bg-[#1E1F20] text-[#0B57D0] dark:text-[#A8C7FA] shadow-xs`:`text-[#444746] dark:text-[#C4C7C5]`}`,children:`Toggle`})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsxs)(`span`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F] flex items-center gap-1`,children:[(0,U.jsx)(_i,{className:`w-3.5 h-3.5`}),` Latar:`]}),(0,U.jsx)(`div`,{className:`flex items-center gap-1`,children:[{label:`Transparent`,value:`transparent`,class:`checkerboard-bg`},{label:`White`,value:`#FFFFFF`},{label:`Dark`,value:`#1E1F20`},{label:`Merah Pasfoto`,value:`#D32F2F`},{label:`Biru Pasfoto`,value:`#1976D2`}].map(e=>(0,U.jsx)(`button`,{type:`button`,title:e.label,onClick:()=>p(e.value),className:`w-5 h-5 rounded-full border transition-all ${f===e.value?`ring-2 ring-[#0B57D0] scale-110`:`border-[#E0E3E7] dark:border-[#36373A]`} ${e.class||``}`,style:e.value===`transparent`?{}:{backgroundColor:e.value}},e.label))})]})]}),c===`slider`&&(0,U.jsxs)(`div`,{ref:m,onMouseDown:()=>s(!0),onTouchStart:()=>s(!0),className:`relative w-full h-[380px] sm:h-[440px] rounded-2xl overflow-hidden select-none cursor-ew-resize border border-[#E0E3E7] dark:border-[#36373A]`,style:f===`transparent`?{backgroundImage:`repeating-conic-gradient(#80808020 0% 25%, transparent 0% 50%)`,backgroundSize:`20px 20px`}:{backgroundColor:f},children:[(0,U.jsx)(`img`,{src:t,alt:`${r} - cutout`,className:`absolute inset-0 w-full h-full object-contain pointer-events-none`}),(0,U.jsx)(`div`,{className:`absolute inset-y-0 left-0 overflow-hidden pointer-events-none bg-white dark:bg-[#1E1F20]`,style:{width:`${i}%`},children:(0,U.jsx)(`img`,{src:e,alt:`${r} - original`,className:`absolute inset-y-0 left-0 max-w-none w-full h-full object-contain`,style:{width:m.current?`${m.current.clientWidth}px`:`100%`}})}),(0,U.jsx)(`div`,{className:`absolute inset-y-0 w-1 bg-white shadow-[0_0_10px_rgba(0,0,0,0.5)] cursor-ew-resize`,style:{left:`calc(${i}% - 2px)`},children:(0,U.jsx)(`div`,{className:`absolute top-1/2 -translate-y-1/2 -left-4 w-9 h-9 rounded-full bg-white shadow-lg border border-black/10 flex items-center justify-center text-[#1F1F1F]`,children:(0,U.jsx)(mi,{className:`w-4 h-4`})})}),(0,U.jsx)(`div`,{className:`absolute bottom-3 left-3 px-2.5 py-1 rounded-lg bg-black/60 backdrop-blur-xs text-white text-[11px] font-medium pointer-events-none`,children:`Original`}),(0,U.jsx)(`div`,{className:`absolute bottom-3 right-3 px-2.5 py-1 rounded-lg bg-black/60 backdrop-blur-xs text-white text-[11px] font-medium pointer-events-none`,children:`Removed Background`})]}),c===`side`&&(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-4`,children:[(0,U.jsxs)(`div`,{className:`relative h-[320px] rounded-3xl overflow-hidden border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20]`,children:[(0,U.jsx)(`img`,{src:e,alt:`${r} - original`,className:`w-full h-full object-contain p-2`}),(0,U.jsx)(`div`,{className:`absolute bottom-3 left-3 px-2.5 py-1 rounded-lg bg-black/60 backdrop-blur-xs text-white text-[11px] font-medium`,children:`Original`})]}),(0,U.jsxs)(`div`,{className:`relative h-[320px] rounded-3xl overflow-hidden border border-[#E0E3E7] dark:border-[#36373A]`,style:f===`transparent`?{backgroundImage:`repeating-conic-gradient(#80808020 0% 25%, transparent 0% 50%)`,backgroundSize:`20px 20px`}:{backgroundColor:f},children:[(0,U.jsx)(`img`,{src:t,alt:`${r} - cutout`,className:`w-full h-full object-contain p-2`}),(0,U.jsx)(`div`,{className:`absolute bottom-3 right-3 px-2.5 py-1 rounded-lg bg-black/60 backdrop-blur-xs text-white text-[11px] font-medium`,children:`Removed Background`})]})]}),c===`toggle`&&(0,U.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,U.jsxs)(`div`,{className:`relative w-full h-[400px] rounded-3xl overflow-hidden border border-[#E0E3E7] dark:border-[#36373A]`,style:!u&&f!==`transparent`?{backgroundColor:f}:u?{backgroundColor:`#FFFFFF`}:{backgroundImage:`repeating-conic-gradient(#80808020 0% 25%, transparent 0% 50%)`,backgroundSize:`20px 20px`},children:[(0,U.jsx)(`img`,{src:u?e:t,alt:r,className:`w-full h-full object-contain p-4 transition-all duration-200`}),(0,U.jsx)(`div`,{className:`absolute bottom-3 left-3 px-2.5 py-1 rounded-lg bg-black/60 backdrop-blur-xs text-white text-[11px] font-medium`,children:u?`Showing: Original`:`Showing: Removed Background`})]}),(0,U.jsxs)(`button`,{type:`button`,onMouseDown:()=>d(!0),onMouseUp:()=>d(!1),onTouchStart:()=>d(!0),onTouchEnd:()=>d(!1),className:`flex items-center gap-2 py-2 px-5 rounded-full text-xs font-medium bg-[#0B57D0] text-white hover:bg-[#0B57D0]/90 active:scale-95 transition-all shadow-md select-none`,children:[(0,U.jsx)(Br,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Hold to See Original`})]})]})]})}function im({title:e,description:t,acceptedFormats:n=[],accept:r,icon:i,iconColor:a=`#0B57D0`,maxSizeText:o=`Hingga 2 GB per berkas`,multiple:s=!1,disabled:c=!1,onFilesSelected:l,onOpenDrivePicker:u,className:d=``}){let f=(0,v.useRef)(null),[p,m]=(0,v.useState)(!1),h=(0,v.useRef)(0);return(0,U.jsxs)(`div`,{onClick:()=>f.current?.click(),onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),h.current+=1,e.dataTransfer.items&&e.dataTransfer.items.length>0&&m(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),--h.current,h.current<=0&&(h.current=0,m(!1))},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:e=>{if(e.preventDefault(),e.stopPropagation(),h.current=0,m(!1),c)return;let t=Array.from(e.dataTransfer.files);t.length>0&&l(s?t:[t[0]])},className:`relative flex flex-col items-center justify-center p-8 sm:p-12 rounded-3xl border-2 border-dashed transition-all duration-200 select-none text-center cursor-pointer group ${p?`border-[#0B57D0] bg-[#C2E7FF]/20 dark:border-[#A8C7FA] dark:bg-[#004A77]/30 scale-[1.005]`:`border-[#E0E3E7] bg-white hover:border-[#0B57D0] hover:bg-[#F8FAFD] dark:border-[#36373A] dark:bg-[#1E1F20] dark:hover:border-[#A8C7FA] dark:hover:bg-[#28292A]`} ${d}`,children:[(0,U.jsx)(`input`,{ref:f,type:`file`,multiple:s,accept:r,onChange:e=>{if(e.target.files&&e.target.files.length>0){let t=Array.from(e.target.files);l(s?t:[t[0]]),e.target.value=``}},disabled:c,className:`hidden`}),(0,U.jsx)(`div`,{className:`w-16 h-16 sm:w-20 sm:h-20 rounded-2xl flex items-center justify-center mb-4 transition-transform duration-200 ${p?`scale-110`:`group-hover:scale-105`} bg-[#F0F4F9] dark:bg-[#28292A]`,style:{color:a},children:i?(0,U.jsx)(i,{size:36}):(0,U.jsx)(Li,{className:`w-8 h-8 text-[#0B57D0] dark:text-[#A8C7FA]`})}),(0,U.jsx)(`h2`,{className:`text-base sm:text-lg font-medium text-[#1F1F1F] dark:text-[#E3E3E3] max-w-md leading-snug group-hover:text-[#0B57D0] dark:group-hover:text-[#A8C7FA] transition-colors`,children:p?`Lepaskan berkas di sini untuk langsung memproses`:e}),(0,U.jsx)(`p`,{className:`text-xs sm:text-sm text-[#444746] dark:text-[#C4C7C5] mt-1.5 max-w-sm leading-relaxed`,children:t}),(0,U.jsx)(`span`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F] mt-2 block`,children:`Klik di mana saja atau seret berkas ke kotak ini`}),(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-3 mt-5`,children:[(0,U.jsxs)(G,{type:`button`,onClick:e=>{e.stopPropagation(),f.current?.click()},disabled:c,className:`h-11 px-6 rounded-full text-xs sm:text-sm font-medium bg-[#0B57D0] hover:bg-[#0842A0] text-white shadow-xs transition-colors flex items-center gap-2 cursor-pointer`,children:[(0,U.jsx)(xi,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{children:`Pilih dari Perangkat`})]}),u&&(0,U.jsxs)(G,{type:`button`,variant:`outline`,onClick:e=>{e.stopPropagation(),u()},disabled:c,className:`h-11 px-6 rounded-full text-xs sm:text-sm font-medium border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] text-[#1F1F1F] dark:text-[#E3E3E3] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A] transition-colors flex items-center gap-2 cursor-pointer`,children:[(0,U.jsx)(jr,{className:`w-4 h-4 text-[#0B57D0] dark:text-[#A8C7FA]`}),(0,U.jsx)(`span`,{children:`Pilih dari 9Drive`})]})]}),(n.length>0||o)&&(0,U.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-1.5 mt-6 pt-5 border-t border-[#E0E3E7]/60 dark:border-[#36373A]/60 w-full max-w-md`,children:[n.map(e=>(0,U.jsx)(`span`,{className:`px-2.5 py-0.5 rounded-full text-[11px] font-medium bg-[#F0F4F9] text-[#444746] dark:bg-[#28292A] dark:text-[#C4C7C5]`,children:e},e)),o&&(0,U.jsxs)(`span`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F] ml-1`,children:[`• `,o]})]})]})}function am({open:e,onClose:t,onSelectFiles:n,acceptFilter:r=`all`,multiple:i=!0}){let[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(new Set),[p,m]=(0,v.useState)(``);if((0,v.useEffect)(()=>{if(!e){f(new Set);return}async function t(){c(!0);try{let e=(await W(`/files?status=active`)).files||[];r===`image`?e=e.filter(e=>e.mimeType?.startsWith(`image/`)||/\.(png|jpe?g|webp|gif|bmp|svg)$/i.test(e.name)):r===`pdf`?e=e.filter(e=>e.mimeType?.includes(`pdf`)||e.name.toLowerCase().endsWith(`.pdf`)):r===`video`&&(e=e.filter(e=>e.mimeType?.startsWith(`video/`)||/\.(mp4|webm|mkv|mov|avi)$/i.test(e.name))),o(e)}catch(e){console.error(`Failed to load drive files:`,e)}finally{c(!1)}}t()},[e,r]),!e)return null;let h=a.filter(e=>e.name.toLowerCase().includes(p.toLowerCase())),g=e=>{f(t=>{let n=new Set(t);return n.has(e)?n.delete(e):(i||n.clear(),n.add(e)),n})},_=async()=>{if(d.size!==0){u(!0);try{let e=a.filter(e=>d.has(e.id)),r=[];for(let t of e){let e=Yn(),n={};e&&(n.Authorization=`Bearer ${e}`);let i=await fetch(`/cdn/raw/${t.id}`,{headers:n});if(!i.ok)throw Error(`Gagal mengunduh berkas ${t.name}`);let a=await i.blob(),o=new File([a],t.name,{type:t.mimeType||`application/octet-stream`});r.push(o)}n(r),t()}catch(e){console.error(`Error importing files from 9Drive:`,e),alert(`Gagal mengambil berkas dari 9Drive.`)}finally{u(!1)}}};function y(e,t){return e.startsWith(`image/`)||/\.(png|jpe?g|webp)$/i.test(t)?`image`:e.includes(`pdf`)||t.toLowerCase().endsWith(`.pdf`)?`pdf`:e.startsWith(`video/`)?`video`:`doc`}return(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/32 backdrop-blur-xs animate-in fade-in duration-200`,children:(0,U.jsxs)(`div`,{className:`flex flex-col w-full max-w-xl max-h-[85vh] bg-white dark:bg-[#1E1F20] rounded-[28px] shadow-2xl border border-[#E0E3E7] dark:border-[#36373A] overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-b border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Pilih dari 9Drive`}),(0,U.jsxs)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mt-0.5`,children:[`Pilih berkas `,r===`image`?`gambar`:r===`pdf`?`PDF`:``,` yang tersimpan di Drive`]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:t,className:`flex items-center justify-center w-8 h-8 rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,children:(0,U.jsx)(Hi,{className:`w-5 h-5`})})]}),(0,U.jsx)(`div`,{className:`px-6 py-2.5 border-b border-[#E0E3E7]/60 dark:border-[#36373A]/60 bg-[#F8FAFD] dark:bg-[#131314]`,children:(0,U.jsxs)(`div`,{className:`relative`,children:[(0,U.jsx)(Ti,{className:`absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[#747775]`}),(0,U.jsx)(Os,{type:`text`,placeholder:`Cari berkas di 9Drive...`,value:p,onChange:e=>m(e.target.value),className:`pl-9 h-8 text-xs rounded-full bg-white dark:bg-[#28292A] border-[#E0E3E7] dark:border-[#36373A]`})]})}),(0,U.jsx)(`div`,{className:`flex-1 overflow-y-auto p-4 space-y-1 min-h-[260px]`,children:s?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-48 gap-2 text-xs text-[#747775]`,children:[(0,U.jsx)(oi,{className:`w-5 h-5 animate-spin text-[#0B57D0]`}),(0,U.jsx)(`span`,{children:`Memuat daftar berkas...`})]}):h.length===0?(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-48 gap-2 text-xs text-[#747775] text-center`,children:[(0,U.jsx)(Yr,{className:`w-7 h-7 text-[#747775]/50`}),(0,U.jsxs)(`p`,{children:[`Tidak ada berkas `,r,` yang cocok di 9Drive.`]})]}):h.map(e=>{let t=d.has(e.id);return(0,U.jsxs)(`div`,{onClick:()=>g(e.id),className:`flex items-center justify-between p-2.5 rounded-xl cursor-pointer transition-colors border ${t?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-transparent hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3 min-w-0 flex-1`,children:[(0,U.jsx)(`div`,{className:`w-7 h-7 flex items-center justify-center shrink-0`,children:(0,U.jsx)(Io,{kind:y(e.mimeType,e.name),className:`w-5 h-5`})}),(0,U.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,U.jsx)(`p`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] truncate`,children:e.name}),(0,U.jsxs)(`p`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:[wo(e.sizeBytes),` • `,new Date(e.createdAt).toLocaleDateString()]})]})]}),(0,U.jsx)(`div`,{className:`flex items-center justify-center w-4 h-4 rounded border transition-colors ${t?`border-[#0B57D0] bg-[#0B57D0] text-white dark:border-[#A8C7FA] dark:bg-[#A8C7FA] dark:text-[#001D35]`:`border-[#747775]/40`}`,children:t&&(0,U.jsx)(xr,{className:`w-3 h-3 stroke-[3]`})})]},e.id)})}),(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-t border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#131314]`,children:[(0,U.jsxs)(`span`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:[d.size,` berkas dipilih`]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(G,{type:`button`,variant:`outline`,size:`sm`,onClick:t,disabled:l,className:`h-8 text-xs rounded-full`,children:`Batal`}),(0,U.jsx)(G,{type:`button`,size:`sm`,onClick:_,disabled:d.size===0||l,className:`h-8 px-4 text-xs font-medium rounded-full bg-[#0B57D0] hover:bg-[#0B57D0]/90 text-white min-w-[90px]`,children:l?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(oi,{className:`w-3.5 h-3.5 animate-spin mr-1.5`}),`Mengambil...`]}):`Impor (${d.size})`})]})]})]})})}var om=c(o(((e,t)=>{(function(n){typeof e==`object`&&t!==void 0?t.exports=n():typeof define==`function`&&define.amd?define([],n):(typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:this).JSZip=n()})(function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c=typeof l==`function`&&l;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=Error(`Cannot find module '`+o+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a=typeof l==`function`&&l,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){var r=e(`./utils`),i=e(`./support`),a=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`;n.encode=function(e){for(var t,n,i,o,s,c,l,u=[],d=0,f=e.length,p=f,m=r.getTypeOf(e)!==`string`;d<e.length;)p=f-d,i=m?(t=e[d++],n=d<f?e[d++]:0,d<f?e[d++]:0):(t=e.charCodeAt(d++),n=d<f?e.charCodeAt(d++):0,d<f?e.charCodeAt(d++):0),o=t>>2,s=(3&t)<<4|n>>4,c=1<p?(15&n)<<2|i>>6:64,l=2<p?63&i:64,u.push(a.charAt(o)+a.charAt(s)+a.charAt(c)+a.charAt(l));return u.join(``)},n.decode=function(e){var t,n,r,o,s,c,l=0,u=0,d=`data:`;if(e.substr(0,d.length)===d)throw Error(`Invalid base64 input, it looks like a data url.`);var f,p=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,``)).length/4;if(e.charAt(e.length-1)===a.charAt(64)&&p--,e.charAt(e.length-2)===a.charAt(64)&&p--,p%1!=0)throw Error(`Invalid base64 input, bad content length.`);for(f=i.uint8array?new Uint8Array(0|p):Array(0|p);l<e.length;)t=a.indexOf(e.charAt(l++))<<2|(o=a.indexOf(e.charAt(l++)))>>4,n=(15&o)<<4|(s=a.indexOf(e.charAt(l++)))>>2,r=(3&s)<<6|(c=a.indexOf(e.charAt(l++))),f[u++]=t,s!==64&&(f[u++]=n),c!==64&&(f[u++]=r);return f}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e(`./external`),i=e(`./stream/DataWorker`),a=e(`./stream/Crc32Probe`),o=e(`./stream/DataLengthProbe`);function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o(`data_length`)),t=this;return e.on(`end`,function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error(`Bug : uncompressed data size mismatch`)}),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo(`compressedSize`,this.compressedSize).withStreamInfo(`uncompressedSize`,this.uncompressedSize).withStreamInfo(`crc32`,this.crc32).withStreamInfo(`compression`,this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new a).pipe(new o(`uncompressedSize`)).pipe(t.compressWorker(n)).pipe(new o(`compressedSize`)).withStreamInfo(`compression`,t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e(`./stream/GenericWorker`);n.STORE={magic:`\0\0`,compressWorker:function(){return new r(`STORE compression`)},uncompressWorker:function(){return new r(`STORE decompression`)}},n.DEFLATE=e(`./flate`)},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e(`./utils`),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return e!==void 0&&e.length?r.getTypeOf(e)===`string`?function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var a=i,o=r+n;e^=-1;for(var s=r;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r=null;r=typeof Promise<`u`?Promise:e(`lie`),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Uint32Array<`u`,i=e(`pako`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=r?`uint8array`:`array`;function c(e,t){o.call(this,`FlateWorker/`+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic=`\b\0`,a.inherits(c,o),c.prototype.processChunk=function(e){this.meta=e.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(s,e.data),!1)},c.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c(`Deflate`,e)},n.uncompressWorker=function(){return new c(`Inflate`,{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r=``;for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r}function i(e,t,n,i,o,u){var d,f,p=e.file,m=e.compression,h=u!==s.utf8encode,g=a.transformTo(`string`,u(p.name)),_=a.transformTo(`string`,s.utf8encode(p.name)),v=p.comment,y=a.transformTo(`string`,u(v)),b=a.transformTo(`string`,s.utf8encode(v)),x=_.length!==p.name.length,S=b.length!==v.length,C=``,w=``,T=``,E=p.dir,D=p.date,O={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(O.crc32=e.crc32,O.compressedSize=e.compressedSize,O.uncompressedSize=e.uncompressedSize);var k=0;t&&(k|=8),h||!x&&!S||(k|=2048);var A=0,j=0;E&&(A|=16),o===`UNIX`?(j=798,A|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(p.unixPermissions,E)):(j=20,A|=function(e){return 63&(e||0)}(p.dosPermissions)),d=D.getUTCHours(),d<<=6,d|=D.getUTCMinutes(),d<<=5,d|=D.getUTCSeconds()/2,f=D.getUTCFullYear()-1980,f<<=4,f|=D.getUTCMonth()+1,f<<=5,f|=D.getUTCDate(),x&&(w=r(1,1)+r(c(g),4)+_,C+=`up`+r(w.length,2)+w),S&&(T=r(1,1)+r(c(y),4)+b,C+=`uc`+r(T.length,2)+T);var M=``;return M+=`
|
|
42
|
+
\0`,M+=r(k,2),M+=m.magic,M+=r(d,2),M+=r(f,2),M+=r(O.crc32,4),M+=r(O.compressedSize,4),M+=r(O.uncompressedSize,4),M+=r(g.length,2),M+=r(C.length,2),{fileRecord:l.LOCAL_FILE_HEADER+M+g+C,dirRecord:l.CENTRAL_FILE_HEADER+r(j,2)+M+r(y.length,2)+`\0\0\0\0`+r(A,4)+r(i,4)+g+C+y}}var a=e(`../utils`),o=e(`../stream/GenericWorker`),s=e(`../utf8`),c=e(`../crc32`),l=e(`../signature`);function u(e,t,n,r){o.call(this,`ZipFileWorker`),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(u,o),u.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,o.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},u.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},u.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return l.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},u.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,i=function(e,t,n,i,o){var s=a.transformTo(`string`,o(i));return l.CENTRAL_DIRECTORY_END+`\0\0\0\0`+r(e,2)+r(e,2)+r(t,4)+r(n,4)+r(s.length,2)+s}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},u.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},u.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on(`data`,function(e){t.processChunk(e)}),e.on(`end`,function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on(`error`,function(e){t.error(e)}),this},u.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},u.prototype.error=function(e){var t=this._sources;if(!o.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch{}return!0},u.prototype.lock=function(){o.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=u},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){var r=e(`../compressions`),i=e(`./ZipFileWorker`);n.generateWorker=function(e,t,n){var a=new i(t.streamFiles,n,t.platform,t.encodeFileName),o=0;try{e.forEach(function(e,n){o++;var i=function(e,t){var n=e||t,i=r[n];if(!i)throw Error(n+` is not a valid compression method !`);return i}(n.options.compression,t.compression),s=n.options.compressionOptions||t.compressionOptions||{},c=n.dir,l=n.date;n._compressWorker(i,s).withStreamInfo(`file`,{name:e,dir:c,date:l,comment:n.comment||``,unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(a)}),a.entriesCount=o}catch(e){a.error(e)}return a}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){function r(){if(!(this instanceof r))return new r;if(arguments.length)throw Error(`The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.`);this.files=Object.create(null),this.comment=null,this.root=``,this.clone=function(){var e=new r;for(var t in this)typeof this[t]!=`function`&&(e[t]=this[t]);return e}}(r.prototype=e(`./object`)).loadAsync=e(`./load`),r.support=e(`./support`),r.defaults=e(`./defaults`),r.version=`3.10.2`,r.loadAsync=function(e,t){return new r().loadAsync(e,t)},r.external=e(`./external`),t.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){var r=e(`./utils`),i=e(`./external`),a=e(`./utf8`),o=e(`./zipEntries`),s=e(`./stream/Crc32Probe`),c=e(`./nodejsUtils`);function l(e){return new i.Promise(function(t,n){var r=e.decompressed.getContentWorker().pipe(new s);r.on(`error`,function(e){n(e)}).on(`end`,function(){r.streamInfo.crc32===e.decompressed.crc32?t():n(Error(`Corrupted zip : CRC32 mismatch`))}).resume()})}t.exports=function(e,t){var n=this;return t=r.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),c.isNode&&c.isStream(e)?i.Promise.reject(Error(`JSZip can't accept a stream when loading a zip file.`)):r.prepareContent(`the loaded zip file`,e,!0,t.optimizedBinaryString,t.base64).then(function(e){var n=new o(t);return n.load(e),n}).then(function(e){var n=[i.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var a=0;a<r.length;a++)n.push(l(r[a]));return i.Promise.all(n)}).then(function(e){for(var i=e.shift(),a=i.files,o=0;o<a.length;o++){var s=a[o],c=s.fileNameStr,l=r.resolve(s.fileNameStr);n.file(l,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(n.file(l).unsafeOriginalName=c)}return i.zipComment.length&&(n.comment=i.zipComment),n})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){var r=e(`../utils`),i=e(`../stream/GenericWorker`);function a(e,t){i.call(this,`Nodejs stream input adapter for `+e),this._upstreamEnded=!1,this._bindStream(t)}r.inherits(a,i),a.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on(`data`,function(e){t.push({data:e,meta:{percent:0}})}).on(`error`,function(e){t.isPaused?this.generatedError=e:t.error(e)}).on(`end`,function(){t.isPaused?t._upstreamEnded=!0:t.end()})},a.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=a},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){var r=e(`readable-stream`).Readable;function i(e,t,n){r.call(this,t),this._helper=e;var i=this;e.on(`data`,function(e,t){i.push(e)||i._helper.pause(),n&&n(t)}).on(`error`,function(e){i.emit(`error`,e)}).on(`end`,function(){i.push(null)})}e(`../utils`).inherits(i,r),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,n){t.exports={isNode:typeof Buffer<`u`,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if(typeof e==`number`)throw Error(`The "data" argument must not be a number`);return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&typeof e.on==`function`&&typeof e.pause==`function`&&typeof e.resume==`function`}}},{}],15:[function(e,t,n){function r(e,t,n){var r,i=a.getTypeOf(t),s=a.extend(n||{},c);s.date=s.date||new Date,s.compression!==null&&(s.compression=s.compression.toUpperCase()),typeof s.unixPermissions==`string`&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=h(e)),s.createFolders&&(r=m(e))&&g.call(this,r,!0);var d=i===`string`&&!1===s.binary&&!1===s.base64;n&&n.binary!==void 0||(s.binary=!d),(t instanceof l&&t.uncompressedSize===0||s.dir||!t||t.length===0)&&(s.base64=!1,s.binary=!0,t=``,s.compression=`STORE`,i=`string`);var _=null;_=t instanceof l||t instanceof o?t:f.isNode&&f.isStream(t)?new p(e,t):a.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var v=new u(e,_,s);this.files[e]=v}var i=e(`./utf8`),a=e(`./utils`),o=e(`./stream/GenericWorker`),s=e(`./stream/StreamHelper`),c=e(`./defaults`),l=e(`./compressedObject`),u=e(`./zipObject`),d=e(`./generate`),f=e(`./nodejsUtils`),p=e(`./nodejs/NodejsStreamInputAdapter`),m=function(e){e.slice(-1)===`/`&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf(`/`);return 0<t?e.substring(0,t):``},h=function(e){return e.slice(-1)!==`/`&&(e+=`/`),e},g=function(e,t){return t=t===void 0?c.createFolders:t,e=h(e),this.files[e]||r.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function _(e){return Object.prototype.toString.call(e)===`[object RegExp]`}t.exports={load:function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},forEach:function(e){var t,n,r;for(t in this.files)r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r)},filter:function(e){var t=[];return this.forEach(function(n,r){e(n,r)&&t.push(r)}),t},file:function(e,t,n){if(arguments.length!==1)return e=this.root+e,r.call(this,e,t,n),this;if(_(e)){var i=e;return this.filter(function(e,t){return!t.dir&&i.test(e)})}var a=this.files[this.root+e];return a&&!a.dir?a:null},folder:function(e){if(!e)return this;if(_(e))return this.filter(function(t,n){return n.dir&&e.test(t)});var t=this.root+e,n=g.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||=(e.slice(-1)!==`/`&&(e+=`/`),this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter(function(t,n){return n.name.slice(0,e.length)===e}),r=0;r<n.length;r++)delete this.files[n[r].name];return this},generate:function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},generateInternalStream:function(e){var t,n={};try{if((n=a.extend(e||{},{streamFiles:!1,compression:`STORE`,compressionOptions:null,type:``,platform:`DOS`,comment:null,mimeType:`application/zip`,encodeFileName:i.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),n.type===`binarystring`&&(n.type=`string`),!n.type)throw Error(`No output type specified.`);a.checkSupport(n.type),n.platform!==`darwin`&&n.platform!==`freebsd`&&n.platform!==`linux`&&n.platform!==`sunos`||(n.platform=`UNIX`),n.platform===`win32`&&(n.platform=`DOS`);var r=n.comment||this.comment||``;t=d.generateWorker(this,n,r)}catch(e){(t=new o(`error`)).error(e)}return new s(t,n.type||`string`,n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e||={}).type||(e.type=`nodebuffer`),this.generateInternalStream(e).toNodejsStream(t)}}},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,n){t.exports=e(`stream`)},{stream:void 0}],17:[function(e,t,n){var r=e(`./DataReader`);function i(e){r.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),a=this.length-4;0<=a;--a)if(this.data[a]===t&&this.data[a+1]===n&&this.data[a+2]===r&&this.data[a+3]===i)return a-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),a=this.readData(4);return t===a[0]&&n===a[1]&&r===a[2]&&i===a[3]},i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){var r=e(`../utils`);function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw Error(`End of data reached (data length = `+this.length+`, asked index = `+e+`). Corrupted zip ?`)},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo(`string`,this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e(`./Uint8ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e(`./DataReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e(`./ArrayReader`);function i(e){r.call(this,e)}e(`../utils`).inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),e===0)return new Uint8Array;var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e(`../utils`),i=e(`../support`),a=e(`./ArrayReader`),o=e(`./StringReader`),s=e(`./NodeBufferReader`),c=e(`./Uint8ArrayReader`);t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),t!==`string`||i.uint8array?t===`nodebuffer`?new s(e):i.uint8array?new c(r.transformTo(`uint8array`,e)):new a(r.transformTo(`array`,e)):new o(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER=`PK`,n.CENTRAL_FILE_HEADER=`PK`,n.CENTRAL_DIRECTORY_END=`PK`,n.ZIP64_CENTRAL_DIRECTORY_LOCATOR=`PK\x07`,n.ZIP64_CENTRAL_DIRECTORY_END=`PK`,n.DATA_DESCRIPTOR=`PK\x07\b`},{}],24:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../utils`);function a(e){r.call(this,`ConvertWorker to `+e),this.destType=e}i.inherits(a,r),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e(`./GenericWorker`),i=e(`../crc32`);function a(){r.call(this,`Crc32Probe`),this.withStreamInfo(`crc32`,0)}e(`../utils`).inherits(a,r),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataLengthProbe for `+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e(`../utils`),i=e(`./GenericWorker`);function a(e){i.call(this,`DataWorker`);var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type=``,this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}r.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case`string`:e=this.data.substring(this.index,t);break;case`uint8array`:e=this.data.subarray(this.index,t);break;case`array`:case`nodebuffer`:e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||`default`,this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit(`data`,e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit(`end`),this.cleanUp(),this.isFinished=!0}catch(e){this.emit(`error`,e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit(`error`,e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw Error(`The stream '`+this+`' has already been used.`);this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on(`data`,function(e){t.processChunk(e)}),e.on(`end`,function(){t.end()}),e.on(`error`,function(e){t.error(e)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw Error(`The stream '`+this+`' has already been used.`);this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e=`Worker `+this.name;return this.previous?this.previous+` -> `+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e(`../utils`),i=e(`./ConvertWorker`),a=e(`./GenericWorker`),o=e(`../base64`),s=e(`../support`),c=e(`../external`),l=null;if(s.nodestream)try{l=e(`../nodejs/NodejsStreamOutputAdapter`)}catch{}function u(e,t){return new c.Promise(function(n,i){var a=[],s=e._internalType,c=e._outputType,l=e._mimeType;e.on(`data`,function(e,n){a.push(e),t&&t(n)}).on(`error`,function(e){a=[],i(e)}).on(`end`,function(){try{n(function(e,t,n){switch(e){case`blob`:return r.newBlob(r.transformTo(`arraybuffer`,t),n);case`base64`:return o.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,a=0;for(n=0;n<t.length;n++)a+=t[n].length;switch(e){case`string`:return t.join(``);case`array`:return Array.prototype.concat.apply([],t);case`uint8array`:for(i=new Uint8Array(a),n=0;n<t.length;n++)i.set(t[n],r),r+=t[n].length;return i;case`nodebuffer`:return Buffer.concat(t);default:throw Error(`concat : unsupported type '`+e+`'`)}}(s,a),l))}catch(e){i(e)}a=[]}).resume()})}function d(e,t,n){var o=t;switch(t){case`blob`:case`arraybuffer`:o=`uint8array`;break;case`base64`:o=`string`}try{this._internalType=o,this._outputType=t,this._mimeType=n,r.checkSupport(o),this._worker=e.pipe(new i(o)),e.lock()}catch(e){this._worker=new a(`error`),this._worker.error(e)}}d.prototype={accumulate:function(e){return u(this,e)},on:function(e,t){var n=this;return e===`data`?this._worker.on(e,function(e){t.call(n,e.data,e.meta)}):this._worker.on(e,function(){r.delay(t,arguments,n)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(r.checkSupport(`nodestream`),this._outputType!==`nodebuffer`)throw Error(this._outputType+` is not supported by this method`);return new l(this,{objectMode:this._outputType!==`nodebuffer`},e)}},t.exports=d},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer=typeof ArrayBuffer<`u`&&typeof Uint8Array<`u`,n.nodebuffer=typeof Buffer<`u`,n.uint8array=typeof Uint8Array<`u`,typeof ArrayBuffer>`u`)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=new Blob([r],{type:`application/zip`}).size===0}catch{try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=i.getBlob(`application/zip`).size===0}catch{n.blob=!1}}}try{n.nodestream=!!e(`readable-stream`).Readable}catch{n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){for(var r=e(`./utils`),i=e(`./support`),a=e(`./nodejsUtils`),o=e(`./stream/GenericWorker`),s=Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;s[254]=s[254]=1;function l(){o.call(this,`utf-8 decode`),this.leftOver=null}function u(){o.call(this,`utf-8 encode`)}n.utf8encode=function(e){return i.nodebuffer?a.newBufferFrom(e,`utf-8`):function(e){var t,n,r,a,o,s=e.length,c=0;for(a=0;a<s;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(r=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(r-56320),a++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=i.uint8array?new Uint8Array(c):Array(c),a=o=0;o<c;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(r=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(r-56320),a++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo(`nodebuffer`,e).toString(`utf-8`):function(e){var t,n,i,a,o=e.length,c=Array(2*o);for(t=n=0;t<o;)if((i=e[t++])<128)c[n++]=i;else if(4<(a=s[i]))c[n++]=65533,t+=a-1;else{for(i&=a===2?31:a===3?15:7;1<a&&t<o;)i=i<<6|63&e[t++],a--;1<a?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?`uint8array`:`array`,e))},r.inherits(l,o),l.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?`uint8array`:`array`,e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var o=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+s[e[n]]>t?n:t}(t),c=t;o!==t.length&&(i.uint8array?(c=t.subarray(0,o),this.leftOver=t.subarray(o,t.length)):(c=t.slice(0,o),this.leftOver=t.slice(o,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=l,r.inherits(u,o),u.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=u},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e(`./support`),i=e(`./base64`),a=e(`./nodejsUtils`),o=e(`./external`);function s(e){return e}function c(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}e(`setimmediate`),n.newBlob=function(e,t){n.checkSupport(`blob`);try{return new Blob([e],{type:t})}catch{try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(t)}catch{throw Error(`Bug : can't construct the Blob.`)}}};var l={stringifyByChunk:function(e,t,n){var r=[],i=0,a=e.length;if(a<=n)return String.fromCharCode.apply(null,e);for(;i<a;)t===`array`||t===`nodebuffer`?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+n,a)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+n,a)))),i+=n;return r.join(``)},stringifyByChar:function(e){for(var t=``,n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&String.fromCharCode.apply(null,a.allocBuffer(1)).length===1}catch{return!1}}()}};function u(e){var t=65536,r=n.getTypeOf(e),i=!0;if(r===`uint8array`?i=l.applyCanBeUsed.uint8array:r===`nodebuffer`&&(i=l.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return l.stringifyByChunk(e,r,t)}catch{t=Math.floor(t/2)}return l.stringifyByChar(e)}function d(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=u;var f={};f.string={string:s,array:function(e){return c(e,Array(e.length))},arraybuffer:function(e){return f.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,a.allocBuffer(e.length))}},f.array={string:u,array:s,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(e)}},f.arraybuffer={string:function(e){return u(new Uint8Array(e))},array:function(e){return d(new Uint8Array(e),Array(e.byteLength))},arraybuffer:s,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return a.newBufferFrom(new Uint8Array(e))}},f.uint8array={string:u,array:function(e){return d(e,Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:s,nodebuffer:function(e){return a.newBufferFrom(e)}},f.nodebuffer={string:u,array:function(e){return d(e,Array(e.length))},arraybuffer:function(e){return f.nodebuffer.uint8array(e).buffer},uint8array:function(e){return d(e,new Uint8Array(e.length))},nodebuffer:s},n.transformTo=function(e,t){return t||=``,e?(n.checkSupport(e),f[n.getTypeOf(t)][e](t)):t},n.resolve=function(e){for(var t=e.split(`/`),n=[],r=0;r<t.length;r++){var i=t[r];i===`.`||i===``&&r!==0&&r!==t.length-1||(i===`..`?n.pop():n.push(i))}return n.join(`/`)},n.getTypeOf=function(e){if(typeof e==`string`)return`string`;var t=Object.prototype.toString.call(e);return t===`[object Array]`?`array`:r.nodebuffer&&a.isBuffer(e)?`nodebuffer`:r.uint8array&&t===`[object Uint8Array]`?`uint8array`:r.arraybuffer&&t===`[object ArrayBuffer]`?`arraybuffer`:void 0},n.checkSupport=function(e){if(!r[e.toLowerCase()])throw Error(e+` is not supported by this platform`)},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,r=``;for(n=0;n<(e||``).length;n++)r+=`\\x`+((t=e.charCodeAt(n))<16?`0`:``)+t.toString(16).toUpperCase();return r},n.delay=function(e,t,n){setImmediate(function(){e.apply(n||null,t||[])})},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&n[t]===void 0&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,a,s,l){return o.Promise.resolve(t).then(function(t){return r.blob&&(t instanceof Blob||[`[object File]`,`[object Blob]`].indexOf(Object.prototype.toString.call(t))!==-1)?Blob.prototype.arrayBuffer===void 0?typeof FileReader<`u`?new o.Promise(function(e,n){var r=new FileReader;r.onload=function(t){e(t.target.result)},r.onerror=function(e){n(e.target.error)},r.readAsArrayBuffer(t)}):o.Promise.reject(Error(e+` is a Blob, but we have no way of reading it.`)):t.arrayBuffer():t}).then(function(t){var u=n.getTypeOf(t);return u?(u===`arraybuffer`?t=n.transformTo(`uint8array`,t):u===`string`&&(l?t=i.decode(t):a&&!0!==s&&(t=function(e){return c(e,r.uint8array?new Uint8Array(e.length):Array(e.length))}(t))),t):o.Promise.reject(Error(`Can't read the data of '`+e+`'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?`))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,n){var r=e(`./reader/readerFor`),i=e(`./utils`),a=e(`./signature`),o=e(`./zipEntry`),s=e(`./support`);function c(e){this.files=[],this.loadOptions=e}c.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw Error(`Corrupted zip or bug: unexpected signature (`+i.pretty(t)+`, expected `+i.pretty(e)+`)`)}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?`uint8array`:`array`,n=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw Error(`Multi-volumes zip are not supported`)},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)(e=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw Error(`Corrupted zip or bug: expected `+this.centralDirRecords+` records in central dir, got `+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,a.LOCAL_FILE_HEADER)?Error(`Corrupted zip: can't find end of central directory`):Error(`Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html`);this.reader.setIndex(e);var t=e;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw Error(`Corrupted zip: can't find the ZIP64 end of central directory locator`);if(this.reader.setIndex(e),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw Error(`Corrupted zip: can't find the ZIP64 end of central directory`);this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(0<r)this.isSignature(t,a.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw Error(`Corrupted zip: missing `+Math.abs(r)+` bytes.`)},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){var r=e(`./reader/readerFor`),i=e(`./utils`),a=e(`./compressedObject`),o=e(`./crc32`),s=e(`./utf8`),c=e(`./compressions`),l=e(`./support`);function u(e,t){this.options=e,this.loadOptions=t}u.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),this.compressedSize===-1||this.uncompressedSize===-1)throw Error(`Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)`);if((t=function(e){for(var t in c)if(Object.prototype.hasOwnProperty.call(c,t)&&c[t].magic===e)return c[t];return null}(this.compressionMethod))===null)throw Error(`Corrupted zip : compression `+i.pretty(this.compressionMethod)+` unknown (inner file : `+i.transformTo(`string`,this.fileName)+`)`);this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw Error(`Encrypted zip are not supported`);e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),e==0&&(this.dosPermissions=63&this.externalFileAttributes),e==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!==`/`||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||={};e.index+4<i;)t=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[t]={id:t,length:n,value:r};e.setIndex(i)},handleUTF8:function(){var e=l.uint8array?`uint8array`:`array`;if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(t!==null)this.fileNameStr=t;else{var n=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(r!==null)this.fileCommentStr=r;else{var a=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(a)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=r(e.value);return t.readInt(1)===1&&o(this.fileName)===t.readInt(4)?s.utf8decode(t.readData(e.length-5)):null}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=r(e.value);return t.readInt(1)===1&&o(this.fileComment)===t.readInt(4)?s.utf8decode(t.readData(e.length-5)):null}return null}},t.exports=u},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){function r(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var i=e(`./stream/StreamHelper`),a=e(`./stream/DataWorker`),o=e(`./utf8`),s=e(`./compressedObject`),c=e(`./stream/GenericWorker`);r.prototype={internalStream:function(e){var t=null,n=`string`;try{if(!e)throw Error(`No output type specified.`);var r=(n=e.toLowerCase())===`string`||n===`text`;n!==`binarystring`&&n!==`text`||(n=`string`),t=this._decompressWorker();var a=!this._dataBinary;a&&!r&&(t=t.pipe(new o.Utf8EncodeWorker)),!a&&r&&(t=t.pipe(new o.Utf8DecodeWorker))}catch(e){(t=new c(`error`)).error(e)}return new i(t,n,``)},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||`nodebuffer`).toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new o.Utf8EncodeWorker)),s.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof c?this._data:new a(this._data)}};for(var l=[`asText`,`asBinary`,`asNodeBuffer`,`asUint8Array`,`asArrayBuffer`],u=function(){throw Error(`This method has been removed in JSZip 3.0, please check the upgrade guide.`)},d=0;d<l.length;d++)r.prototype[l[d]]=u;t.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,n){(function(e){var n,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var a=0,o=new i(u),s=e.document.createTextNode(``);o.observe(s,{characterData:!0}),n=function(){s.data=a=++a%2}}else if(e.setImmediate||e.MessageChannel===void 0)n=`document`in e&&`onreadystatechange`in e.document.createElement(`script`)?function(){var t=e.document.createElement(`script`);t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};else{var c=new e.MessageChannel;c.port1.onmessage=u,n=function(){c.port2.postMessage(0)}}var l=[];function u(){var e,t;r=!0;for(var n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}r=!1}t.exports=function(e){l.push(e)!==1||r||n()}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}],37:[function(e,t,n){var r=e(`immediate`);function i(){}var a={},o=[`REJECTED`],s=[`FULFILLED`],c=[`PENDING`];function l(e){if(typeof e!=`function`)throw TypeError(`resolver must be a function`);this.state=c,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function u(e,t,n){this.promise=e,typeof t==`function`&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof n==`function`&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){r(function(){var r;try{r=t(n)}catch(t){return a.reject(e,t)}r===e?a.reject(e,TypeError(`Cannot resolve promise with itself`)):a.resolve(e,r)})}function f(e){var t=e&&e.then;if(e&&(typeof e==`object`||typeof e==`function`)&&typeof t==`function`)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,a.reject(e,t))}function i(t){n||(n=!0,a.resolve(e,t))}var o=m(function(){t(i,r)});o.status===`error`&&r(o.value)}function m(e,t){var n={};try{n.value=e(t),n.status=`success`}catch(e){n.status=`error`,n.value=e}return n}(t.exports=l).prototype.finally=function(e){if(typeof e!=`function`)return this;var t=this.constructor;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})},l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if(typeof e!=`function`&&this.state===s||typeof t!=`function`&&this.state===o)return this;var n=new this.constructor(i);return this.state===c?this.queue.push(new u(n,e,t)):d(n,this.state===s?e:t,this.outcome),n},u.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){a.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},a.resolve=function(e,t){var n=m(f,t);if(n.status===`error`)return a.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=s,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},l.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},l.reject=function(e){var t=new this(i);return a.reject(t,e)},l.all=function(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=Array(n),s=0,c=-1,l=new this(i);++c<n;)u(e[c],c);return l;function u(e,i){t.resolve(e).then(function(e){o[i]=e,++s!==n||r||(r=!0,a.resolve(l,o))},function(e){r||(r=!0,a.reject(l,e))})}},l.race=function(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(i);++o<n;)c=e[o],t.resolve(c).then(function(e){r||(r=!0,a.resolve(s,e))},function(e){r||(r=!0,a.reject(s,e))});var c;return s}},{immediate:36}],38:[function(e,t,n){var r={};(0,e(`./lib/utils/common`).assign)(r,e(`./lib/deflate`),e(`./lib/inflate`),e(`./lib/zlib/constants`)),t.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){var r=e(`./zlib/deflate`),i=e(`./utils/common`),a=e(`./utils/strings`),o=e(`./zlib/messages`),s=e(`./zlib/zstream`),c=Object.prototype.toString,l=0,u=-1,d=0,f=8;function p(e){if(!(this instanceof p))return new p(e);this.options=i.assign({level:u,method:f,chunkSize:16384,windowBits:15,memLevel:8,strategy:d,to:``},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(n!==l)throw Error(o[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var m;if(m=typeof t.dictionary==`string`?a.string2buf(t.dictionary):c.call(t.dictionary)===`[object ArrayBuffer]`?new Uint8Array(t.dictionary):t.dictionary,(n=r.deflateSetDictionary(this.strm,m))!==l)throw Error(o[n]);this._dict_set=!0}}function m(e,t){var n=new p(t);if(n.push(e,!0),n.err)throw n.msg||o[n.err];return n.result}p.prototype.push=function(e,t){var n,o,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;o=t===~~t?t:!0===t?4:0,typeof e==`string`?s.input=a.string2buf(e):c.call(e)===`[object ArrayBuffer]`?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(s.avail_out===0&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),(n=r.deflate(s,o))!==1&&n!==l)return this.onEnd(n),!(this.ended=!0);s.avail_out!==0&&(s.avail_in!==0||o!==4&&o!==2)||(this.options.to===`string`?this.onData(a.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||s.avail_out===0)&&n!==1);return o===4?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l):o!==2||(this.onEnd(l),!(s.avail_out=0))},p.prototype.onData=function(e){this.chunks.push(e)},p.prototype.onEnd=function(e){e===l&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=p,n.deflate=m,n.deflateRaw=function(e,t){return(t||={}).raw=!0,m(e,t)},n.gzip=function(e,t){return(t||={}).gzip=!0,m(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){var r=e(`./zlib/inflate`),i=e(`./utils/common`),a=e(`./utils/strings`),o=e(`./zlib/constants`),s=e(`./zlib/messages`),c=e(`./zlib/zstream`),l=e(`./zlib/gzheader`),u=Object.prototype.toString;function d(e){if(!(this instanceof d))return new d(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:``},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==o.Z_OK)throw Error(s[n]);this.header=new l,r.inflateGetHeader(this.strm,this.header)}function f(e,t){var n=new d(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}d.prototype.push=function(e,t){var n,s,c,l,d,f,p=this.strm,m=this.options.chunkSize,h=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?o.Z_FINISH:o.Z_NO_FLUSH,typeof e==`string`?p.input=a.binstring2buf(e):u.call(e)===`[object ArrayBuffer]`?p.input=new Uint8Array(e):p.input=e,p.next_in=0,p.avail_in=p.input.length;do{if(p.avail_out===0&&(p.output=new i.Buf8(m),p.next_out=0,p.avail_out=m),(n=r.inflate(p,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&h&&(f=typeof h==`string`?a.string2buf(h):u.call(h)===`[object ArrayBuffer]`?new Uint8Array(h):h,n=r.inflateSetDictionary(this.strm,f)),n===o.Z_BUF_ERROR&&!0===g&&(n=o.Z_OK,g=!1),n!==o.Z_STREAM_END&&n!==o.Z_OK)return this.onEnd(n),!(this.ended=!0);p.next_out&&(p.avail_out!==0&&n!==o.Z_STREAM_END&&(p.avail_in!==0||s!==o.Z_FINISH&&s!==o.Z_SYNC_FLUSH)||(this.options.to===`string`?(c=a.utf8border(p.output,p.next_out),l=p.next_out-c,d=a.buf2string(p.output,c),p.next_out=l,p.avail_out=m-l,l&&i.arraySet(p.output,p.output,c,l,0),this.onData(d)):this.onData(i.shrinkBuf(p.output,p.next_out)))),p.avail_in===0&&p.avail_out===0&&(g=!0)}while((0<p.avail_in||p.avail_out===0)&&n!==o.Z_STREAM_END);return n===o.Z_STREAM_END&&(s=o.Z_FINISH),s===o.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===o.Z_OK):s!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(p.avail_out=0))},d.prototype.onData=function(e){this.chunks.push(e)},d.prototype.onEnd=function(e){e===o.Z_OK&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=d,n.inflate=f,n.inflateRaw=function(e,t){return(t||={}).raw=!0,f(e,t)},n.ungzip=f},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){var r=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if(typeof n!=`object`)throw TypeError(n+`must be non-object`);for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r,i,a,o;for(t=r=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),t=i=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},a={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,a))},n.setTyped(r)},{}],42:[function(e,t,n){var r=e(`./common`),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch{i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{a=!1}for(var o=new r.Buf8(256),s=0;s<256;s++)o[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function c(e,t){if(t<65537&&(e.subarray&&a||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n=``,o=0;o<t;o++)n+=String.fromCharCode(e[o]);return n}o[254]=o[254]=1,n.string2buf=function(e){var t,n,i,a,o,s=e.length,c=0;for(a=0;a<s;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(i=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),a++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(c),a=o=0;o<c;a++)(64512&(n=e.charCodeAt(a)))==55296&&a+1<s&&(64512&(i=e.charCodeAt(a+1)))==56320&&(n=65536+(n-55296<<10)+(i-56320),a++),n<128?t[o++]=n:(n<2048?t[o++]=192|n>>>6:(n<65536?t[o++]=224|n>>>12:(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63),t[o++]=128|n>>>6&63),t[o++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,a,s=t||e.length,l=Array(2*s);for(n=r=0;n<s;)if((i=e[n++])<128)l[r++]=i;else if(4<(a=o[i]))l[r++]=65533,n+=a-1;else{for(i&=a===2?31:a===3?15:7;1<a&&n<s;)i=i<<6|63&e[n++],a--;1<a?l[r++]=65533:i<65536?l[r++]=i:(i-=65536,l[r++]=55296|i>>10&1023,l[r++]=56320|1023&i)}return c(l,r)},n.utf8border=function(e,t){var n;for((t||=e.length)>e.length&&(t=e.length),n=t-1;0<=n&&(192&e[n])==128;)n--;return n<0||n===0?t:n+o[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,a=e>>>16&65535|0,o=0;n!==0;){for(n-=o=2e3<n?2e3:n;a=a+(i=i+t[r++]|0)|0,--o;);i%=65521,a%=65521}return i|a<<16|0}},{}],44:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){var r,i=e(`../utils/common`),a=e(`./trees`),o=e(`./adler32`),s=e(`./crc32`),c=e(`./messages`),l=0,u=4,d=0,f=-2,p=-1,m=4,h=2,g=8,_=9,v=286,y=30,b=19,x=2*v+1,S=15,C=3,w=258,T=w+C+1,E=42,D=113,O=1,k=2,A=3,j=4;function M(e,t){return e.msg=c[t],t}function N(e){return(e<<1)-(4<e?9:0)}function P(e){for(var t=e.length;0<=--t;)e[t]=0}function F(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),n!==0&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,t.pending===0&&(t.pending_out=0))}function I(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,F(e.strm)}function L(e,t){e.pending_buf[e.pending++]=t}function R(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ee(e,t){var n,r,i=e.max_chain_length,a=e.strstart,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-T?e.strstart-(e.w_size-T):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+w,p=l[a+o-1],m=l[a+o];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do if(l[(n=t)+o]===m&&l[n+o-1]===p&&l[n]===l[a]&&l[++n]===l[a+1]){a+=2,n++;do;while(l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&l[++a]===l[++n]&&a<f);if(r=w-(f-a),a=f-w,o<r){if(e.match_start=t,s<=(o=r))break;p=l[a+o-1],m=l[a+o]}}while((t=d[t&u])>c&&--i!=0);return o<=e.lookahead?o:e.lookahead}function te(e){var t,n,r,a,c,l,u,d,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-T)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=n=e.hash_size;r=e.head[--t],e.head[t]=m<=r?r-m:0,--n;);for(t=n=m;r=e.prev[--t],e.prev[t]=m<=r?r-m:0,--n;);a+=m}if(e.strm.avail_in===0)break;if(l=e.strm,u=e.window,d=e.strstart+e.lookahead,f=a,p=void 0,p=l.avail_in,f<p&&(p=f),n=p===0?0:(l.avail_in-=p,i.arraySet(u,l.input,l.next_in,p,d),l.state.wrap===1?l.adler=o(l.adler,u,p,d):l.state.wrap===2&&(l.adler=s(l.adler,u,p,d)),l.next_in+=p,l.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=C)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+C-1])&e.hash_mask,e.prev[c&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=c,c++,e.insert--,!(e.lookahead+e.insert<C)););}while(e.lookahead<T&&e.strm.avail_in!==0)}function ne(e,t){for(var n,r;;){if(e.lookahead<T){if(te(e),e.lookahead<T&&t===l)return O;if(e.lookahead===0)break}if(n=0,e.lookahead>=C&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),n!==0&&e.strstart-n<=e.w_size-T&&(e.match_length=ee(e,n)),e.match_length>=C)if(r=a._tr_tally(e,e.strstart-e.match_start,e.match_length-C),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=C){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,--e.match_length!=0;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=e.strstart<C-1?e.strstart:C-1,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}function re(e,t){for(var n,r,i;;){if(e.lookahead<T){if(te(e),e.lookahead<T&&t===l)return O;if(e.lookahead===0)break}if(n=0,e.lookahead>=C&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=C-1,n!==0&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-T&&(e.match_length=ee(e,n),e.match_length<=5&&(e.strategy===1||e.match_length===C&&4096<e.strstart-e.match_start)&&(e.match_length=C-1)),e.prev_length>=C&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-C,r=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-C),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+C-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),--e.prev_length!=0;);if(e.match_available=0,e.match_length=C-1,e.strstart++,r&&(I(e,!1),e.strm.avail_out===0))return O}else if(e.match_available){if((r=a._tr_tally(e,0,e.window[e.strstart-1]))&&I(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return O}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(r=a._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<C-1?e.strstart:C-1,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}function z(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function ie(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=g,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(2*x),this.dyn_dtree=new i.Buf16(2*(2*y+1)),this.bl_tree=new i.Buf16(2*(2*b+1)),P(this.dyn_ltree),P(this.dyn_dtree),P(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(S+1),this.heap=new i.Buf16(2*v+1),P(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(2*v+1),P(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function ae(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=h,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?E:D,e.adler=t.wrap===2?0:1,t.last_flush=l,a._tr_init(t),d):M(e,f)}function oe(e){var t=ae(e);return t===d&&function(e){e.window_size=2*e.w_size,P(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=C-1,e.match_available=0,e.ins_h=0}(e.state),t}function se(e,t,n,r,a,o){if(!e)return f;var s=1;if(t===p&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),a<1||_<a||n!==g||r<8||15<r||t<0||9<t||o<0||m<o)return M(e,f);r===8&&(r=9);var c=new ie;return(e.state=c).strm=e,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+C-1)/C),c.window=new i.Buf8(2*c.w_size),c.head=new i.Buf16(c.hash_size),c.prev=new i.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new i.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=o,c.method=n,oe(e)}r=[new z(0,0,0,0,function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(te(e),e.lookahead===0&&t===l)return O;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,I(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-T&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),O)}),new z(4,4,8,4,ne),new z(4,5,16,8,ne),new z(4,6,32,32,ne),new z(4,4,16,16,re),new z(8,16,32,32,re),new z(8,16,128,128,re),new z(8,32,128,256,re),new z(32,128,258,1024,re),new z(32,258,258,4096,re)],n.deflateInit=function(e,t){return se(e,t,g,15,8,0)},n.deflateInit2=se,n.deflateReset=oe,n.deflateResetKeep=ae,n.deflateSetHeader=function(e,t){return e&&e.state&&e.state.wrap===2?(e.state.gzhead=t,d):f},n.deflate=function(e,t){var n,i,o,c;if(!e||!e.state||5<t||t<0)return e?M(e,f):f;if(i=e.state,!e.output||!e.input&&e.avail_in!==0||i.status===666&&t!==u)return M(e,e.avail_out===0?-5:f);if(i.strm=e,n=i.last_flush,i.last_flush=t,i.status===E)if(i.wrap===2)e.adler=0,L(i,31),L(i,139),L(i,8),i.gzhead?(L(i,+!!i.gzhead.text+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),L(i,255&i.gzhead.time),L(i,i.gzhead.time>>8&255),L(i,i.gzhead.time>>16&255),L(i,i.gzhead.time>>24&255),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(L(i,255&i.gzhead.extra.length),L(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(L(i,0),L(i,0),L(i,0),L(i,0),L(i,0),L(i,i.level===9?2:2<=i.strategy||i.level<2?4:0),L(i,3),i.status=D);else{var p=g+(i.w_bits-8<<4)<<8;p|=(2<=i.strategy||i.level<2?0:i.level<6?1:i.level===6?2:3)<<6,i.strstart!==0&&(p|=32),p+=31-p%31,i.status=D,R(i,p),i.strstart!==0&&(R(i,e.adler>>>16),R(i,65535&e.adler)),e.adler=1}if(i.status===69)if(i.gzhead.extra){for(o=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending!==i.pending_buf_size));)L(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(i.status===73)if(i.gzhead.name){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,L(i,c)}while(c!==0);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.gzindex=0,i.status=91)}else i.status=91;if(i.status===91)if(i.gzhead.comment){o=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),F(e),o=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,L(i,c)}while(c!==0);i.gzhead.hcrc&&i.pending>o&&(e.adler=s(e.adler,i.pending_buf,i.pending-o,o)),c===0&&(i.status=103)}else i.status=103;if(i.status===103&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&F(e),i.pending+2<=i.pending_buf_size&&(L(i,255&e.adler),L(i,e.adler>>8&255),e.adler=0,i.status=D)):i.status=D),i.pending!==0){if(F(e),e.avail_out===0)return i.last_flush=-1,d}else if(e.avail_in===0&&N(t)<=N(n)&&t!==u)return M(e,-5);if(i.status===666&&e.avail_in!==0)return M(e,-5);if(e.avail_in!==0||i.lookahead!==0||t!==l&&i.status!==666){var m=i.strategy===2?function(e,t){for(var n;;){if(e.lookahead===0&&(te(e),e.lookahead===0)){if(t===l)return O;break}if(e.match_length=0,n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):i.strategy===3?function(e,t){for(var n,r,i,o,s=e.window;;){if(e.lookahead<=w){if(te(e),e.lookahead<=w&&t===l)return O;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=C&&0<e.strstart&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){o=e.strstart+w;do;while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<o);e.match_length=w-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=C?(n=a._tr_tally(e,1,e.match_length-C),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(I(e,!1),e.strm.avail_out===0))return O}return e.insert=0,t===u?(I(e,!0),e.strm.avail_out===0?A:j):e.last_lit&&(I(e,!1),e.strm.avail_out===0)?O:k}(i,t):r[i.level].func(i,t);if(m!==A&&m!==j||(i.status=666),m===O||m===A)return e.avail_out===0&&(i.last_flush=-1),d;if(m===k&&(t===1?a._tr_align(i):t!==5&&(a._tr_stored_block(i,0,0,!1),t===3&&(P(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),F(e),e.avail_out===0))return i.last_flush=-1,d}return t===u?i.wrap<=0?1:(i.wrap===2?(L(i,255&e.adler),L(i,e.adler>>8&255),L(i,e.adler>>16&255),L(i,e.adler>>24&255),L(i,255&e.total_in),L(i,e.total_in>>8&255),L(i,e.total_in>>16&255),L(i,e.total_in>>24&255)):(R(i,e.adler>>>16),R(i,65535&e.adler)),F(e),0<i.wrap&&(i.wrap=-i.wrap),i.pending===0?1:d):d},n.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&t!==69&&t!==73&&t!==91&&t!==103&&t!==D&&t!==666?M(e,f):(e.state=null,t===D?M(e,-3):d):f},n.deflateSetDictionary=function(e,t){var n,r,a,s,c,l,u,p,m=t.length;if(!e||!e.state||(s=(n=e.state).wrap)===2||s===1&&n.status!==E||n.lookahead)return f;for(s===1&&(e.adler=o(e.adler,t,m,0)),n.wrap=0,m>=n.w_size&&(s===0&&(P(n.head),n.strstart=0,n.block_start=0,n.insert=0),p=new i.Buf8(n.w_size),i.arraySet(p,t,m-n.w_size,n.w_size,0),t=p,m=n.w_size),c=e.avail_in,l=e.next_in,u=e.input,e.avail_in=m,e.next_in=0,e.input=t,te(n);n.lookahead>=C;){for(r=n.strstart,a=n.lookahead-(C-1);n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+C-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--a;);n.strstart=r,n.lookahead=C-1,te(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=C-1,n.match_available=0,e.next_in=l,e.input=u,e.avail_in=c,n.wrap=s,d},n.deflateInfo=`pako deflate (from Nodeca project)`},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}},{}],48:[function(e,t,n){t.exports=function(e,t){var n=e.state,r=e.next_in,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T=e.input,E;i=r+(e.avail_in-5),a=e.next_out,E=e.output,o=a-(t-e.avail_out),s=a+(e.avail_out-257),c=n.dmax,l=n.wsize,u=n.whave,d=n.wnext,f=n.window,p=n.hold,m=n.bits,h=n.lencode,g=n.distcode,_=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;e:do{m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=h[p&_];t:for(;;){if(p>>>=b=y>>>24,m-=b,(b=y>>>16&255)==0)E[a++]=65535&y;else{if(!(16&b)){if(!(64&b)){y=h[(65535&y)+(p&(1<<b)-1)];continue t}if(32&b){n.mode=12;break e}e.msg=`invalid literal/length code`,n.mode=30;break e}x=65535&y,(b&=15)&&(m<b&&(p+=T[r++]<<m,m+=8),x+=p&(1<<b)-1,p>>>=b,m-=b),m<15&&(p+=T[r++]<<m,m+=8,p+=T[r++]<<m,m+=8),y=g[p&v];r:for(;;){if(p>>>=b=y>>>24,m-=b,!(16&(b=y>>>16&255))){if(!(64&b)){y=g[(65535&y)+(p&(1<<b)-1)];continue r}e.msg=`invalid distance code`,n.mode=30;break e}if(S=65535&y,m<(b&=15)&&(p+=T[r++]<<m,(m+=8)<b&&(p+=T[r++]<<m,m+=8)),c<(S+=p&(1<<b)-1)){e.msg=`invalid distance too far back`,n.mode=30;break e}if(p>>>=b,m-=b,(b=a-o)<S){if(u<(b=S-b)&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break e}if(w=f,(C=0)===d){if(C+=l-b,b<x){for(x-=b;E[a++]=f[C++],--b;);C=a-S,w=E}}else if(d<b){if(C+=l+d-b,(b-=d)<x){for(x-=b;E[a++]=f[C++],--b;);if(C=0,d<x){for(x-=b=d;E[a++]=f[C++],--b;);C=a-S,w=E}}}else if(C+=d-b,b<x){for(x-=b;E[a++]=f[C++],--b;);C=a-S,w=E}for(;2<x;)E[a++]=w[C++],E[a++]=w[C++],E[a++]=w[C++],x-=3;x&&(E[a++]=w[C++],1<x&&(E[a++]=w[C++]))}else{for(C=a-S;E[a++]=E[C++],E[a++]=E[C++],E[a++]=E[C++],2<(x-=3););x&&(E[a++]=E[C++],1<x&&(E[a++]=E[C++]))}break}}break}}while(r<i&&a<s);r-=x=m>>3,p&=(1<<(m-=x<<3))-1,e.next_in=r,e.next_out=a,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=a<s?s-a+257:257-(a-s),n.hold=p,n.bits=m}},{}],49:[function(e,t,n){var r=e(`../utils/common`),i=e(`./adler32`),a=e(`./crc32`),o=e(`./inffast`),s=e(`./inftrees`),c=1,l=2,u=0,d=-2,f=1,p=852,m=592;function h(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function _(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg=``,t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(p),t.distcode=t.distdyn=new r.Buf32(m),t.sane=1,t.back=-1,u):d}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,_(e)):d}function y(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?d:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,v(e))):d}function b(e,t){var n,r;return e?(r=new g,(e.state=r).window=null,(n=y(e,t))!==u&&(e.state=null),n):d}var x,S,C=!0;function w(e){if(C){var t;for(x=new r.Buf32(512),S=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(c,e.lens,0,288,x,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(l,e.lens,0,32,S,0,e.work,{bits:5}),C=!1}e.lencode=x,e.lenbits=9,e.distcode=S,e.distbits=5}function T(e,t,n,i){var a,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new r.Buf8(o.wsize)),i>=o.wsize?(r.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(i<(a=o.wsize-o.wnext)&&(a=i),r.arraySet(o.window,t,n-i,a,o.wnext),(i-=a)?(r.arraySet(o.window,t,n-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}n.inflateReset=v,n.inflateReset2=y,n.inflateResetKeep=_,n.inflateInit=function(e){return b(e,15)},n.inflateInit2=b,n.inflate=function(e,t){var n,p,m,g,_,v,y,b,x,S,C,E,D,O,k,A,j,M,N,P,F,I,L,R,ee=0,te=new r.Buf8(4),ne=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return d;(n=e.state).mode===12&&(n.mode=13),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,S=v,C=y,I=u;e:for(;;)switch(n.mode){case f:if(n.wrap===0){n.mode=13;break}for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(2&n.wrap&&b===35615){te[n.check=0]=255&b,te[1]=b>>>8&255,n.check=a(n.check,te,2,0),x=b=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&b)<<8)+(b>>8))%31){e.msg=`incorrect header check`,n.mode=30;break}if((15&b)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(x-=4,F=8+(15&(b>>>=4)),n.wbits===0)n.wbits=F;else if(F>n.wbits){e.msg=`invalid window size`,n.mode=30;break}n.dmax=1<<F,e.adler=n.check=1,n.mode=512&b?10:12,x=b=0;break;case 2:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(n.flags=b,(255&n.flags)!=8){e.msg=`unknown compression method`,n.mode=30;break}if(57344&n.flags){e.msg=`unknown header flags set`,n.mode=30;break}n.head&&(n.head.text=b>>8&1),512&n.flags&&(te[0]=255&b,te[1]=b>>>8&255,n.check=a(n.check,te,2,0)),x=b=0,n.mode=3;case 3:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.head&&(n.head.time=b),512&n.flags&&(te[0]=255&b,te[1]=b>>>8&255,te[2]=b>>>16&255,te[3]=b>>>24&255,n.check=a(n.check,te,4,0)),x=b=0,n.mode=4;case 4:for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.head&&(n.head.xflags=255&b,n.head.os=b>>8),512&n.flags&&(te[0]=255&b,te[1]=b>>>8&255,n.check=a(n.check,te,2,0)),x=b=0,n.mode=5;case 5:if(1024&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.length=b,n.head&&(n.head.extra_len=b),512&n.flags&&(te[0]=255&b,te[1]=b>>>8&255,n.check=a(n.check,te,2,0)),x=b=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(v<(E=n.length)&&(E=v),E&&(n.head&&(F=n.head.extra_len-n.length,n.head.extra||(n.head.extra=Array(n.head.extra_len)),r.arraySet(n.head.extra,p,g,E,F)),512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,n.length-=E),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(v===0)break e;for(E=0;F=p[g+ E++],n.head&&F&&n.length<65536&&(n.head.name+=String.fromCharCode(F)),F&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,F)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(v===0)break e;for(E=0;F=p[g+ E++],n.head&&F&&n.length<65536&&(n.head.comment+=String.fromCharCode(F)),F&&E<v;);if(512&n.flags&&(n.check=a(n.check,p,E,g)),v-=E,g+=E,F)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;x<16;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b!==(65535&n.check)){e.msg=`header crc mismatch`,n.mode=30;break}x=b=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}e.adler=n.check=h(b),x=b=0,n.mode=11;case 11:if(n.havedict===0)return e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,2;e.adler=n.check=1,n.mode=12;case 12:if(t===5||t===6)break e;case 13:if(n.last){b>>>=7&x,x-=7&x,n.mode=27;break}for(;x<3;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}switch(n.last=1&b,--x,3&(b>>>=1)){case 0:n.mode=14;break;case 1:if(w(n),n.mode=20,t!==6)break;b>>>=2,x-=2;break e;case 2:n.mode=17;break;case 3:e.msg=`invalid block type`,n.mode=30}b>>>=2,x-=2;break;case 14:for(b>>>=7&x,x-=7&x;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if((65535&b)!=(b>>>16^65535)){e.msg=`invalid stored block lengths`,n.mode=30;break}if(n.length=65535&b,x=b=0,n.mode=15,t===6)break e;case 15:n.mode=16;case 16:if(E=n.length){if(v<E&&(E=v),y<E&&(E=y),E===0)break e;r.arraySet(m,p,g,E,_),v-=E,g+=E,y-=E,_+=E,n.length-=E;break}n.mode=12;break;case 17:for(;x<14;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(n.nlen=257+(31&b),b>>>=5,x-=5,n.ndist=1+(31&b),b>>>=5,x-=5,n.ncode=4+(15&b),b>>>=4,x-=4,286<n.nlen||30<n.ndist){e.msg=`too many length or distance symbols`,n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;x<3;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.lens[ne[n.have++]]=7&b,b>>>=3,x-=3}for(;n.have<19;)n.lens[ne[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,L={bits:n.lenbits},I=s(0,n.lens,0,19,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid code lengths set`,n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;A=(ee=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&ee,!((k=ee>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(j<16)b>>>=k,x-=k,n.lens[n.have++]=j;else{if(j===16){for(R=k+2;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b>>>=k,x-=k,n.have===0){e.msg=`invalid bit length repeat`,n.mode=30;break}F=n.lens[n.have-1],E=3+(3&b),b>>>=2,x-=2}else if(j===17){for(R=k+3;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,F=0,E=3+(7&(b>>>=k)),b>>>=3,x-=3}else{for(R=k+7;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}x-=k,F=0,E=11+(127&(b>>>=k)),b>>>=7,x-=7}if(n.have+E>n.nlen+n.ndist){e.msg=`invalid bit length repeat`,n.mode=30;break}for(;E--;)n.lens[n.have++]=F}}if(n.mode===30)break;if(n.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,n.mode=30;break}if(n.lenbits=9,L={bits:n.lenbits},I=s(c,n.lens,0,n.nlen,n.lencode,0,n.work,L),n.lenbits=L.bits,I){e.msg=`invalid literal/lengths set`,n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,L={bits:n.distbits},I=s(l,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,L),n.distbits=L.bits,I){e.msg=`invalid distances set`,n.mode=30;break}if(n.mode=20,t===6)break e;case 20:n.mode=21;case 21:if(6<=v&&258<=y){e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,o(e,C),_=e.next_out,m=e.output,y=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,b=n.hold,x=n.bits,n.mode===12&&(n.back=-1);break}for(n.back=0;A=(ee=n.lencode[b&(1<<n.lenbits)-1])>>>16&255,j=65535&ee,!((k=ee>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(A&&!(240&A)){for(M=k,N=A,P=j;A=(ee=n.lencode[P+((b&(1<<M+N)-1)>>M)])>>>16&255,j=65535&ee,!(M+(k=ee>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}b>>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,n.length=j,A===0){n.mode=26;break}if(32&A){n.back=-1,n.mode=12;break}if(64&A){e.msg=`invalid literal/length code`,n.mode=30;break}n.extra=15&A,n.mode=22;case 22:if(n.extra){for(R=n.extra;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.length+=b&(1<<n.extra)-1,b>>>=n.extra,x-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;A=(ee=n.distcode[b&(1<<n.distbits)-1])>>>16&255,j=65535&ee,!((k=ee>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(!(240&A)){for(M=k,N=A,P=j;A=(ee=n.distcode[P+((b&(1<<M+N)-1)>>M)])>>>16&255,j=65535&ee,!(M+(k=ee>>>24)<=x);){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}b>>>=M,x-=M,n.back+=M}if(b>>>=k,x-=k,n.back+=k,64&A){e.msg=`invalid distance code`,n.mode=30;break}n.offset=j,n.extra=15&A,n.mode=24;case 24:if(n.extra){for(R=n.extra;x<R;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}n.offset+=b&(1<<n.extra)-1,b>>>=n.extra,x-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg=`invalid distance too far back`,n.mode=30;break}n.mode=25;case 25:if(y===0)break e;if(E=C-y,n.offset>E){if((E=n.offset-E)>n.whave&&n.sane){e.msg=`invalid distance too far back`,n.mode=30;break}D=E>n.wnext?(E-=n.wnext,n.wsize-E):n.wnext-E,E>n.length&&(E=n.length),O=n.window}else O=m,D=_-n.offset,E=n.length;for(y<E&&(E=y),y-=E,n.length-=E;m[_++]=O[D++],--E;);n.length===0&&(n.mode=21);break;case 26:if(y===0)break e;m[_++]=n.length,y--,n.mode=21;break;case 27:if(n.wrap){for(;x<32;){if(v===0)break e;v--,b|=p[g++]<<x,x+=8}if(C-=y,e.total_out+=C,n.total+=C,C&&(e.adler=n.check=n.flags?a(n.check,m,C,_-C):i(n.check,m,C,_-C)),C=y,(n.flags?b:h(b))!==n.check){e.msg=`incorrect data check`,n.mode=30;break}x=b=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;x<32;){if(v===0)break e;v--,b+=p[g++]<<x,x+=8}if(b!==(4294967295&n.total)){e.msg=`incorrect length check`,n.mode=30;break}x=b=0}n.mode=29;case 29:I=1;break e;case 30:I=-3;break e;case 31:return-4;case 32:default:return d}return e.next_out=_,e.avail_out=y,e.next_in=g,e.avail_in=v,n.hold=b,n.bits=x,(n.wsize||C!==e.avail_out&&n.mode<30&&(n.mode<27||t!==4))&&T(e,e.output,e.next_out,C-e.avail_out)?(n.mode=31,-4):(S-=e.avail_in,C-=e.avail_out,e.total_in+=S,e.total_out+=C,n.total+=C,n.wrap&&C&&(e.adler=n.check=n.flags?a(n.check,m,C,e.next_out-C):i(n.check,m,C,e.next_out-C)),e.data_type=n.bits+(n.last?64:0)+(n.mode===12?128:0)+(n.mode===20||n.mode===15?256:0),(S==0&&C===0||t===4)&&I===u&&(I=-5),I)},n.inflateEnd=function(e){if(!e||!e.state)return d;var t=e.state;return t.window&&=null,e.state=null,u},n.inflateGetHeader=function(e,t){var n;return e&&e.state&&2&(n=e.state).wrap?((n.head=t).done=!1,u):d},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?(n=e.state).wrap!==0&&n.mode!==11?d:n.mode===11&&i(1,t,r,0)!==n.check?-3:T(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,u):d},n.inflateInfo=`pako inflate (from Nodeca project)`},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){var r=e(`../utils/common`),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],a=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],o=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,c,l,u,d,f){var p,m,h,g,_,v,y,b,x,S=f.bits,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A=0,j=0,M=0,N=null,P=0,F=new r.Buf16(16),I=new r.Buf16(16),L=null,R=0;for(C=0;C<=15;C++)F[C]=0;for(w=0;w<c;w++)F[t[n+w]]++;for(D=S,E=15;1<=E&&F[E]===0;E--);if(E<D&&(D=E),E===0)return l[u++]=20971520,l[u++]=20971520,f.bits=1,0;for(T=1;T<E&&F[T]===0;T++);for(D<T&&(D=T),C=A=1;C<=15;C++)if(A<<=1,(A-=F[C])<0)return-1;if(0<A&&(e===0||E!==1))return-1;for(I[1]=0,C=1;C<15;C++)I[C+1]=I[C]+F[C];for(w=0;w<c;w++)t[n+w]!==0&&(d[I[t[n+w]]++]=w);if(v=e===0?(N=L=d,19):e===1?(N=i,P-=257,L=a,R-=257,256):(N=o,L=s,-1),C=T,_=u,k=w=M=0,h=-1,g=(j=1<<(O=D))-1,e===1&&852<j||e===2&&592<j)return 1;for(;;){for(y=C-k,x=d[w]<v?(b=0,d[w]):d[w]>v?(b=L[R+d[w]],N[P+d[w]]):(b=96,0),p=1<<C-k,T=m=1<<O;l[_+(M>>k)+(m-=p)]=y<<24|b<<16|x|0,m!==0;);for(p=1<<C-1;M&p;)p>>=1;if(p===0?M=0:(M&=p-1,M+=p),w++,--F[C]==0){if(C===E)break;C=t[n+d[w]]}if(D<C&&(M&g)!==h){for(k===0&&(k=D),_+=T,A=1<<(O=C-k);O+k<E&&!((A-=F[O+k])<=0);)O++,A<<=1;if(j+=1<<O,e===1&&852<j||e===2&&592<j)return 1;l[h=M&g]=D<<24|O<<16|_-u|0}}return M!==0&&(l[_+M]=C-k<<24|4194304),f.bits=D,0}},{"../utils/common":41}],51:[function(e,t,n){t.exports={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}},{}],52:[function(e,t,n){var r=e(`../utils/common`),i=0,a=1;function o(e){for(var t=e.length;0<=--t;)e[t]=0}var s=0,c=29,l=256,u=l+1+c,d=30,f=19,p=2*u+1,m=15,h=16,g=7,_=256,v=16,y=17,b=18,x=[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],S=[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],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],w=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],T=Array(2*(u+2));o(T);var E=Array(2*d);o(E);var D=Array(512);o(D);var O=Array(256);o(O);var k=Array(c);o(k);var A,j,M,N=Array(d);function P(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function F(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function I(e){return e<256?D[e]:D[256+(e>>>7)]}function L(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function R(e,t,n){e.bi_valid>h-n?(e.bi_buf|=t<<e.bi_valid&65535,L(e,e.bi_buf),e.bi_buf=t>>h-e.bi_valid,e.bi_valid+=n-h):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function ee(e,t,n){R(e,n[2*t],n[2*t+1])}function te(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function ne(e,t,n){var r,i,a=Array(m+1),o=0;for(r=1;r<=m;r++)a[r]=o=o+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];s!==0&&(e[2*i]=te(a[s]++,s))}}function re(e){var t;for(t=0;t<u;t++)e.dyn_ltree[2*t]=0;for(t=0;t<d;t++)e.dyn_dtree[2*t]=0;for(t=0;t<f;t++)e.bl_tree[2*t]=0;e.dyn_ltree[2*_]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function z(e){8<e.bi_valid?L(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function ie(e,t,n,r){var i=2*t,a=2*n;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function ae(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&ie(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!ie(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function oe(e,t,n){var r,i,a,o,s=0;if(e.last_lit!==0)for(;r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,r===0?ee(e,i,t):(ee(e,(a=O[i])+l+1,t),(o=x[a])!==0&&R(e,i-=k[a],o),ee(e,a=I(--r),n),(o=S[a])!==0&&R(e,r-=N[a],o)),s<e.last_lit;);ee(e,_,t)}function se(e,t){var n,r,i,a=t.dyn_tree,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=p,n=0;n<c;n++)a[2*n]===0?a[2*n+1]=0:(e.heap[++e.heap_len]=l=n,e.depth[n]=0);for(;e.heap_len<2;)a[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=o[2*i+1]);for(t.max_code=l,n=e.heap_len>>1;1<=n;n--)ae(e,a,n);for(i=c;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ae(e,a,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,a[2*i]=a[2*n]+a[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,a[2*n+1]=a[2*r+1]=i,e.heap[1]=i++,ae(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,a,o,s,c=t.dyn_tree,l=t.max_code,u=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,h=t.stat_desc.extra_base,g=t.stat_desc.max_length,_=0;for(a=0;a<=m;a++)e.bl_count[a]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<p;n++)g<(a=c[2*c[2*(r=e.heap[n])+1]+1]+1)&&(a=g,_++),c[2*r+1]=a,l<r||(e.bl_count[a]++,o=0,h<=r&&(o=f[r-h]),s=c[2*r],e.opt_len+=s*(a+o),d&&(e.static_len+=s*(u[2*r+1]+o)));if(_!==0){do{for(a=g-1;e.bl_count[a]===0;)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[g]--,_-=2}while(0<_);for(a=g;a!==0;a--)for(r=e.bl_count[a];r!==0;)l<(i=e.heap[--n])||(c[2*i+1]!==a&&(e.opt_len+=(a-c[2*i+1])*c[2*i],c[2*i+1]=a),r--)}}(e,t),ne(a,l,e.bl_count)}function ce(e,t,n){var r,i,a=-1,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=o,o=t[2*(r+1)+1],++s<c&&i===o||(s<l?e.bl_tree[2*i]+=s:i===0?s<=10?e.bl_tree[2*y]++:e.bl_tree[2*b]++:(i!==a&&e.bl_tree[2*i]++,e.bl_tree[2*v]++),a=i,l=(s=0)===o?(c=138,3):i===o?(c=6,3):(c=7,4))}function le(e,t,n){var r,i,a=-1,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(i=o,o=t[2*(r+1)+1],!(++s<c&&i===o)){if(s<l)for(;ee(e,i,e.bl_tree),--s!=0;);else i===0?s<=10?(ee(e,y,e.bl_tree),R(e,s-3,3)):(ee(e,b,e.bl_tree),R(e,s-11,7)):(i!==a&&(ee(e,i,e.bl_tree),s--),ee(e,v,e.bl_tree),R(e,s-3,2));a=i,l=(s=0)===o?(c=138,3):i===o?(c=6,3):(c=7,4)}}o(N);var ue=!1;function de(e,t,n,i){R(e,(s<<1)+ +!!i,3),function(e,t,n,i){z(e),i&&(L(e,n),L(e,~n)),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}n._tr_init=function(e){ue||=(function(){var e,t,n,r,i,a=Array(m+1);for(r=n=0;r<c-1;r++)for(k[r]=n,e=0;e<1<<x[r];e++)O[n++]=r;for(O[n-1]=r,r=i=0;r<16;r++)for(N[r]=i,e=0;e<1<<S[r];e++)D[i++]=r;for(i>>=7;r<d;r++)for(N[r]=i<<7,e=0;e<1<<S[r]-7;e++)D[256+ i++]=r;for(t=0;t<=m;t++)a[t]=0;for(e=0;e<=143;)T[2*e+1]=8,e++,a[8]++;for(;e<=255;)T[2*e+1]=9,e++,a[9]++;for(;e<=279;)T[2*e+1]=7,e++,a[7]++;for(;e<=287;)T[2*e+1]=8,e++,a[8]++;for(ne(T,u+1,a),e=0;e<d;e++)E[2*e+1]=5,E[2*e]=te(e,5);A=new P(T,x,l+1,u,m),j=new P(E,S,0,d,m),M=new P([],C,0,f,g)}(),!0),e.l_desc=new F(e.dyn_ltree,A),e.d_desc=new F(e.dyn_dtree,j),e.bl_desc=new F(e.bl_tree,M),e.bi_buf=0,e.bi_valid=0,re(e)},n._tr_stored_block=de,n._tr_flush_block=function(e,t,n,r){var o,s,c=0;0<e.level?(e.strm.data_type===2&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&e.dyn_ltree[2*t]!==0)return i;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return a;for(t=32;t<l;t++)if(e.dyn_ltree[2*t]!==0)return a;return i}(e)),se(e,e.l_desc),se(e,e.d_desc),c=function(e){var t;for(ce(e,e.dyn_ltree,e.l_desc.max_code),ce(e,e.dyn_dtree,e.d_desc.max_code),se(e,e.bl_desc),t=f-1;3<=t&&e.bl_tree[2*w[t]+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),o=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=o&&(o=s)):o=s=n+5,n+4<=o&&t!==-1?de(e,t,n,r):e.strategy===4||s===o?(R(e,2+ +!!r,3),oe(e,T,E)):(R(e,4+ +!!r,3),function(e,t,n,r){var i;for(R(e,t-257,5),R(e,n-1,5),R(e,r-4,4),i=0;i<r;i++)R(e,e.bl_tree[2*w[i]+1],3);le(e,e.dyn_ltree,t-1),le(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,c+1),oe(e,e.dyn_ltree,e.dyn_dtree)),re(e),r&&z(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,t===0?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(O[n]+l+1)]++,e.dyn_dtree[2*I(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){R(e,2,3),ee(e,_,T),function(e){e.bi_valid===16?(L(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){(function(e,t){if(!e.setImmediate){var n,r,i,a,o=1,s={},c=!1,l=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,n={}.toString.call(e.process)===`[object process]`?function(e){process.nextTick(function(){f(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}()?(a=`setImmediate$`+Math.random()+`$`,e.addEventListener?e.addEventListener(`message`,p,!1):e.attachEvent(`onmessage`,p),function(t){e.postMessage(a+t,`*`)}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){f(e.data)},function(e){i.port2.postMessage(e)}):l&&`onreadystatechange`in l.createElement(`script`)?(r=l.documentElement,function(e){var t=l.createElement(`script`);t.onreadystatechange=function(){f(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(f,0,e)},u.setImmediate=function(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];return s[o]={callback:e,args:t},n(o),o++},u.clearImmediate=d}function d(e){delete s[e]}function f(e){if(c)setTimeout(f,0,e);else{var n=s[e];if(n){c=!0;try{(function(e){var n=e.callback,r=e.args;switch(r.length){case 0:n();break;case 1:n(r[0]);break;case 2:n(r[0],r[1]);break;case 3:n(r[0],r[1],r[2]);break;default:n.apply(t,r)}})(n)}finally{d(e),c=!1}}}}function p(t){t.source===e&&typeof t.data==`string`&&t.data.indexOf(a)===0&&f(+t.data.slice(a.length))}})(typeof self>`u`?e===void 0?this:e:self)}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{})},{}]},{},[10])(10)})}))(),1);function sm(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),setTimeout(()=>URL.revokeObjectURL(n),1500)}async function cm(e){let t=new om.default;for(let n of e)t.file(n.name,n.blob);return await t.generateAsync({type:`blob`})}async function lm(e,t){sm(await cm(e),t.endsWith(`.zip`)?t:`${t}.zip`)}function um({open:e,onClose:t,files:n,defaultZipName:r=`processed_files.zip`,toolName:i=`Tool Studio`}){let[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(null),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(``),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(`drive`),[b,x]=(0,v.useState)(r),[S,C]=(0,v.useState)(new Set),{uploadFiles:w}=Uo(),{toast:T}=as();if((0,v.useEffect)(()=>{e&&(C(new Set(n.map((e,t)=>t))),x(r))},[e,n,r]),(0,v.useEffect)(()=>{if(!e)return;async function t(){c(!0);try{o((await W(`/folders`)).folders||[])}catch(e){console.error(`Failed to load folders:`,e)}finally{c(!1)}}t()},[e]),!e||n.length===0)return null;let E=e=>{C(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},D=()=>{S.size===n.length?C(new Set):C(new Set(n.map((e,t)=>t)))},O=n.filter((e,t)=>S.has(t)),k=async()=>{if(p.trim())try{let e=await W(`/folders`,{method:`POST`,body:JSON.stringify({name:p.trim()})});o(t=>[e.folder,...t]),u(e.folder.id),m(``),f(!1),T.success(`Folder "${e.folder.name}" berhasil dibuat!`)}catch(e){T.error(e.message||`Gagal membuat folder`)}},A=e=>{sm(e.blob,e.name),T.success(`Mengunduh ${e.name}...`)};return(0,U.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/32 backdrop-blur-xs animate-in fade-in duration-200`,children:(0,U.jsxs)(`div`,{className:`flex flex-col w-full max-w-lg max-h-[85vh] bg-white dark:bg-[#1E1F20] rounded-[28px] shadow-2xl border border-[#E0E3E7] dark:border-[#36373A] overflow-hidden`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-6 py-4 border-b border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h2`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Simpan Hasil Berkas`}),(0,U.jsxs)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mt-0.5`,children:[n.length,` berkas hasil dari `,i]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:t,className:`flex items-center justify-center w-8 h-8 rounded-full text-[#444746] hover:bg-black/5 dark:text-[#C4C7C5] dark:hover:bg-white/10`,children:(0,U.jsx)(Hi,{className:`w-5 h-5`})})]}),(0,U.jsx)(`div`,{className:`px-6 py-3 border-b border-[#E0E3E7]/60 dark:border-[#36373A]/60 bg-[#F8FAFD] dark:bg-[#131314]`,children:(0,U.jsx)(`div`,{className:`grid grid-cols-3 gap-2`,children:[{id:`drive`,label:`Ke 9Drive`,icon:jr},{id:`local`,label:`Download PC`,icon:Lr},{id:`both`,label:`Keduanya`,icon:Ui}].map(e=>{let t=e.icon;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>y(e.id),className:`flex items-center justify-center gap-1.5 h-8 px-2 rounded-full text-xs font-medium border transition-all ${_===e.id?`bg-[#C2E7FF] text-[#001D35] border-[#C2E7FF] dark:bg-[#004A77] dark:text-[#C2E7FF] dark:border-[#004A77]`:`bg-white dark:bg-[#1E1F20] text-[#444746] dark:text-[#C4C7C5] border-[#E0E3E7] dark:border-[#36373A] hover:bg-[#F0F4F9]`}`,children:[(0,U.jsx)(t,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:e.label})]},e.id)})})}),(0,U.jsxs)(`div`,{className:`flex-1 overflow-y-auto p-6 space-y-4`,children:[(_===`drive`||_===`both`)&&(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between mb-2`,children:[(0,U.jsx)(`label`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Pilih Folder Tujuan di 9Drive:`}),(0,U.jsxs)(`button`,{type:`button`,onClick:()=>f(!d),className:`text-xs text-[#0B57D0] dark:text-[#A8C7FA] hover:underline flex items-center gap-1 font-medium`,children:[(0,U.jsx)(Jr,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:`Folder Baru`})]})]}),d&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 p-2 mb-3 rounded-xl bg-[#F0F4F9] dark:bg-[#28292A] border border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsx)(Os,{type:`text`,placeholder:`Nama folder baru...`,value:p,onChange:e=>m(e.target.value),className:`h-8 text-xs bg-white dark:bg-[#1E1F20]`,onKeyDown:e=>e.key===`Enter`&&k(),autoFocus:!0}),(0,U.jsx)(G,{size:`sm`,onClick:k,className:`h-8 text-xs rounded-lg`,children:`Buat`})]}),(0,U.jsxs)(`div`,{className:`space-y-1 max-h-40 overflow-y-auto pr-1`,children:[(0,U.jsxs)(`div`,{onClick:()=>u(null),className:`flex items-center justify-between p-2.5 rounded-xl cursor-pointer transition-colors border ${l===null?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] hover:bg-[#F8FAFD] text-[#444746] dark:border-[#36373A] dark:hover:bg-[#28292A] dark:text-[#C4C7C5]`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(Zr,{className:`w-4 h-4`}),(0,U.jsx)(`span`,{className:`text-xs font-medium`,children:`My Drive (Utama)`})]}),l===null&&(0,U.jsx)(Tr,{className:`w-4 h-4 text-[#0B57D0] dark:text-[#C2E7FF]`})]}),s?(0,U.jsxs)(`div`,{className:`flex items-center justify-center p-4 text-xs text-[#747775]`,children:[(0,U.jsx)(oi,{className:`w-4 h-4 animate-spin mr-2`}),`Memuat daftar folder...`]}):a.map(e=>{let t=l===e.id;return(0,U.jsxs)(`div`,{onClick:()=>u(e.id),className:`flex items-center justify-between p-2.5 rounded-xl cursor-pointer transition-colors border ${t?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] hover:bg-[#F8FAFD] text-[#444746] dark:border-[#36373A] dark:hover:bg-[#28292A] dark:text-[#C4C7C5]`}`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsx)(Yr,{className:`w-4 h-4 text-[#5F6368]`}),(0,U.jsx)(`span`,{className:`text-xs font-medium truncate`,children:e.name})]}),t&&(0,U.jsx)(Tr,{className:`w-4 h-4 text-[#0B57D0] dark:text-[#C2E7FF]`})]},e.id)})]})]}),(_===`local`||_===`both`)&&O.length>1&&(0,U.jsxs)(`div`,{className:`space-y-1.5 pt-1`,children:[(0,U.jsx)(`label`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Nama Berkas ZIP:`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(mr,{className:`w-4 h-4 text-[#747775]`}),(0,U.jsx)(Os,{type:`text`,value:b,onChange:e=>x(e.target.value),className:`h-8 text-xs rounded-lg`,placeholder:`arsip.zip`})]})]}),(0,U.jsxs)(`div`,{className:`rounded-2xl p-3.5 bg-[#F8FAFD] dark:bg-[#131314] border border-[#E0E3E7] dark:border-[#36373A] space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between pb-2 border-b border-[#E0E3E7]/60 dark:border-[#36373A]/60`,children:[(0,U.jsxs)(`label`,{className:`flex items-center gap-2 cursor-pointer select-none text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:S.size===n.length&&n.length>0,onChange:D,className:`w-4 h-4 rounded text-[#0B57D0] focus:ring-[#0B57D0] accent-[#0B57D0] cursor-pointer`}),(0,U.jsx)(`span`,{children:`Pilih Semua Berkas`})]}),(0,U.jsxs)(`span`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:[S.size,` dari `,n.length,` dipilih`]})]}),(0,U.jsx)(`div`,{className:`max-h-48 overflow-y-auto space-y-1.5 pr-1`,children:n.map((e,t)=>{let n=S.has(t);return(0,U.jsxs)(`div`,{className:`flex items-center justify-between p-2 rounded-xl border transition-colors ${n?`border-[#C2E7FF] bg-white dark:border-[#004A77] dark:bg-[#1E1F20]`:`border-transparent bg-transparent opacity-60 hover:opacity-100`}`,children:[(0,U.jsxs)(`label`,{className:`flex items-center gap-2.5 flex-1 min-w-0 cursor-pointer select-none`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:n,onChange:()=>E(t),className:`w-3.5 h-3.5 rounded text-[#0B57D0] focus:ring-[#0B57D0] accent-[#0B57D0] cursor-pointer shrink-0`}),(0,U.jsx)(`span`,{className:`text-xs text-[#1F1F1F] dark:text-[#E3E3E3] truncate`,children:e.name}),e.size&&(0,U.jsx)(`span`,{className:`text-[10px] text-[#747775] dark:text-[#8E918F] shrink-0 font-mono`,children:wo(e.size)})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>A(e),title:`Unduh ${e.name} secara terpisah`,className:`w-7 h-7 rounded-lg hover:bg-[#F0F4F9] dark:hover:bg-[#28292A] text-[#747775] hover:text-[#0B57D0] dark:text-[#8E918F] dark:hover:text-[#A8C7FA] flex items-center justify-center shrink-0 ml-1 transition-colors`,children:(0,U.jsx)(Lr,{className:`w-3.5 h-3.5`})})]},t)})})]})]}),(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row items-center justify-between gap-3 px-6 py-4 border-t border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#131314]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 w-full sm:w-auto`,children:[(0,U.jsx)(G,{variant:`outline`,size:`sm`,onClick:t,disabled:h,className:`h-9 text-xs rounded-full border-[#E0E3E7] dark:border-[#36373A]`,children:`Batal`}),n.length>1&&(0,U.jsxs)(G,{variant:`outline`,size:`sm`,onClick:async()=>{g(!0);try{await lm(n,b),T.success(`Mengunduh seluruh ${n.length} berkas dalam arsip ZIP!`)}catch{T.error(`Gagal membuat berkas ZIP`)}finally{g(!1)}},disabled:h,className:`h-9 px-3 text-xs rounded-full border-[#E0E3E7] dark:border-[#36373A] text-[#1F1F1F] dark:text-[#E3E3E3] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`,children:[(0,U.jsx)(mr,{className:`w-3.5 h-3.5 mr-1 text-[#0B57D0] dark:text-[#A8C7FA]`}),`Unduh Semua (.zip)`]})]}),(0,U.jsx)(G,{size:`sm`,onClick:async()=>{if(O.length===0){T.error(`Pilih minimal satu berkas untuk disimpan.`);return}g(!0);try{(_===`local`||_===`both`)&&(O.length===1?sm(O[0].blob,O[0].name):await lm(O,b)),(_===`drive`||_===`both`)&&(await w(O.map(e=>new File([e.blob],e.name,{type:e.blob.type||`application/octet-stream`})),l),T.success(`${O.length} berkas disimpan ke 9Drive${l?` (${a.find(e=>e.id===l)?.name||`folder`})`:` (My Drive)`}!`)),t()}catch(e){console.error(`Save failed:`,e),T.error(e.message||`Gagal menyimpan berkas`)}finally{g(!1)}},disabled:h||S.size===0,className:`h-9 px-5 text-xs font-medium rounded-full bg-[#0B57D0] hover:bg-[#0842A0] text-white shadow-xs w-full sm:w-auto`,children:h?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(oi,{className:`w-3.5 h-3.5 animate-spin mr-1.5`}),`Menyimpan...`]}):_===`drive`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(jr,{className:`w-3.5 h-3.5 mr-1.5`}),`Simpan Terpilih (`,S.size,`) ke 9Drive`]}):_===`local`?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Lr,{className:`w-3.5 h-3.5 mr-1.5`}),`Unduh Terpilih (`,S.size,`)`]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ui,{className:`w-3.5 h-3.5 mr-1.5`}),`Simpan & Unduh (`,S.size,`)`]})})]})]})})}function dm(){let e=tt(),t=Qe(),{toast:n}=as(),[r,i]=(0,v.useState)([]),[a,o]=(0,v.useState)(0),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(`transparent`),[h,g]=(0,v.useState)(`#FFFFFF`),[_,y]=(0,v.useState)(!1);(0,v.useEffect)(()=>{if(t.state&&t.state.initialFiles){let e=t.state.initialFiles;e.length>0&&b(e)}},[t.state]);let b=e=>{let t=e.filter(e=>e.type.startsWith(`image/`)||/\.(png|jpe?g|webp|bmp)$/i.test(e.name));if(t.length===0){n.error(`Pilih file gambar yang valid (JPG, PNG, WebP).`);return}let a=t.map(e=>({id:`${e.name}-${Date.now()}-${Math.random()}`,file:e,status:`idle`,thumbnailUrl:URL.createObjectURL(e)})),o=[...r,...a];i(o),x(o)},x=async e=>{f(!0);let t=[...e];for(let e=0;e<t.length;e++){let n=t[e];if(n.status!==`completed`){t[e]={...n,status:`processing`,progress:10,statusMessage:`Menghapus latar belakang foto...`},i([...t]);try{let r=await $p(n.file,{backdrop:p,colorHex:h,addShadow:_,onProgress:(n,r)=>{t[e]={...t[e],progress:n,statusMessage:r},i([...t])}});t[e]={...t[e],status:`completed`,progress:100,statusMessage:`Latar belakang berhasil dihapus`,resultBlob:r},i([...t])}catch(r){console.error(`Error processing ${n.file.name}:`,r),t[e]={...t[e],status:`error`,statusMessage:r.message||`Pemrosesan gagal`},i([...t])}}}f(!1),n.success(`Hapus background selesai!`)},S=e=>{i(t=>{let n=t.filter(t=>t.id!==e);return a>=n.length&&o(Math.max(0,n.length-1)),n})},C=()=>{i([]),o(0)},w=r.filter(e=>e.status===`completed`&&e.resultBlob),T=w.map(e=>({name:`${e.file.name.replace(/\.[^/.]+$/,``)}_nobg.png`,blob:e.resultBlob,size:e.resultBlob.size})),E=r[a];return(0,U.jsxs)(`div`,{className:`flex flex-col min-h-full w-full min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 pb-3 border-b border-[#E0E3E7]/70 dark:border-[#36373A]/70 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>e(`/tools`),className:`text-xl sm:text-[22px] font-normal transition-colors text-[#444746] hover:text-[#0B57D0] dark:text-[#C4C7C5]`,children:`Tools Studio`}),(0,U.jsx)(Cr,{className:`h-4 w-4 text-[#747775] shrink-0`}),(0,U.jsx)(`span`,{className:`truncate text-xl sm:text-[22px] font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Hapus Background AI`})]}),r.length>0&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 sm:shrink-0 sm:justify-end`,children:[(0,U.jsxs)(G,{type:`button`,variant:`outline`,size:`sm`,onClick:C,className:`h-9 px-4 text-xs font-medium rounded-full border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`,children:[(0,U.jsx)(Ci,{className:`w-3.5 h-3.5 mr-1.5`}),`Pilih Foto Lain`]}),w.length>0&&(0,U.jsxs)(G,{type:`button`,size:`sm`,onClick:()=>u(!0),className:`h-9 px-4 text-xs font-medium rounded-full bg-[#0B57D0] hover:bg-[#0842A0] text-white shadow-xs`,children:[(0,U.jsx)(jr,{className:`w-3.5 h-3.5 mr-1.5`}),`Simpan ke 9Drive (`,w.length,`)`]})]})]}),r.length===0?(0,U.jsxs)(`div`,{className:`w-full py-4 flex flex-col space-y-6`,children:[(0,U.jsx)(im,{title:`Tarik & lepaskan foto ke sini, atau pilih berkas`,description:`Hapus background foto manusia, produk, atau objek secara otomatis dengan neural AI langsung di browser Anda.`,acceptedFormats:[`JPG`,`PNG`,`WEBP`],accept:`image/*,.png,.jpg,.jpeg,.webp`,icon:jc,iconColor:`#7248B9`,maxSizeText:`Proses instan • 100% Privat`,multiple:!0,onFilesSelected:b,onOpenDrivePicker:()=>c(!0)}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-4 pt-2`,children:[(0,U.jsxs)(`div`,{className:`p-4 rounded-2xl border border-[#E0E3E7] bg-white dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5 mb-1`,children:[(0,U.jsx)(ji,{className:`w-4 h-4 text-[#7248B9]`}),`Potong Otomatis Rapi`]}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] leading-relaxed`,children:`Otomatis mengenali orang atau benda dan memotong tepian foto secara rapi dan presisi.`})]}),(0,U.jsxs)(`div`,{className:`p-4 rounded-2xl border border-[#E0E3E7] bg-white dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5 mb-1`,children:[(0,U.jsx)(_i,{className:`w-4 h-4 text-[#0B57D0] dark:text-[#A8C7FA]`}),`Latar Kustom Fleksibel`]}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] leading-relaxed`,children:`Pilih transparan PNG, latar warna solid (merah/biru pas foto), atau tambahkan bayangan halus.`})]}),(0,U.jsxs)(`div`,{className:`p-4 rounded-2xl border border-[#E0E3E7] bg-white dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5 mb-1`,children:[(0,U.jsx)(jr,{className:`w-4 h-4 text-[#0F9D58]`}),`Simpan Langsung ke Cloud`]}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] leading-relaxed`,children:`Hasil langsung disimpan ke folder 9Drive atau diunduh ke penyimpanan komputer lokal.`})]})]})]}):(0,U.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-5 mt-4 flex-1`,children:[(0,U.jsxs)(`div`,{className:`lg:col-span-5 flex flex-col space-y-4`,children:[(0,U.jsxs)(`div`,{className:`p-4 rounded-2xl border border-[#E0E3E7] bg-white dark:border-[#36373A] dark:bg-[#1E1F20] space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5`,children:[(0,U.jsx)(_i,{className:`w-3.5 h-3.5 text-[#0B57D0]`}),`Pengaturan Latar Hasil`]}),w.length>0&&(0,U.jsx)(`button`,{type:`button`,onClick:()=>x(r),className:`text-xs text-[#0B57D0] dark:text-[#A8C7FA] hover:underline font-medium`,children:`Terapkan Ulang`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>m(`transparent`),className:`py-1.5 px-3 rounded-lg text-xs font-medium border text-center transition-all ${p===`transparent`?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`}`,children:`Transparan`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>m(`color`),className:`py-1.5 px-3 rounded-lg text-xs font-medium border text-center transition-all ${p===`color`?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`}`,children:`Warna Solid`}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>y(!_),className:`py-1.5 px-3 rounded-lg text-xs font-medium border text-center transition-all ${_?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`}`,children:_?`✓ Bayangan`:`+ Bayangan`})]}),p===`color`&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 pt-1 border-t border-[#E0E3E7]/60 dark:border-[#36373A]/60`,children:[(0,U.jsx)(`input`,{type:`color`,value:h,onChange:e=>g(e.target.value),className:`w-7 h-7 rounded-md cursor-pointer border border-[#E0E3E7] p-0.5`}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-[#747775]`,children:h.toUpperCase()}),(0,U.jsx)(`div`,{className:`flex items-center gap-1.5 ml-auto`,children:[`#FFFFFF`,`#000000`,`#D32F2F`,`#1976D2`].map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>g(e),className:`w-5 h-5 rounded-full border border-black/20`,style:{backgroundColor:e}},e))})]})]}),(0,U.jsx)(nm,{items:r,onAddFiles:b,onRemoveItem:S,onClear:C,onOpenDrivePicker:()=>c(!0),accept:`image/*`,disabled:d})]}),(0,U.jsx)(`div`,{className:`lg:col-span-7 flex flex-col space-y-3`,children:E&&E.resultBlob?(0,U.jsxs)(`div`,{className:`flex flex-col space-y-3`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between px-1`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5`,children:[(0,U.jsx)(Tr,{className:`w-4 h-4 text-[#0F9D58]`}),`Hasil: `,E.file.name]}),(0,U.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,U.jsxs)(G,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>sm(E.resultBlob,`${E.file.name.replace(/\.[^/.]+$/,``)}_nobg.png`),className:`h-8 px-3 text-xs rounded-full border-[#E0E3E7] dark:border-[#36373A]`,children:[(0,U.jsx)(Lr,{className:`w-3.5 h-3.5 mr-1`}),`Unduh PNG`]})})]}),(0,U.jsx)(rm,{originalUrl:E.thumbnailUrl,cutoutUrl:URL.createObjectURL(E.resultBlob),alt:E.file.name}),r.length>1&&(0,U.jsx)(`div`,{className:`flex items-center gap-2 overflow-x-auto py-1`,children:r.map((e,t)=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>o(t),className:`relative w-14 h-14 rounded-xl overflow-hidden shrink-0 border-2 transition-all ${a===t?`border-[#0B57D0] scale-105`:`border-transparent opacity-60 hover:opacity-100`}`,children:[(0,U.jsx)(`img`,{src:e.thumbnailUrl,alt:``,className:`w-full h-full object-cover`}),e.status===`completed`&&(0,U.jsx)(`div`,{className:`absolute top-1 right-1 w-3.5 h-3.5 rounded-full bg-[#0F9D58] text-white flex items-center justify-center text-[9px]`,children:`✓`})]},e.id))})]}):(0,U.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center p-8 rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] text-center min-h-[350px]`,children:[(0,U.jsx)(`img`,{src:E?.thumbnailUrl,alt:``,className:`max-h-60 object-contain rounded-xl mb-3 border border-[#E0E3E7] dark:border-[#36373A]`}),(0,U.jsx)(`p`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] mb-1`,children:E?.file.name}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-[#0B57D0] dark:text-[#A8C7FA] font-medium`,children:[(0,U.jsx)(oi,{className:`w-3.5 h-3.5 animate-spin`}),(0,U.jsx)(`span`,{children:`Sedang memotong latar belakang AI...`})]})]})})]}),(0,U.jsx)(am,{open:s,onClose:()=>c(!1),onSelectFiles:b,acceptFilter:`image`}),(0,U.jsx)(um,{open:l,onClose:()=>u(!1),files:T,defaultZipName:`cutout_images.zip`})]})}var fm=function(e,t){return fm=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},fm(e,t)};function J(e,t){fm(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var pm=function(){return pm=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},pm.apply(this,arguments)};function mm(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function hm(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function gm(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if((a=n.trys,!(a=a.length>0&&a[a.length-1]))&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function _m(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var a=arguments[t],o=0,s=a.length;o<s;o++,i++)r[i]=a[o];return r}for(var vm=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,ym=new Uint8Array(256),bm=0;bm<vm.length;bm++)ym[vm.charCodeAt(bm)]=bm;var xm=function(e){for(var t=``,n=e.length,r=0;r<n;r+=3)t+=vm[e[r]>>2],t+=vm[(e[r]&3)<<4|e[r+1]>>4],t+=vm[(e[r+1]&15)<<2|e[r+2]>>6],t+=vm[e[r+2]&63];return n%3==2?t=t.substring(0,t.length-1)+`=`:n%3==1&&(t=t.substring(0,t.length-2)+`==`),t},Sm=function(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=new Uint8Array(t);for(r=0;r<n;r+=4)a=ym[e.charCodeAt(r)],o=ym[e.charCodeAt(r+1)],s=ym[e.charCodeAt(r+2)],c=ym[e.charCodeAt(r+3)],l[i++]=a<<2|o>>4,l[i++]=(o&15)<<4|s>>2,l[i++]=(s&3)<<6|c&63;return l},Cm=/^(data)?:?([\w\/\+]+)?;?(charset=[\w-]+|base64)?.*,/i,wm=function(e){var t=e.trim(),n=t.substring(0,100).match(Cm);if(!n)return Sm(t);var r=n[0];return Sm(t.substring(r.length))},Tm=function(e){return e.charCodeAt(0)},Em=function(e){return e.codePointAt(0)},Dm=function(e,t){return jm(e.toString(16),t,`0`).toUpperCase()},Om=function(e){return Dm(e,2)},km=function(e){return String.fromCharCode(e)},Am=function(e){return km(parseInt(e,16))},jm=function(e,t,n){for(var r=``,i=0,a=t-e.length;i<a;i++)r+=n;return r+e},Mm=function(e,t,n){for(var r=e.length,i=0;i<r;i++)t[n++]=e.charCodeAt(i);return r},Nm=function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)},Pm=function(e){return e.replace(/\t|\u0085|\u2028|\u2029/g,` `).replace(/[\b\v]/g,``)},Fm=[`\\n`,`\\f`,`\\r`,`\\u000B`],Im=function(e){return/^[\n\f\r\u000B]$/.test(e)},Lm=function(e){return e.split(/[\n\f\r\u000B]/)},Rm=function(e){return e.replace(/[\n\f\r\u000B]/g,` `)},zm=function(e,t){var n=e.charCodeAt(t),r,i=t+1,a=1;return n>=55296&&n<=56319&&e.length>i&&(r=e.charCodeAt(i),r>=56320&&r<=57343&&(a=2)),[e.slice(t,t+a),a]},Bm=function(e){for(var t=[],n=0,r=e.length;n<r;){var i=zm(e,n),a=i[0],o=i[1];t.push(a),n+=o}return t},Vm=function(e){for(var t=Fm.join(`|`),n=[`$`],r=0,i=e.length;r<i;r++){var a=e[r];if(Im(a))throw TypeError("`wordBreak` must not include "+t);n.push(a===``?`.`:Nm(a))}var o=n.join(`|`);return RegExp(`(`+t+`)|((.*?)(`+o+`))`,`gm`)},Hm=function(e,t,n,r){for(var i=Vm(t),a=Pm(e).match(i),o=``,s=0,c=[],l=function(){o!==``&&c.push(o),o=``,s=0},u=0,d=a.length;u<d;u++){var f=a[u];if(Im(f))l();else{var p=r(f);s+p>n&&l(),o+=f,s+=p}}return l(),c},Um=/^D:(\d\d\d\d)(\d\d)?(\d\d)?(\d\d)?(\d\d)?(\d\d)?([+\-Z])?(\d\d)?'?(\d\d)?'?$/,Wm=function(e){var t=e.match(Um);if(t){var n=t[1],r=t[2],i=r===void 0?`01`:r,a=t[3],o=a===void 0?`01`:a,s=t[4],c=s===void 0?`00`:s,l=t[5],u=l===void 0?`00`:l,d=t[6],f=d===void 0?`00`:d,p=t[7],m=p===void 0?`Z`:p,h=t[8],g=h===void 0?`00`:h,_=t[9],v=_===void 0?`00`:_,y=m===`Z`?`Z`:``+m+g+`:`+v;return new Date(n+`-`+i+`-`+o+`T`+c+`:`+u+`:`+f+y)}},Gm=function(e,t){for(var n=0,r;n<e.length;){var i=e.substring(n).match(t);if(!i)return{match:r,pos:n};r=i,n+=(i.index??0)+i[0].length}return{match:r,pos:n}},Km=function(e){return e[e.length-1]},qm=function(e){if(e instanceof Uint8Array)return e;for(var t=e.length,n=new Uint8Array(t),r=0;r<t;r++)n[r]=e.charCodeAt(r);return n},Jm=function(){for(var e=[...arguments],t=e.length,n=[],r=0;r<t;r++){var i=e[r];n[r]=i instanceof Uint8Array?i:qm(i)}for(var a=0,r=0;r<t;r++)a+=e[r].length;for(var o=new Uint8Array(a),s=0,c=0;c<t;c++)for(var l=n[c],u=0,d=l.length;u<d;u++)o[s++]=l[u];return o},Ym=function(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e[n].length;for(var i=new Uint8Array(t),a=0,n=0,r=e.length;n<r;n++){var o=e[n];i.set(o,a),a+=o.length}return i},Xm=function(e){for(var t=``,n=0,r=e.length;n<r;n++)t+=km(e[n]);return t},Zm=function(e,t){return e.id-t.id},Qm=function(e,t){for(var n=[],r=0,i=e.length;r<i;r++){var a=e[r],o=e[r-1];(r===0||t(a)!==t(o))&&n.push(a)}return n},$m=function(e){for(var t=e.length,n=0,r=Math.floor(t/2);n<r;n++){var i=n,a=t-n-1,o=e[n];e[i]=e[a],e[a]=o}return e},eh=function(e){for(var t=0,n=0,r=e.length;n<r;n++)t+=e[n];return t},th=function(e,t){for(var n=Array(t-e),r=0,i=n.length;r<i;r++)n[r]=e+r;return n},nh=function(e,t){for(var n=Array(t.length),r=0,i=t.length;r<i;r++)n[r]=e[t[r]];return n},rh=function(e){return e instanceof Uint8Array||e instanceof ArrayBuffer||typeof e==`string`},ih=function(e){if(typeof e==`string`)return wm(e);if(e instanceof ArrayBuffer)return new Uint8Array(e);if(e instanceof Uint8Array)return e;throw TypeError("`input` must be one of `string | ArrayBuffer | Uint8Array`")},ah=function(){return new Promise(function(e){setTimeout(function(){return e()},0)})},oh=function(e,t){t===void 0&&(t=!0);var n=[];t&&n.push(65279);for(var r=0,i=e.length;r<i;){var a=e.codePointAt(r);if(a<65536)n.push(a),r+=1;else if(a<1114112)n.push(lh(a),uh(a)),r+=2;else throw Error(`Invalid code point: 0x`+Om(a))}return new Uint16Array(n)},sh=function(e){return e>=0&&e<=65535},ch=function(e){return e>=65536&&e<=1114111},lh=function(e){return Math.floor((e-65536)/1024)+55296},uh=function(e){return(e-65536)%1024+56320},dh;(function(e){e.BigEndian=`BigEndian`,e.LittleEndian=`LittleEndian`})(dh||={});for(var fh=`�`.codePointAt(0),ph=function(e,t){if(t===void 0&&(t=!0),e.length<=1)return String.fromCodePoint(fh);for(var n=t?_h(e):dh.BigEndian,r=t?2:0,i=[];e.length-r>=2;){var a=gh(e[r++],e[r++],n);if(mh(a))if(e.length-r<2)i.push(fh);else{var o=gh(e[r++],e[r++],n);hh(o)?i.push(a,o):i.push(fh)}else hh(a)?(r+=2,i.push(fh)):i.push(a)}return r<e.length&&i.push(fh),String.fromCodePoint.apply(String,i)},mh=function(e){return e>=55296&&e<=56319},hh=function(e){return e>=56320&&e<=57343},gh=function(e,t,n){if(n===dh.LittleEndian)return t<<8|e;if(n===dh.BigEndian)return e<<8|t;throw Error(`Invalid byteOrder: `+n)},_h=function(e){return vh(e)?dh.BigEndian:yh(e)?dh.LittleEndian:dh.BigEndian},vh=function(e){return e[0]===254&&e[1]===255},yh=function(e){return e[0]===255&&e[1]===254},bh=function(e){return vh(e)||yh(e)},xh=function(e){var t=String(e);if(Math.abs(e)<1){var n=parseInt(e.toString().split(`e-`)[1]);if(n){var r=e<0;r&&(e*=-1),e*=10**(n-1),t=`0.`+Array(n).join(`0`)+e.toString().substring(2),r&&(t=`-`+t)}}else{var n=parseInt(e.toString().split(`+`)[1]);n>20&&(n-=20,e/=10**n,t=e.toString()+Array(n+1).join(`0`))}return t},Sh=function(e){return Math.ceil(e.toString(2).length/8)},Ch=function(e){for(var t=new Uint8Array(Sh(e)),n=1;n<=t.length;n++)t[n-1]=e>>(t.length-n)*8;return t},wh=function(e){throw Error(e)},Th=o((e=>{var t=typeof Uint8Array<`u`&&typeof Uint16Array<`u`&&typeof Int32Array<`u`;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!=`object`)throw TypeError(r+`must be non-object`);for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},e.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var r={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray){e.set(t.subarray(n,n+r),i);return}for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){var t,n,r=0,i,a,o;for(t=0,n=e.length;t<n;t++)r+=e[t].length;for(o=new Uint8Array(r),i=0,t=0,n=e.length;t<n;t++)a=e[t],o.set(a,i),i+=a.length;return o}},i={arraySet:function(e,t,n,r,i){for(var a=0;a<r;a++)e[i+a]=t[n+a]},flattenChunks:function(e){return[].concat.apply([],e)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,r)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,i))},e.setTyped(t)})),Eh=o((e=>{var t=Th(),n=4,r=0,i=1,a=2;function o(e){for(var t=e.length;--t>=0;)e[t]=0}var s=0,c=1,l=2,u=3,d=258,f=29,p=256,m=p+1+f,h=30,g=19,_=2*m+1,v=15,y=16,b=7,x=256,S=16,C=17,w=18,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],E=[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],D=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],k=512,A=Array((m+2)*2);o(A);var j=Array(h*2);o(j);var M=Array(k);o(M);var N=Array(d-u+1);o(N);var P=Array(f);o(P);var F=Array(h);o(F);function I(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}var L,R,ee;function te(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function ne(e){return e<256?M[e]:M[256+(e>>>7)]}function re(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function z(e,t,n){e.bi_valid>y-n?(e.bi_buf|=t<<e.bi_valid&65535,re(e,e.bi_buf),e.bi_buf=t>>y-e.bi_valid,e.bi_valid+=n-y):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function ie(e,t,n){z(e,n[t*2],n[t*2+1])}function ae(e,t){var n=0;do n|=e&1,e>>>=1,n<<=1;while(--t>0);return n>>>1}function oe(e){e.bi_valid===16?(re(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function se(e,t){var n=t.dyn_tree,r=t.max_code,i=t.stat_desc.static_tree,a=t.stat_desc.has_stree,o=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,c=t.stat_desc.max_length,l,u,d,f,p,m,h=0;for(f=0;f<=v;f++)e.bl_count[f]=0;for(n[e.heap[e.heap_max]*2+1]=0,l=e.heap_max+1;l<_;l++)u=e.heap[l],f=n[n[u*2+1]*2+1]+1,f>c&&(f=c,h++),n[u*2+1]=f,!(u>r)&&(e.bl_count[f]++,p=0,u>=s&&(p=o[u-s]),m=n[u*2],e.opt_len+=m*(f+p),a&&(e.static_len+=m*(i[u*2+1]+p)));if(h!==0){do{for(f=c-1;e.bl_count[f]===0;)f--;e.bl_count[f]--,e.bl_count[f+1]+=2,e.bl_count[c]--,h-=2}while(h>0);for(f=c;f!==0;f--)for(u=e.bl_count[f];u!==0;)d=e.heap[--l],!(d>r)&&(n[d*2+1]!==f&&(e.opt_len+=(f-n[d*2+1])*n[d*2],n[d*2+1]=f),u--)}}function ce(e,t,n){var r=Array(v+1),i=0,a,o;for(a=1;a<=v;a++)r[a]=i=i+n[a-1]<<1;for(o=0;o<=t;o++){var s=e[o*2+1];s!==0&&(e[o*2]=ae(r[s]++,s))}}function le(){var e,t,n,r,i,a=Array(v+1);for(n=0,r=0;r<f-1;r++)for(P[r]=n,e=0;e<1<<T[r];e++)N[n++]=r;for(N[n-1]=r,i=0,r=0;r<16;r++)for(F[r]=i,e=0;e<1<<E[r];e++)M[i++]=r;for(i>>=7;r<h;r++)for(F[r]=i<<7,e=0;e<1<<E[r]-7;e++)M[256+ i++]=r;for(t=0;t<=v;t++)a[t]=0;for(e=0;e<=143;)A[e*2+1]=8,e++,a[8]++;for(;e<=255;)A[e*2+1]=9,e++,a[9]++;for(;e<=279;)A[e*2+1]=7,e++,a[7]++;for(;e<=287;)A[e*2+1]=8,e++,a[8]++;for(ce(A,m+1,a),e=0;e<h;e++)j[e*2+1]=5,j[e*2]=ae(e,5);L=new I(A,T,p+1,m,v),R=new I(j,E,0,h,v),ee=new I([],D,0,g,b)}function ue(e){var t;for(t=0;t<m;t++)e.dyn_ltree[t*2]=0;for(t=0;t<h;t++)e.dyn_dtree[t*2]=0;for(t=0;t<g;t++)e.bl_tree[t*2]=0;e.dyn_ltree[x*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function de(e){e.bi_valid>8?re(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function fe(e,n,r,i){de(e),i&&(re(e,r),re(e,~r)),t.arraySet(e.pending_buf,e.window,n,r,e.pending),e.pending+=r}function B(e,t,n,r){var i=t*2,a=n*2;return e[i]<e[a]||e[i]===e[a]&&r[t]<=r[n]}function pe(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&B(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!B(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function me(e,t,n){var r,i,a=0,o,s;if(e.last_lit!==0)do r=e.pending_buf[e.d_buf+a*2]<<8|e.pending_buf[e.d_buf+a*2+1],i=e.pending_buf[e.l_buf+a],a++,r===0?ie(e,i,t):(o=N[i],ie(e,o+p+1,t),s=T[o],s!==0&&(i-=P[o],z(e,i,s)),r--,o=ne(r),ie(e,o,n),s=E[o],s!==0&&(r-=F[o],z(e,r,s)));while(a<e.last_lit);ie(e,x,t)}function he(e,t){var n=t.dyn_tree,r=t.stat_desc.static_tree,i=t.stat_desc.has_stree,a=t.stat_desc.elems,o,s,c=-1,l;for(e.heap_len=0,e.heap_max=_,o=0;o<a;o++)n[o*2]===0?n[o*2+1]=0:(e.heap[++e.heap_len]=c=o,e.depth[o]=0);for(;e.heap_len<2;)l=e.heap[++e.heap_len]=c<2?++c:0,n[l*2]=1,e.depth[l]=0,e.opt_len--,i&&(e.static_len-=r[l*2+1]);for(t.max_code=c,o=e.heap_len>>1;o>=1;o--)pe(e,n,o);l=a;do o=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pe(e,n,1),s=e.heap[1],e.heap[--e.heap_max]=o,e.heap[--e.heap_max]=s,n[l*2]=n[o*2]+n[s*2],e.depth[l]=(e.depth[o]>=e.depth[s]?e.depth[o]:e.depth[s])+1,n[o*2+1]=n[s*2+1]=l,e.heap[1]=l++,pe(e,n,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],se(e,t),ce(n,c,e.bl_count)}function ge(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),t[(n+1)*2+1]=65535,r=0;r<=n;r++)a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)&&(s<l?e.bl_tree[a*2]+=s:a===0?s<=10?e.bl_tree[C*2]++:e.bl_tree[w*2]++:(a!==i&&e.bl_tree[a*2]++,e.bl_tree[S*2]++),s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4))}function _e(e,t,n){var r,i=-1,a,o=t[1],s=0,c=7,l=4;for(o===0&&(c=138,l=3),r=0;r<=n;r++)if(a=o,o=t[(r+1)*2+1],!(++s<c&&a===o)){if(s<l)do ie(e,a,e.bl_tree);while(--s!==0);else a===0?s<=10?(ie(e,C,e.bl_tree),z(e,s-3,3)):(ie(e,w,e.bl_tree),z(e,s-11,7)):(a!==i&&(ie(e,a,e.bl_tree),s--),ie(e,S,e.bl_tree),z(e,s-3,2));s=0,i=a,o===0?(c=138,l=3):a===o?(c=6,l=3):(c=7,l=4)}}function ve(e){var t;for(ge(e,e.dyn_ltree,e.l_desc.max_code),ge(e,e.dyn_dtree,e.d_desc.max_code),he(e,e.bl_desc),t=g-1;t>=3&&e.bl_tree[O[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function ye(e,t,n,r){var i;for(z(e,t-257,5),z(e,n-1,5),z(e,r-4,4),i=0;i<r;i++)z(e,e.bl_tree[O[i]*2+1],3);_e(e,e.dyn_ltree,t-1),_e(e,e.dyn_dtree,n-1)}function V(e){var t=4093624447,n;for(n=0;n<=31;n++,t>>>=1)if(t&1&&e.dyn_ltree[n*2]!==0)return r;if(e.dyn_ltree[18]!==0||e.dyn_ltree[20]!==0||e.dyn_ltree[26]!==0)return i;for(n=32;n<p;n++)if(e.dyn_ltree[n*2]!==0)return i;return r}var H=!1;function be(e){H||=(le(),!0),e.l_desc=new te(e.dyn_ltree,L),e.d_desc=new te(e.dyn_dtree,R),e.bl_desc=new te(e.bl_tree,ee),e.bi_buf=0,e.bi_valid=0,ue(e)}function xe(e,t,n,r){z(e,(s<<1)+ +!!r,3),fe(e,t,n,!0)}function Se(e){z(e,c<<1,3),ie(e,x,A),oe(e)}function Ce(e,t,r,i){var o,s,u=0;e.level>0?(e.strm.data_type===a&&(e.strm.data_type=V(e)),he(e,e.l_desc),he(e,e.d_desc),u=ve(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&t!==-1?xe(e,t,r,i):e.strategy===n||s===o?(z(e,(c<<1)+ +!!i,3),me(e,A,j)):(z(e,(l<<1)+ +!!i,3),ye(e,e.l_desc.max_code+1,e.d_desc.max_code+1,u+1),me(e,e.dyn_ltree,e.dyn_dtree)),ue(e),i&&de(e)}function we(e,t,n){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=n&255,e.last_lit++,t===0?e.dyn_ltree[n*2]++:(e.matches++,t--,e.dyn_ltree[(N[n]+p+1)*2]++,e.dyn_dtree[ne(t)*2]++),e.last_lit===e.lit_bufsize-1}e._tr_init=be,e._tr_stored_block=xe,e._tr_flush_block=Ce,e._tr_tally=we,e._tr_align=Se})),Dh=o(((e,t)=>{function n(e,t,n,r){for(var i=e&65535|0,a=e>>>16&65535|0,o=0;n!==0;){o=n>2e3?2e3:n,n-=o;do i=i+t[r++]|0,a=a+i|0;while(--o);i%=65521,a%=65521}return i|a<<16|0}t.exports=n})),Oh=o(((e,t)=>{function n(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=e&1?3988292384^e>>>1:e>>>1;t[n]=e}return t}var r=n();function i(e,t,n,i){var a=r,o=i+n;e^=-1;for(var s=i;s<o;s++)e=e>>>8^a[(e^t[s])&255];return e^-1}t.exports=i})),kh=o(((e,t)=>{t.exports={2:`need dictionary`,1:`stream end`,0:``,"-1":`file error`,"-2":`stream error`,"-3":`data error`,"-4":`insufficient memory`,"-5":`buffer error`,"-6":`incompatible version`}})),Ah=o((e=>{var t=Th(),n=Eh(),r=Dh(),i=Oh(),a=kh(),o=0,s=1,c=3,l=4,u=5,d=0,f=1,p=-2,m=-3,h=-5,g=-1,_=1,v=2,y=3,b=4,x=0,S=2,C=8,w=9,T=15,E=8,D=286,O=30,k=19,A=2*D+1,j=15,M=3,N=258,P=N+M+1,F=32,I=42,L=69,R=73,ee=91,te=103,ne=113,re=666,z=1,ie=2,ae=3,oe=4,se=3;function ce(e,t){return e.msg=a[t],t}function le(e){return(e<<1)-(e>4?9:0)}function ue(e){for(var t=e.length;--t>=0;)e[t]=0}function de(e){var n=e.state,r=n.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(t.arraySet(e.output,n.pending_buf,n.pending_out,r,e.next_out),e.next_out+=r,n.pending_out+=r,e.total_out+=r,e.avail_out-=r,n.pending-=r,n.pending===0&&(n.pending_out=0))}function fe(e,t){n._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,de(e.strm)}function B(e,t){e.pending_buf[e.pending++]=t}function pe(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function me(e,n,a,o){var s=e.avail_in;return s>o&&(s=o),s===0?0:(e.avail_in-=s,t.arraySet(n,e.input,e.next_in,s,a),e.state.wrap===1?e.adler=r(e.adler,n,s,a):e.state.wrap===2&&(e.adler=i(e.adler,n,s,a)),e.next_in+=s,e.total_in+=s,s)}function he(e,t){var n=e.max_chain_length,r=e.strstart,i,a,o=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-P?e.strstart-(e.w_size-P):0,l=e.window,u=e.w_mask,d=e.prev,f=e.strstart+N,p=l[r+o-1],m=l[r+o];e.prev_length>=e.good_match&&(n>>=2),s>e.lookahead&&(s=e.lookahead);do{if(i=t,l[i+o]!==m||l[i+o-1]!==p||l[i]!==l[r]||l[++i]!==l[r+1])continue;r+=2,i++;do;while(l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&l[++r]===l[++i]&&r<f);if(a=N-(f-r),r=f-N,a>o){if(e.match_start=t,o=a,a>=s)break;p=l[r+o-1],m=l[r+o]}}while((t=d[t&u])>c&&--n!==0);return o<=e.lookahead?o:e.lookahead}function ge(e){var n=e.w_size,r,i,a,o,s;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-P)){t.arraySet(e.window,e.window,n,n,0),e.match_start-=n,e.strstart-=n,e.block_start-=n,i=e.hash_size,r=i;do a=e.head[--r],e.head[r]=a>=n?a-n:0;while(--i);i=n,r=i;do a=e.prev[--r],e.prev[r]=a>=n?a-n:0;while(--i);o+=n}if(e.strm.avail_in===0)break;if(i=me(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=i,e.lookahead+e.insert>=M)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[s+M-1])&e.hash_mask,e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<M)););}while(e.lookahead<P&&e.strm.avail_in!==0)}function _e(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(ge(e),e.lookahead===0&&t===o)return z;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((e.strstart===0||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,fe(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-P&&(fe(e,!1),e.strm.avail_out===0))return z}return e.insert=0,t===l?(fe(e,!0),e.strm.avail_out===0?ae:oe):(e.strstart>e.block_start&&(fe(e,!1),e.strm.avail_out),z)}function ve(e,t){for(var r,i;;){if(e.lookahead<P){if(ge(e),e.lookahead<P&&t===o)return z;if(e.lookahead===0)break}if(r=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-P&&(e.match_length=he(e,r)),e.match_length>=M)if(i=n._tr_tally(e,e.strstart-e.match_start,e.match_length-M),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=M){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else i=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(fe(e,!1),e.strm.avail_out===0))return z}return e.insert=e.strstart<M-1?e.strstart:M-1,t===l?(fe(e,!0),e.strm.avail_out===0?ae:oe):e.last_lit&&(fe(e,!1),e.strm.avail_out===0)?z:ie}function ye(e,t){for(var r,i,a;;){if(e.lookahead<P){if(ge(e),e.lookahead<P&&t===o)return z;if(e.lookahead===0)break}if(r=0,e.lookahead>=M&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=M-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-P&&(e.match_length=he(e,r),e.match_length<=5&&(e.strategy===_||e.match_length===M&&e.strstart-e.match_start>4096)&&(e.match_length=M-1)),e.prev_length>=M&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-M,i=n._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-M),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+M-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=M-1,e.strstart++,i&&(fe(e,!1),e.strm.avail_out===0))return z}else if(e.match_available){if(i=n._tr_tally(e,0,e.window[e.strstart-1]),i&&fe(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return z}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&=(i=n._tr_tally(e,0,e.window[e.strstart-1]),0),e.insert=e.strstart<M-1?e.strstart:M-1,t===l?(fe(e,!0),e.strm.avail_out===0?ae:oe):e.last_lit&&(fe(e,!1),e.strm.avail_out===0)?z:ie}function V(e,t){for(var r,i,a,s,c=e.window;;){if(e.lookahead<=N){if(ge(e),e.lookahead<=N&&t===o)return z;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=M&&e.strstart>0&&(a=e.strstart-1,i=c[a],i===c[++a]&&i===c[++a]&&i===c[++a])){s=e.strstart+N;do;while(i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&i===c[++a]&&a<s);e.match_length=N-(s-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=M?(r=n._tr_tally(e,1,e.match_length-M),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(fe(e,!1),e.strm.avail_out===0))return z}return e.insert=0,t===l?(fe(e,!0),e.strm.avail_out===0?ae:oe):e.last_lit&&(fe(e,!1),e.strm.avail_out===0)?z:ie}function H(e,t){for(var r;;){if(e.lookahead===0&&(ge(e),e.lookahead===0)){if(t===o)return z;break}if(e.match_length=0,r=n._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(fe(e,!1),e.strm.avail_out===0))return z}return e.insert=0,t===l?(fe(e,!0),e.strm.avail_out===0?ae:oe):e.last_lit&&(fe(e,!1),e.strm.avail_out===0)?z:ie}function be(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}var xe=[new be(0,0,0,0,_e),new be(4,4,8,4,ve),new be(4,5,16,8,ve),new be(4,6,32,32,ve),new be(4,4,16,16,ye),new be(8,16,32,32,ye),new be(8,16,128,128,ye),new be(8,32,128,256,ye),new be(32,128,258,1024,ye),new be(32,258,258,4096,ye)];function Se(e){e.window_size=2*e.w_size,ue(e.head),e.max_lazy_match=xe[e.level].max_lazy,e.good_match=xe[e.level].good_length,e.nice_match=xe[e.level].nice_length,e.max_chain_length=xe[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=M-1,e.match_available=0,e.ins_h=0}function Ce(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=C,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(A*2),this.dyn_dtree=new t.Buf16((2*O+1)*2),this.bl_tree=new t.Buf16((2*k+1)*2),ue(this.dyn_ltree),ue(this.dyn_dtree),ue(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(j+1),this.heap=new t.Buf16(2*D+1),ue(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*D+1),ue(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function we(e){var t;return!e||!e.state?ce(e,p):(e.total_in=e.total_out=0,e.data_type=S,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?I:ne,e.adler=t.wrap===2?0:1,t.last_flush=o,n._tr_init(t),d)}function Te(e){var t=we(e);return t===d&&Se(e.state),t}function Ee(e,t){return!e||!e.state||e.state.wrap!==2?p:(e.state.gzhead=t,d)}function De(e,n,r,i,a,o){if(!e)return p;var s=1;if(n===g&&(n=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),a<1||a>w||r!==C||i<8||i>15||n<0||n>9||o<0||o>b)return ce(e,p);i===8&&(i=9);var c=new Ce;return e.state=c,c.strm=e,c.wrap=s,c.gzhead=null,c.w_bits=i,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=a+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+M-1)/M),c.window=new t.Buf8(c.w_size*2),c.head=new t.Buf16(c.hash_size),c.prev=new t.Buf16(c.w_size),c.lit_bufsize=1<<a+6,c.pending_buf_size=c.lit_bufsize*4,c.pending_buf=new t.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=n,c.strategy=o,c.method=r,Te(e)}function Oe(e,t){return De(e,t,C,T,E,x)}function ke(e,t){var r,a,m,g;if(!e||!e.state||t>u||t<0)return e?ce(e,p):p;if(a=e.state,!e.output||!e.input&&e.avail_in!==0||a.status===re&&t!==l)return ce(e,e.avail_out===0?h:p);if(a.strm=e,r=a.last_flush,a.last_flush=t,a.status===I)if(a.wrap===2)e.adler=0,B(a,31),B(a,139),B(a,8),a.gzhead?(B(a,+!!a.gzhead.text+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),B(a,a.gzhead.time&255),B(a,a.gzhead.time>>8&255),B(a,a.gzhead.time>>16&255),B(a,a.gzhead.time>>24&255),B(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),B(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(B(a,a.gzhead.extra.length&255),B(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=i(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=L):(B(a,0),B(a,0),B(a,0),B(a,0),B(a,0),B(a,a.level===9?2:a.strategy>=v||a.level<2?4:0),B(a,se),a.status=ne);else{var _=C+(a.w_bits-8<<4)<<8,b=-1;b=a.strategy>=v||a.level<2?0:a.level<6?1:a.level===6?2:3,_|=b<<6,a.strstart!==0&&(_|=F),_+=31-_%31,a.status=ne,pe(a,_),a.strstart!==0&&(pe(a,e.adler>>>16),pe(a,e.adler&65535)),e.adler=1}if(a.status===L)if(a.gzhead.extra){for(m=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),de(e),m=a.pending,a.pending===a.pending_buf_size));)B(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=R)}else a.status=R;if(a.status===R)if(a.gzhead.name){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),de(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.name.length?a.gzhead.name.charCodeAt(a.gzindex++)&255:0,B(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.gzindex=0,a.status=ee)}else a.status=ee;if(a.status===ee)if(a.gzhead.comment){m=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),de(e),m=a.pending,a.pending===a.pending_buf_size)){g=1;break}g=a.gzindex<a.gzhead.comment.length?a.gzhead.comment.charCodeAt(a.gzindex++)&255:0,B(a,g)}while(g!==0);a.gzhead.hcrc&&a.pending>m&&(e.adler=i(e.adler,a.pending_buf,a.pending-m,m)),g===0&&(a.status=te)}else a.status=te;if(a.status===te&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&de(e),a.pending+2<=a.pending_buf_size&&(B(a,e.adler&255),B(a,e.adler>>8&255),e.adler=0,a.status=ne)):a.status=ne),a.pending!==0){if(de(e),e.avail_out===0)return a.last_flush=-1,d}else if(e.avail_in===0&&le(t)<=le(r)&&t!==l)return ce(e,h);if(a.status===re&&e.avail_in!==0)return ce(e,h);if(e.avail_in!==0||a.lookahead!==0||t!==o&&a.status!==re){var x=a.strategy===v?H(a,t):a.strategy===y?V(a,t):xe[a.level].func(a,t);if((x===ae||x===oe)&&(a.status=re),x===z||x===ae)return e.avail_out===0&&(a.last_flush=-1),d;if(x===ie&&(t===s?n._tr_align(a):t!==u&&(n._tr_stored_block(a,0,0,!1),t===c&&(ue(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),de(e),e.avail_out===0))return a.last_flush=-1,d}return t===l?a.wrap<=0?f:(a.wrap===2?(B(a,e.adler&255),B(a,e.adler>>8&255),B(a,e.adler>>16&255),B(a,e.adler>>24&255),B(a,e.total_in&255),B(a,e.total_in>>8&255),B(a,e.total_in>>16&255),B(a,e.total_in>>24&255)):(pe(a,e.adler>>>16),pe(a,e.adler&65535)),de(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending===0?f:d):d}function Ae(e){var t;return!e||!e.state?p:(t=e.state.status,t!==I&&t!==L&&t!==R&&t!==ee&&t!==te&&t!==ne&&t!==re?ce(e,p):(e.state=null,t===ne?ce(e,m):d))}function je(e,n){var i=n.length,a,o,s,c,l,u,f,m;if(!e||!e.state||(a=e.state,c=a.wrap,c===2||c===1&&a.status!==I||a.lookahead))return p;for(c===1&&(e.adler=r(e.adler,n,i,0)),a.wrap=0,i>=a.w_size&&(c===0&&(ue(a.head),a.strstart=0,a.block_start=0,a.insert=0),m=new t.Buf8(a.w_size),t.arraySet(m,n,i-a.w_size,a.w_size,0),n=m,i=a.w_size),l=e.avail_in,u=e.next_in,f=e.input,e.avail_in=i,e.next_in=0,e.input=n,ge(a);a.lookahead>=M;){o=a.strstart,s=a.lookahead-(M-1);do a.ins_h=(a.ins_h<<a.hash_shift^a.window[o+M-1])&a.hash_mask,a.prev[o&a.w_mask]=a.head[a.ins_h],a.head[a.ins_h]=o,o++;while(--s);a.strstart=o,a.lookahead=M-1,ge(a)}return a.strstart+=a.lookahead,a.block_start=a.strstart,a.insert=a.lookahead,a.lookahead=0,a.match_length=a.prev_length=M-1,a.match_available=0,e.next_in=u,e.input=f,e.avail_in=l,a.wrap=c,d}e.deflateInit=Oe,e.deflateInit2=De,e.deflateReset=Te,e.deflateResetKeep=we,e.deflateSetHeader=Ee,e.deflate=ke,e.deflateEnd=Ae,e.deflateSetDictionary=je,e.deflateInfo=`pako deflate (from Nodeca project)`})),jh=o((e=>{var t=Th(),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var i=new t.Buf8(256),a=0;a<256;a++)i[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;i[254]=i[254]=1,e.string2buf=function(e){var n,r,i,a,o,s=e.length,c=0;for(a=0;a<s;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),c+=r<128?1:r<2048?2:r<65536?3:4;for(n=new t.Buf8(c),o=0,a=0;o<c;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),r<128?n[o++]=r:r<2048?(n[o++]=192|r>>>6,n[o++]=128|r&63):r<65536?(n[o++]=224|r>>>12,n[o++]=128|r>>>6&63,n[o++]=128|r&63):(n[o++]=240|r>>>18,n[o++]=128|r>>>12&63,n[o++]=128|r>>>6&63,n[o++]=128|r&63);return n};function o(e,i){if(i<65534&&(e.subarray&&r||!e.subarray&&n))return String.fromCharCode.apply(null,t.shrinkBuf(e,i));for(var a=``,o=0;o<i;o++)a+=String.fromCharCode(e[o]);return a}e.buf2binstring=function(e){return o(e,e.length)},e.binstring2buf=function(e){for(var n=new t.Buf8(e.length),r=0,i=n.length;r<i;r++)n[r]=e.charCodeAt(r);return n},e.buf2string=function(e,t){var n,r,a,s,c=t||e.length,l=Array(c*2);for(r=0,n=0;n<c;){if(a=e[n++],a<128){l[r++]=a;continue}if(s=i[a],s>4){l[r++]=65533,n+=s-1;continue}for(a&=s===2?31:s===3?15:7;s>1&&n<c;)a=a<<6|e[n++]&63,s--;if(s>1){l[r++]=65533;continue}a<65536?l[r++]=a:(a-=65536,l[r++]=55296|a>>10&1023,l[r++]=56320|a&1023)}return o(l,r)},e.utf8border=function(e,t){var n;for(t||=e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+i[e[n]]>t?n:t}})),Mh=o(((e,t)=>{function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg=``,this.state=null,this.data_type=2,this.adler=0}t.exports=n})),Nh=o((e=>{var t=Ah(),n=Th(),r=jh(),i=kh(),a=Mh(),o=Object.prototype.toString,s=0,c=4,l=0,u=1,d=2,f=-1,p=0,m=8;function h(e){if(!(this instanceof h))return new h(e);this.options=n.assign({level:f,method:m,chunkSize:16384,windowBits:15,memLevel:8,strategy:p,to:``},e||{});var s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var c=t.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(c!==l)throw Error(i[c]);if(s.header&&t.deflateSetHeader(this.strm,s.header),s.dictionary){var u=typeof s.dictionary==`string`?r.string2buf(s.dictionary):o.call(s.dictionary)===`[object ArrayBuffer]`?new Uint8Array(s.dictionary):s.dictionary;if(c=t.deflateSetDictionary(this.strm,u),c!==l)throw Error(i[c]);this._dict_set=!0}}h.prototype.push=function(e,i){var a=this.strm,f=this.options.chunkSize,p,m;if(this.ended)return!1;m=i===~~i?i:i===!0?c:s,typeof e==`string`?a.input=r.string2buf(e):o.call(e)===`[object ArrayBuffer]`?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;do{if(a.avail_out===0&&(a.output=new n.Buf8(f),a.next_out=0,a.avail_out=f),p=t.deflate(a,m),p!==u&&p!==l)return this.onEnd(p),this.ended=!0,!1;(a.avail_out===0||a.avail_in===0&&(m===c||m===d))&&(this.options.to===`string`?this.onData(r.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||a.avail_out===0)&&p!==u);return m===c?(p=t.deflateEnd(this.strm),this.onEnd(p),this.ended=!0,p===l):m===d?(this.onEnd(l),a.avail_out=0,!0):!0},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===l&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function g(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||i[n.err];return n.result}function _(e,t){return t||={},t.raw=!0,g(e,t)}function v(e,t){return t||={},t.gzip=!0,g(e,t)}e.Deflate=h,e.deflate=g,e.deflateRaw=_,e.gzip=v})),Ph=o(((e,t)=>{var n=30,r=12;t.exports=function(e,t){var i=e.state,a=e.next_in,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D=e.input,O;o=a+(e.avail_in-5),s=e.next_out,O=e.output,c=s-(t-e.avail_out),l=s+(e.avail_out-257),u=i.dmax,d=i.wsize,f=i.whave,p=i.wnext,m=i.window,h=i.hold,g=i.bits,_=i.lencode,v=i.distcode,y=(1<<i.lenbits)-1,b=(1<<i.distbits)-1;top:do{g<15&&(h+=D[a++]<<g,g+=8,h+=D[a++]<<g,g+=8),x=_[h&y];dolen:for(;;){if(S=x>>>24,h>>>=S,g-=S,S=x>>>16&255,S===0)O[s++]=x&65535;else if(S&16){C=x&65535,S&=15,S&&(g<S&&(h+=D[a++]<<g,g+=8),C+=h&(1<<S)-1,h>>>=S,g-=S),g<15&&(h+=D[a++]<<g,g+=8,h+=D[a++]<<g,g+=8),x=v[h&b];dodist:for(;;){if(S=x>>>24,h>>>=S,g-=S,S=x>>>16&255,S&16){if(w=x&65535,S&=15,g<S&&(h+=D[a++]<<g,g+=8,g<S&&(h+=D[a++]<<g,g+=8)),w+=h&(1<<S)-1,w>u){e.msg=`invalid distance too far back`,i.mode=n;break top}if(h>>>=S,g-=S,S=s-c,w>S){if(S=w-S,S>f&&i.sane){e.msg=`invalid distance too far back`,i.mode=n;break top}if(T=0,E=m,p===0){if(T+=d-S,S<C){C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}}else if(p<S){if(T+=d+p-S,S-=p,S<C){C-=S;do O[s++]=m[T++];while(--S);if(T=0,p<C){S=p,C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}}}else if(T+=p-S,S<C){C-=S;do O[s++]=m[T++];while(--S);T=s-w,E=O}for(;C>2;)O[s++]=E[T++],O[s++]=E[T++],O[s++]=E[T++],C-=3;C&&(O[s++]=E[T++],C>1&&(O[s++]=E[T++]))}else{T=s-w;do O[s++]=O[T++],O[s++]=O[T++],O[s++]=O[T++],C-=3;while(C>2);C&&(O[s++]=O[T++],C>1&&(O[s++]=O[T++]))}}else if(S&64){e.msg=`invalid distance code`,i.mode=n;break top}else{x=v[(x&65535)+(h&(1<<S)-1)];continue dodist}break}}else if(!(S&64)){x=_[(x&65535)+(h&(1<<S)-1)];continue dolen}else if(S&32){i.mode=r;break top}else{e.msg=`invalid literal/length code`,i.mode=n;break top}break}}while(a<o&&s<l);C=g>>3,a-=C,g-=C<<3,h&=(1<<g)-1,e.next_in=a,e.next_out=s,e.avail_in=a<o?5+(o-a):5-(a-o),e.avail_out=s<l?257+(l-s):257-(s-l),i.hold=h,i.bits=g}})),Fh=o(((e,t)=>{var n=Th(),r=15,i=852,a=592,o=0,s=1,c=2,l=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],u=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],d=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],f=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,p,m,h,g,_,v){var y=v.bits,b=0,x=0,S=0,C=0,w=0,T=0,E=0,D=0,O=0,k=0,A,j,M,N,P,F=null,I=0,L,R=new n.Buf16(r+1),ee=new n.Buf16(r+1),te=null,ne=0,re,z,ie;for(b=0;b<=r;b++)R[b]=0;for(x=0;x<m;x++)R[t[p+x]]++;for(w=y,C=r;C>=1&&R[C]===0;C--);if(w>C&&(w=C),C===0)return h[g++]=20971520,h[g++]=20971520,v.bits=1,0;for(S=1;S<C&&R[S]===0;S++);for(w<S&&(w=S),D=1,b=1;b<=r;b++)if(D<<=1,D-=R[b],D<0)return-1;if(D>0&&(e===o||C!==1))return-1;for(ee[1]=0,b=1;b<r;b++)ee[b+1]=ee[b]+R[b];for(x=0;x<m;x++)t[p+x]!==0&&(_[ee[t[p+x]]++]=x);if(e===o?(F=te=_,L=19):e===s?(F=l,I-=257,te=u,ne-=257,L=256):(F=d,te=f,L=-1),k=0,x=0,b=S,P=g,T=w,E=0,M=-1,O=1<<w,N=O-1,e===s&&O>i||e===c&&O>a)return 1;for(;;){re=b-E,_[x]<L?(z=0,ie=_[x]):_[x]>L?(z=te[ne+_[x]],ie=F[I+_[x]]):(z=96,ie=0),A=1<<b-E,j=1<<T,S=j;do j-=A,h[P+(k>>E)+j]=re<<24|z<<16|ie|0;while(j!==0);for(A=1<<b-1;k&A;)A>>=1;if(A===0?k=0:(k&=A-1,k+=A),x++,--R[b]===0){if(b===C)break;b=t[p+_[x]]}if(b>w&&(k&N)!==M){for(E===0&&(E=w),P+=S,T=b-E,D=1<<T;T+E<C&&(D-=R[T+E],!(D<=0));)T++,D<<=1;if(O+=1<<T,e===s&&O>i||e===c&&O>a)return 1;M=k&N,h[M]=w<<24|T<<16|P-g|0}}return k!==0&&(h[P+k]=b-E<<24|4194304),v.bits=w,0}})),Ih=o((e=>{var t=Th(),n=Dh(),r=Oh(),i=Ph(),a=Fh(),o=0,s=1,c=2,l=4,u=5,d=6,f=0,p=1,m=2,h=-2,g=-3,_=-4,v=-5,y=8,b=1,x=2,S=3,C=4,w=5,T=6,E=7,D=8,O=9,k=10,A=11,j=12,M=13,N=14,P=15,F=16,I=17,L=18,R=19,ee=20,te=21,ne=22,re=23,z=24,ie=25,ae=26,oe=27,se=28,ce=29,le=30,ue=31,de=32,fe=852,B=592,pe=15;function me(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function he(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ge(e){var n;return!e||!e.state?h:(n=e.state,e.total_in=e.total_out=n.total=0,e.msg=``,n.wrap&&(e.adler=n.wrap&1),n.mode=b,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new t.Buf32(fe),n.distcode=n.distdyn=new t.Buf32(B),n.sane=1,n.back=-1,f)}function _e(e){var t;return!e||!e.state?h:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,ge(e))}function ve(e,t){var n,r;return!e||!e.state||(r=e.state,t<0?(n=0,t=-t):(n=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?h:(r.window!==null&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,_e(e))}function ye(e,t){var n,r;return e?(r=new he,e.state=r,r.window=null,n=ve(e,t),n!==f&&(e.state=null),n):h}function V(e){return ye(e,pe)}var H=!0,be,xe;function Se(e){if(H){var n;for(be=new t.Buf32(512),xe=new t.Buf32(32),n=0;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(a(s,e.lens,0,288,be,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;a(c,e.lens,0,32,xe,0,e.work,{bits:5}),H=!1}e.lencode=be,e.lenbits=9,e.distcode=xe,e.distbits=5}function Ce(e,n,r,i){var a,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new t.Buf8(o.wsize)),i>=o.wsize?(t.arraySet(o.window,n,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(a=o.wsize-o.wnext,a>i&&(a=i),t.arraySet(o.window,n,r-i,a,o.wnext),i-=a,i?(t.arraySet(o.window,n,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=a,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=a))),0}function we(e,fe){var B,pe,he,ge,_e,ve,ye,V,H,be,xe,we,Te,Ee,De=0,Oe,ke,Ae,je,Me,Ne,Pe,Fe,Ie=new t.Buf8(4),Le,Re,ze=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return h;B=e.state,B.mode===j&&(B.mode=M),_e=e.next_out,he=e.output,ye=e.avail_out,ge=e.next_in,pe=e.input,ve=e.avail_in,V=B.hold,H=B.bits,be=ve,xe=ye,Fe=f;inf_leave:for(;;)switch(B.mode){case b:if(B.wrap===0){B.mode=M;break}for(;H<16;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}if(B.wrap&2&&V===35615){B.check=0,Ie[0]=V&255,Ie[1]=V>>>8&255,B.check=r(B.check,Ie,2,0),V=0,H=0,B.mode=x;break}if(B.flags=0,B.head&&(B.head.done=!1),!(B.wrap&1)||(((V&255)<<8)+(V>>8))%31){e.msg=`incorrect header check`,B.mode=le;break}if((V&15)!==y){e.msg=`unknown compression method`,B.mode=le;break}if(V>>>=4,H-=4,Pe=(V&15)+8,B.wbits===0)B.wbits=Pe;else if(Pe>B.wbits){e.msg=`invalid window size`,B.mode=le;break}B.dmax=1<<Pe,e.adler=B.check=1,B.mode=V&512?k:j,V=0,H=0;break;case x:for(;H<16;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}if(B.flags=V,(B.flags&255)!==y){e.msg=`unknown compression method`,B.mode=le;break}if(B.flags&57344){e.msg=`unknown header flags set`,B.mode=le;break}B.head&&(B.head.text=V>>8&1),B.flags&512&&(Ie[0]=V&255,Ie[1]=V>>>8&255,B.check=r(B.check,Ie,2,0)),V=0,H=0,B.mode=S;case S:for(;H<32;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}B.head&&(B.head.time=V),B.flags&512&&(Ie[0]=V&255,Ie[1]=V>>>8&255,Ie[2]=V>>>16&255,Ie[3]=V>>>24&255,B.check=r(B.check,Ie,4,0)),V=0,H=0,B.mode=C;case C:for(;H<16;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}B.head&&(B.head.xflags=V&255,B.head.os=V>>8),B.flags&512&&(Ie[0]=V&255,Ie[1]=V>>>8&255,B.check=r(B.check,Ie,2,0)),V=0,H=0,B.mode=w;case w:if(B.flags&1024){for(;H<16;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}B.length=V,B.head&&(B.head.extra_len=V),B.flags&512&&(Ie[0]=V&255,Ie[1]=V>>>8&255,B.check=r(B.check,Ie,2,0)),V=0,H=0}else B.head&&(B.head.extra=null);B.mode=T;case T:if(B.flags&1024&&(we=B.length,we>ve&&(we=ve),we&&(B.head&&(Pe=B.head.extra_len-B.length,B.head.extra||(B.head.extra=Array(B.head.extra_len)),t.arraySet(B.head.extra,pe,ge,we,Pe)),B.flags&512&&(B.check=r(B.check,pe,we,ge)),ve-=we,ge+=we,B.length-=we),B.length))break inf_leave;B.length=0,B.mode=E;case E:if(B.flags&2048){if(ve===0)break inf_leave;we=0;do Pe=pe[ge+ we++],B.head&&Pe&&B.length<65536&&(B.head.name+=String.fromCharCode(Pe));while(Pe&&we<ve);if(B.flags&512&&(B.check=r(B.check,pe,we,ge)),ve-=we,ge+=we,Pe)break inf_leave}else B.head&&(B.head.name=null);B.length=0,B.mode=D;case D:if(B.flags&4096){if(ve===0)break inf_leave;we=0;do Pe=pe[ge+ we++],B.head&&Pe&&B.length<65536&&(B.head.comment+=String.fromCharCode(Pe));while(Pe&&we<ve);if(B.flags&512&&(B.check=r(B.check,pe,we,ge)),ve-=we,ge+=we,Pe)break inf_leave}else B.head&&(B.head.comment=null);B.mode=O;case O:if(B.flags&512){for(;H<16;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}if(V!==(B.check&65535)){e.msg=`header crc mismatch`,B.mode=le;break}V=0,H=0}B.head&&(B.head.hcrc=B.flags>>9&1,B.head.done=!0),e.adler=B.check=0,B.mode=j;break;case k:for(;H<32;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}e.adler=B.check=me(V),V=0,H=0,B.mode=A;case A:if(B.havedict===0)return e.next_out=_e,e.avail_out=ye,e.next_in=ge,e.avail_in=ve,B.hold=V,B.bits=H,m;e.adler=B.check=1,B.mode=j;case j:if(fe===u||fe===d)break inf_leave;case M:if(B.last){V>>>=H&7,H-=H&7,B.mode=oe;break}for(;H<3;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}switch(B.last=V&1,V>>>=1,--H,V&3){case 0:B.mode=N;break;case 1:if(Se(B),B.mode=ee,fe===d){V>>>=2,H-=2;break inf_leave}break;case 2:B.mode=I;break;case 3:e.msg=`invalid block type`,B.mode=le}V>>>=2,H-=2;break;case N:for(V>>>=H&7,H-=H&7;H<32;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}if((V&65535)!=(V>>>16^65535)){e.msg=`invalid stored block lengths`,B.mode=le;break}if(B.length=V&65535,V=0,H=0,B.mode=P,fe===d)break inf_leave;case P:B.mode=F;case F:if(we=B.length,we){if(we>ve&&(we=ve),we>ye&&(we=ye),we===0)break inf_leave;t.arraySet(he,pe,ge,we,_e),ve-=we,ge+=we,ye-=we,_e+=we,B.length-=we;break}B.mode=j;break;case I:for(;H<14;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}if(B.nlen=(V&31)+257,V>>>=5,H-=5,B.ndist=(V&31)+1,V>>>=5,H-=5,B.ncode=(V&15)+4,V>>>=4,H-=4,B.nlen>286||B.ndist>30){e.msg=`too many length or distance symbols`,B.mode=le;break}B.have=0,B.mode=L;case L:for(;B.have<B.ncode;){for(;H<3;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}B.lens[ze[B.have++]]=V&7,V>>>=3,H-=3}for(;B.have<19;)B.lens[ze[B.have++]]=0;if(B.lencode=B.lendyn,B.lenbits=7,Le={bits:B.lenbits},Fe=a(o,B.lens,0,19,B.lencode,0,B.work,Le),B.lenbits=Le.bits,Fe){e.msg=`invalid code lengths set`,B.mode=le;break}B.have=0,B.mode=R;case R:for(;B.have<B.nlen+B.ndist;){for(;De=B.lencode[V&(1<<B.lenbits)-1],Oe=De>>>24,ke=De>>>16&255,Ae=De&65535,!(Oe<=H);){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}if(Ae<16)V>>>=Oe,H-=Oe,B.lens[B.have++]=Ae;else{if(Ae===16){for(Re=Oe+2;H<Re;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}if(V>>>=Oe,H-=Oe,B.have===0){e.msg=`invalid bit length repeat`,B.mode=le;break}Pe=B.lens[B.have-1],we=3+(V&3),V>>>=2,H-=2}else if(Ae===17){for(Re=Oe+3;H<Re;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}V>>>=Oe,H-=Oe,Pe=0,we=3+(V&7),V>>>=3,H-=3}else{for(Re=Oe+7;H<Re;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}V>>>=Oe,H-=Oe,Pe=0,we=11+(V&127),V>>>=7,H-=7}if(B.have+we>B.nlen+B.ndist){e.msg=`invalid bit length repeat`,B.mode=le;break}for(;we--;)B.lens[B.have++]=Pe}}if(B.mode===le)break;if(B.lens[256]===0){e.msg=`invalid code -- missing end-of-block`,B.mode=le;break}if(B.lenbits=9,Le={bits:B.lenbits},Fe=a(s,B.lens,0,B.nlen,B.lencode,0,B.work,Le),B.lenbits=Le.bits,Fe){e.msg=`invalid literal/lengths set`,B.mode=le;break}if(B.distbits=6,B.distcode=B.distdyn,Le={bits:B.distbits},Fe=a(c,B.lens,B.nlen,B.ndist,B.distcode,0,B.work,Le),B.distbits=Le.bits,Fe){e.msg=`invalid distances set`,B.mode=le;break}if(B.mode=ee,fe===d)break inf_leave;case ee:B.mode=te;case te:if(ve>=6&&ye>=258){e.next_out=_e,e.avail_out=ye,e.next_in=ge,e.avail_in=ve,B.hold=V,B.bits=H,i(e,xe),_e=e.next_out,he=e.output,ye=e.avail_out,ge=e.next_in,pe=e.input,ve=e.avail_in,V=B.hold,H=B.bits,B.mode===j&&(B.back=-1);break}for(B.back=0;De=B.lencode[V&(1<<B.lenbits)-1],Oe=De>>>24,ke=De>>>16&255,Ae=De&65535,!(Oe<=H);){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}if(ke&&!(ke&240)){for(je=Oe,Me=ke,Ne=Ae;De=B.lencode[Ne+((V&(1<<je+Me)-1)>>je)],Oe=De>>>24,ke=De>>>16&255,Ae=De&65535,!(je+Oe<=H);){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}V>>>=je,H-=je,B.back+=je}if(V>>>=Oe,H-=Oe,B.back+=Oe,B.length=Ae,ke===0){B.mode=ae;break}if(ke&32){B.back=-1,B.mode=j;break}if(ke&64){e.msg=`invalid literal/length code`,B.mode=le;break}B.extra=ke&15,B.mode=ne;case ne:if(B.extra){for(Re=B.extra;H<Re;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}B.length+=V&(1<<B.extra)-1,V>>>=B.extra,H-=B.extra,B.back+=B.extra}B.was=B.length,B.mode=re;case re:for(;De=B.distcode[V&(1<<B.distbits)-1],Oe=De>>>24,ke=De>>>16&255,Ae=De&65535,!(Oe<=H);){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}if(!(ke&240)){for(je=Oe,Me=ke,Ne=Ae;De=B.distcode[Ne+((V&(1<<je+Me)-1)>>je)],Oe=De>>>24,ke=De>>>16&255,Ae=De&65535,!(je+Oe<=H);){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}V>>>=je,H-=je,B.back+=je}if(V>>>=Oe,H-=Oe,B.back+=Oe,ke&64){e.msg=`invalid distance code`,B.mode=le;break}B.offset=Ae,B.extra=ke&15,B.mode=z;case z:if(B.extra){for(Re=B.extra;H<Re;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}B.offset+=V&(1<<B.extra)-1,V>>>=B.extra,H-=B.extra,B.back+=B.extra}if(B.offset>B.dmax){e.msg=`invalid distance too far back`,B.mode=le;break}B.mode=ie;case ie:if(ye===0)break inf_leave;if(we=xe-ye,B.offset>we){if(we=B.offset-we,we>B.whave&&B.sane){e.msg=`invalid distance too far back`,B.mode=le;break}we>B.wnext?(we-=B.wnext,Te=B.wsize-we):Te=B.wnext-we,we>B.length&&(we=B.length),Ee=B.window}else Ee=he,Te=_e-B.offset,we=B.length;we>ye&&(we=ye),ye-=we,B.length-=we;do he[_e++]=Ee[Te++];while(--we);B.length===0&&(B.mode=te);break;case ae:if(ye===0)break inf_leave;he[_e++]=B.length,ye--,B.mode=te;break;case oe:if(B.wrap){for(;H<32;){if(ve===0)break inf_leave;ve--,V|=pe[ge++]<<H,H+=8}if(xe-=ye,e.total_out+=xe,B.total+=xe,xe&&(e.adler=B.check=B.flags?r(B.check,he,xe,_e-xe):n(B.check,he,xe,_e-xe)),xe=ye,(B.flags?V:me(V))!==B.check){e.msg=`incorrect data check`,B.mode=le;break}V=0,H=0}B.mode=se;case se:if(B.wrap&&B.flags){for(;H<32;){if(ve===0)break inf_leave;ve--,V+=pe[ge++]<<H,H+=8}if(V!==(B.total&4294967295)){e.msg=`incorrect length check`,B.mode=le;break}V=0,H=0}B.mode=ce;case ce:Fe=p;break inf_leave;case le:Fe=g;break inf_leave;case ue:return _;case de:default:return h}return e.next_out=_e,e.avail_out=ye,e.next_in=ge,e.avail_in=ve,B.hold=V,B.bits=H,(B.wsize||xe!==e.avail_out&&B.mode<le&&(B.mode<oe||fe!==l))&&Ce(e,e.output,e.next_out,xe-e.avail_out)?(B.mode=ue,_):(be-=e.avail_in,xe-=e.avail_out,e.total_in+=be,e.total_out+=xe,B.total+=xe,B.wrap&&xe&&(e.adler=B.check=B.flags?r(B.check,he,xe,e.next_out-xe):n(B.check,he,xe,e.next_out-xe)),e.data_type=B.bits+(B.last?64:0)+(B.mode===j?128:0)+(B.mode===ee||B.mode===P?256:0),(be===0&&xe===0||fe===l)&&Fe===f&&(Fe=v),Fe)}function Te(e){if(!e||!e.state)return h;var t=e.state;return t.window&&=null,e.state=null,f}function Ee(e,t){var n;return!e||!e.state||(n=e.state,!(n.wrap&2))?h:(n.head=t,t.done=!1,f)}function De(e,t){var r=t.length,i,a,o;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==A)?h:i.mode===A&&(a=1,a=n(a,t,r,0),a!==i.check)?g:(o=Ce(e,t,r,r),o?(i.mode=ue,_):(i.havedict=1,f))}e.inflateReset=_e,e.inflateReset2=ve,e.inflateResetKeep=ge,e.inflateInit=V,e.inflateInit2=ye,e.inflate=we,e.inflateEnd=Te,e.inflateGetHeader=Ee,e.inflateSetDictionary=De,e.inflateInfo=`pako inflate (from Nodeca project)`})),Lh=o(((e,t)=>{t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}})),Rh=o(((e,t)=>{function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}t.exports=n})),zh=o((e=>{var t=Ih(),n=Th(),r=jh(),i=Lh(),a=kh(),o=Mh(),s=Rh(),c=Object.prototype.toString;function l(e){if(!(this instanceof l))return new l(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:``},e||{});var u=this.options;u.raw&&u.windowBits>=0&&u.windowBits<16&&(u.windowBits=-u.windowBits,u.windowBits===0&&(u.windowBits=-15)),u.windowBits>=0&&u.windowBits<16&&!(e&&e.windowBits)&&(u.windowBits+=32),u.windowBits>15&&u.windowBits<48&&(u.windowBits&15||(u.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var d=t.inflateInit2(this.strm,u.windowBits);if(d!==i.Z_OK||(this.header=new s,t.inflateGetHeader(this.strm,this.header),u.dictionary&&(typeof u.dictionary==`string`?u.dictionary=r.string2buf(u.dictionary):c.call(u.dictionary)===`[object ArrayBuffer]`&&(u.dictionary=new Uint8Array(u.dictionary)),u.raw&&(d=t.inflateSetDictionary(this.strm,u.dictionary),d!==i.Z_OK))))throw Error(a[d])}l.prototype.push=function(e,a){var o=this.strm,s=this.options.chunkSize,l=this.options.dictionary,u,d,f,p,m,h=!1;if(this.ended)return!1;d=a===~~a?a:a===!0?i.Z_FINISH:i.Z_NO_FLUSH,typeof e==`string`?o.input=r.binstring2buf(e):c.call(e)===`[object ArrayBuffer]`?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(o.avail_out===0&&(o.output=new n.Buf8(s),o.next_out=0,o.avail_out=s),u=t.inflate(o,i.Z_NO_FLUSH),u===i.Z_NEED_DICT&&l&&(u=t.inflateSetDictionary(this.strm,l)),u===i.Z_BUF_ERROR&&h===!0&&(u=i.Z_OK,h=!1),u!==i.Z_STREAM_END&&u!==i.Z_OK)return this.onEnd(u),this.ended=!0,!1;o.next_out&&(o.avail_out===0||u===i.Z_STREAM_END||o.avail_in===0&&(d===i.Z_FINISH||d===i.Z_SYNC_FLUSH))&&(this.options.to===`string`?(f=r.utf8border(o.output,o.next_out),p=o.next_out-f,m=r.buf2string(o.output,f),o.next_out=p,o.avail_out=s-p,p&&n.arraySet(o.output,o.output,f,p,0),this.onData(m)):this.onData(n.shrinkBuf(o.output,o.next_out))),o.avail_in===0&&o.avail_out===0&&(h=!0)}while((o.avail_in>0||o.avail_out===0)&&u!==i.Z_STREAM_END);return u===i.Z_STREAM_END&&(d=i.Z_FINISH),d===i.Z_FINISH?(u=t.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,u===i.Z_OK):d===i.Z_SYNC_FLUSH?(this.onEnd(i.Z_OK),o.avail_out=0,!0):!0},l.prototype.onData=function(e){this.chunks.push(e)},l.prototype.onEnd=function(e){e===i.Z_OK&&(this.options.to===`string`?this.result=this.chunks.join(``):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function u(e,t){var n=new l(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}function d(e,t){return t||={},t.raw=!0,u(e,t)}e.Inflate=l,e.inflate=u,e.inflateRaw=d,e.ungzip=u})),Bh=c(o(((e,t)=>{var n=Th().assign,r=Nh(),i=zh(),a=Lh(),o={};n(o,r,i,a),t.exports=o}))()),Vh=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Hh=new Uint8Array(256),Uh=0;Uh<Vh.length;Uh++)Hh[Vh.charCodeAt(Uh)]=Uh;var Wh=function(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=new Uint8Array(t);for(r=0;r<n;r+=4)a=Hh[e.charCodeAt(r)],o=Hh[e.charCodeAt(r+1)],s=Hh[e.charCodeAt(r+2)],c=Hh[e.charCodeAt(r+3)],l[i++]=a<<2|o>>4,l[i++]=(o&15)<<4|s>>2,l[i++]=(s&3)<<6|c&63;return l},Gh=function(e){for(var t=``,n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},Kh=function(e){return Gh(Bh.default.inflate(Wh(e)))},qh=function(e,t,n){for(var r=``,i=0,a=t-e.length;i<a;i++)r+=n;return r+e},Jh={Courier:`eJyFWdtSGzkQ/RXXPO1WmZSBEAJvjnESb8AmGENCKg+ypj3Wohk5ugAmlX9fzUCyW6s+ysuUfVqXvh61Zr4XI1PX1PjiuLg6C05U1Ns/Ojx42TsYHB4eFf3irWn8VNQUB4xMsIpsCwatU1DUSm8T+JpUtW7XP6NShToiEy+0ksOm0nHkIP53b9UDlefKy3Vx7G2gfjFaCyukJzundu74wVNTUnlhatE8a/XmjXkojr/s7O33d/Y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q8TONvshgKDCuRAZTXigUxjxNFfKRo3CLhnIJBMFRvMZpqpNBMlQJzGT5WFQMVQI/AikPMIhEU1aDjqJvQwmjSHB05cC9jbYwc5UtAHNLhDw41ha+lEqF4JaH3gmB61SYcqInxTDmQK8v08vjqv4zDf1N0w3Lf4A8/vwPpfK11w==`},Yh;(function(e){e.Courier=`Courier`,e.CourierBold=`Courier-Bold`,e.CourierOblique=`Courier-Oblique`,e.CourierBoldOblique=`Courier-BoldOblique`,e.Helvetica=`Helvetica`,e.HelveticaBold=`Helvetica-Bold`,e.HelveticaOblique=`Helvetica-Oblique`,e.HelveticaBoldOblique=`Helvetica-BoldOblique`,e.TimesRoman=`Times-Roman`,e.TimesRomanBold=`Times-Bold`,e.TimesRomanItalic=`Times-Italic`,e.TimesRomanBoldItalic=`Times-BoldItalic`,e.Symbol=`Symbol`,e.ZapfDingbats=`ZapfDingbats`})(Yh||={});for(var Xh={},Zh=function(){function e(){var e=this;this.getWidthOfGlyph=function(t){return e.CharWidths[t]},this.getXAxisKerningForPair=function(t,n){return(e.KernPairXAmounts[t]||{})[n]}}return e.load=function(t){var n=Xh[t];if(n)return n;var r=Kh(Jh[t]),i=Object.assign(new e,JSON.parse(r));return i.CharWidths=i.CharMetrics.reduce(function(e,t){return e[t.N]=t.WX,e},{}),i.KernPairXAmounts=i.KernPairs.reduce(function(e,t){var n=t[0],r=t[1],i=t[2];return e[n]||(e[n]={}),e[n][r]=i,e},{}),Xh[t]=i,i},e}(),Qh=Kh(`eJztWsuy48iN/Ret74KZfHtX47meqfGjPHaXx4/wgpJ4JbooUU1JVXXb0f9u4JwESF13R7TD29koIpFi8gCJBHDA/Pvm+nraTuPmZ3/f5HHzs7/k8WlzvXS7fvPXp02eqyR/2vRfd2N3gqhUUfm0Od9P236+DoczxLWK66fNpZ93/fkGWaOy5mnTnUR67c57lRaZSItM/tnN/XnsX/DfIqg0JOk8HI4UK4BCAFzG+xWCQgXF02Y3nU4dJJVKKrx5mPgKBVMImOvYX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vJiuc208LhMK5/bRAKJzbT28gFE7wp9XCTvCnR1zO8ZeLw7Fwjj8tTlw4x78v0Ern+PcFWukc//4GWulE//6AonSu/7paxrn+zZ2YnRclRK/rBXJsCAjxh2cKEAWVJ02ku/wOoFv2+12XkmnODwHgW4uQGVbZ0uM7mAJ1b/68/JlpUMnWdy5MF6/Vd5eL19YYSPd6FqPwBkNQo/h2NQxdQQ3bn/dpCxrGrqCW7U8rKZl/mfi0Xytk3Am66ZhYbg4y+KAVslDwbXdNL2d5qU5hnYBlTZaa6hs2t1qWdaeeTptcLco+hl5R7w4H5uOGcQbtEkpT18GusOI2xT9dYcVJf7zCSjmbD+Iud2s1NPRb9E+0UICmizb8ZK/+5JOLOulSqwaw5VJr2vB8dSFn89fvv/8H0oq1dA==`),$h=JSON.parse(Qh),eg=function(){function e(e,t){var n=this;this.canEncodeUnicodeCodePoint=function(e){return e in n.unicodeMappings},this.encodeUnicodeCodePoint=function(e){var t=n.unicodeMappings[e];if(!t){var r=String.fromCharCode(e),i=`0x`+qh(e.toString(16),4,`0`),a=n.name+` cannot encode "`+r+`" (`+i+`)`;throw Error(a)}return{code:t[0],name:t[1]}},this.name=e,this.supportedCodePoints=Object.keys(t).map(Number).sort(function(e,t){return e-t}),this.unicodeMappings=t}return e}(),tg={Symbol:new eg(`Symbol`,$h.symbol),ZapfDingbats:new eg(`ZapfDingbats`,$h.zapfdingbats),WinAnsi:new eg(`WinAnsi`,$h.win1252)},ng=function(e){return Object.keys(e).map(function(t){return e[t]})},rg=ng(Yh),ig=function(e){return rg.includes(e)},ag=function(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height},og=function(e){return"`"+e+"`"},sg=function(e){return`'`+e+`'`},cg=function(e){var t=typeof e;return t===`string`?sg(e):t===`undefined`?og(e):e},lg=function(e,t,n){for(var r=Array(n.length),i=0,a=n.length;i<a;i++){var o=n[i];r[i]=cg(o)}var s=r.join(` or `);return og(t)+` must be one of `+s+`, but was actually `+cg(e)},ug=function(e,t,n){Array.isArray(n)||(n=ng(n));for(var r=0,i=n.length;r<i;r++)if(e===n[r])return;throw TypeError(lg(e,t,n))},dg=function(e,t,n){Array.isArray(n)||(n=ng(n)),ug(e,t,n.concat(void 0))},fg=function(e,t,n){Array.isArray(n)||(n=ng(n));for(var r=0,i=e.length;r<i;r++)ug(e[r],t,n)},pg=function(e){return e===null?`null`:e===void 0?`undefined`:typeof e==`string`?`string`:isNaN(e)?`NaN`:typeof e==`number`?`number`:typeof e==`boolean`?`boolean`:typeof e==`symbol`?`symbol`:typeof e==`bigint`?`bigint`:e.constructor&&e.constructor.name?e.constructor.name:e.name?e.name:e.constructor?String(e.constructor):String(e)},mg=function(e,t){return t===`null`?e===null:t===`undefined`?e===void 0:t===`string`?typeof e==`string`:t===`number`?typeof e==`number`&&!isNaN(e):t===`boolean`?typeof e==`boolean`:t===`symbol`?typeof e==`symbol`:t===`bigint`?typeof e==`bigint`:t===Date?e instanceof Date:t===Array?e instanceof Array:t===Uint8Array?e instanceof Uint8Array:t===ArrayBuffer?e instanceof ArrayBuffer:t===Function?e instanceof Function:e instanceof t[0]},hg=function(e,t,n){for(var r=Array(n.length),i=0,a=n.length;i<a;i++){var o=n[i];o===`null`&&(r[i]=og(`null`)),o===`undefined`&&(r[i]=og(`undefined`)),o===`string`?r[i]=og(`string`):o===`number`?r[i]=og(`number`):o===`boolean`?r[i]=og(`boolean`):o===`symbol`?r[i]=og(`symbol`):o===`bigint`?r[i]=og(`bigint`):o===Array?r[i]=og(`Array`):o===Uint8Array?r[i]=og(`Uint8Array`):o===ArrayBuffer?r[i]=og(`ArrayBuffer`):r[i]=og(o[1])}var s=r.join(` or `);return og(t)+` must be of type `+s+`, but was actually of type `+og(pg(e))},Y=function(e,t,n){for(var r=0,i=n.length;r<i;r++)if(mg(e,n[r]))return;throw TypeError(hg(e,t,n))},X=function(e,t,n){Y(e,t,n.concat(`undefined`))},gg=function(e,t,n){for(var r=0,i=e.length;r<i;r++)Y(e[r],t,n)},_g=function(e,t,n,r){if(Y(e,t,[`number`]),Y(n,`min`,[`number`]),Y(r,`max`,[`number`]),r=Math.max(n,r),e<n||e>r)throw Error(og(t)+` must be at least `+n+` and at most `+r+`, but was actually `+e)},vg=function(e,t,n,r){Y(e,t,[`number`,`undefined`]),typeof e==`number`&&_g(e,t,n,r)},yg=function(e,t,n){if(Y(e,t,[`number`]),e%n!==0)throw Error(og(t)+` must be a multiple of `+n+`, but was actually `+e)},bg=function(e,t){if(!Number.isInteger(e))throw Error(og(t)+` must be an integer, but was actually `+e)},xg=function(e,t){if(![1,0].includes(Math.sign(e)))throw Error(og(t)+` must be a positive number or 0, but was actually `+e)},Sg=new Uint16Array(256),Cg=0;Cg<256;Cg++)Sg[Cg]=Cg;Sg[22]=Tm(``),Sg[24]=Tm(`˘`),Sg[25]=Tm(`ˇ`),Sg[26]=Tm(`ˆ`),Sg[27]=Tm(`˙`),Sg[28]=Tm(`˝`),Sg[29]=Tm(`˛`),Sg[30]=Tm(`˚`),Sg[31]=Tm(`˜`),Sg[127]=Tm(`�`),Sg[128]=Tm(`•`),Sg[129]=Tm(`†`),Sg[130]=Tm(`‡`),Sg[131]=Tm(`…`),Sg[132]=Tm(`—`),Sg[133]=Tm(`–`),Sg[134]=Tm(`ƒ`),Sg[135]=Tm(`⁄`),Sg[136]=Tm(`‹`),Sg[137]=Tm(`›`),Sg[138]=Tm(`−`),Sg[139]=Tm(`‰`),Sg[140]=Tm(`„`),Sg[141]=Tm(`“`),Sg[142]=Tm(`”`),Sg[143]=Tm(`‘`),Sg[144]=Tm(`’`),Sg[145]=Tm(`‚`),Sg[146]=Tm(`™`),Sg[147]=Tm(`fi`),Sg[148]=Tm(`fl`),Sg[149]=Tm(`Ł`),Sg[150]=Tm(`Œ`),Sg[151]=Tm(`Š`),Sg[152]=Tm(`Ÿ`),Sg[153]=Tm(`Ž`),Sg[154]=Tm(`ı`),Sg[155]=Tm(`ł`),Sg[156]=Tm(`œ`),Sg[157]=Tm(`š`),Sg[158]=Tm(`ž`),Sg[159]=Tm(`�`),Sg[160]=Tm(`€`),Sg[173]=Tm(`�`);var wg=function(e){for(var t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]=Sg[e[n]];return String.fromCodePoint.apply(String,t)},Tg=function(){function e(e){this.populate=e,this.value=void 0}return e.prototype.getValue=function(){return this.value},e.prototype.access=function(){return this.value||=this.populate(),this.value},e.prototype.invalidate=function(){this.value=void 0},e.populatedBy=function(t){return new e(t)},e}(),Eg=function(e){J(t,e);function t(t,n){var r=this,i=`Method `+t+`.`+n+`() not implemented`;return r=e.call(this,i)||this,r}return t}(Error),Dg=function(e){J(t,e);function t(t){var n=this,r=`Cannot construct `+t+` - it has a private constructor`;return n=e.call(this,r)||this,n}return t}(Error),Og=function(e){J(t,e);function t(t,n){var r=this,i=function(e){return e?.name??e?.constructor?.name},a=`Expected instance of `+(Array.isArray(t)?t.map(i):[i(t)]).join(` or `)+`, `+(`but got instance of `+(n&&i(n)));return r=e.call(this,a)||this,r}return t}(Error),kg=function(e){J(t,e);function t(t){var n=this,r=t+` stream encoding not supported`;return n=e.call(this,r)||this,n}return t}(Error),Ag=function(e){J(t,e);function t(t,n){var r=this,i=`Cannot call `+t+`.`+n+`() more than once`;return r=e.call(this,i)||this,r}return t}(Error);(function(e){J(t,e);function t(t){var n=this,r=`Missing catalog (ref=`+t+`)`;return n=e.call(this,r)||this,n}return t})(Error);var jg=function(e){J(t,e);function t(){var t=this;return t=e.call(this,`Can't embed page with missing Contents`)||this,t}return t}(Error),Mg=function(e){J(t,e);function t(t){var n=this,r=`Unrecognized stream type: `+(t?.contructor?.name??t?.name??t);return n=e.call(this,r)||this,n}return t}(Error),Ng=function(e){J(t,e);function t(){var t=this;return t=e.call(this,"Found mismatched contexts while embedding pages. All pages in the array passed to `PDFDocument.embedPages()` must be from the same document.")||this,t}return t}(Error),Pg=function(e){J(t,e);function t(t){var n=this,r=`Attempted to convert PDFArray with `+t+` elements to rectangle, but must have exactly 4 elements.`;return n=e.call(this,r)||this,n}return t}(Error),Fg=function(e){J(t,e);function t(t){var n=this,r=`Attempted to convert "`+t+`" to a date, but it does not match the PDF date string format.`;return n=e.call(this,r)||this,n}return t}(Error),Ig=function(e){J(t,e);function t(t,n){var r=this,i=`Invalid targetIndex specified: targetIndex=`+t+` must be less than Count=`+n;return r=e.call(this,i)||this,r}return t}(Error),Lg=function(e){J(t,e);function t(t,n){var r=this,i=`Failed to `+n+` at targetIndex=`+t+` due to corrupt page tree: It is likely that one or more 'Count' entries are invalid`;return r=e.call(this,i)||this,r}return t}(Error),Rg=function(e){J(t,e);function t(t,n,r){var i=this,a=`index should be at least `+n+` and at most `+r+`, but was actually `+t;return i=e.call(this,a)||this,i}return t}(Error),zg=function(e){J(t,e);function t(){var t=this;return t=e.call(this,`Attempted to set invalid field value`)||this,t}return t}(Error),Bg=function(e){J(t,e);function t(){var t=this;return t=e.call(this,`Attempted to select multiple values for single-select field`)||this,t}return t}(Error),Vg=function(e){J(t,e);function t(t){var n=this,r=`No /DA (default appearance) entry found for field: `+t;return n=e.call(this,r)||this,n}return t}(Error),Hg=function(e){J(t,e);function t(t){var n=this,r=`No Tf operator found for DA of field: `+t;return n=e.call(this,r)||this,n}return t}(Error),Ug=function(e){J(t,e);function t(t,n){var r=this,i=`Failed to parse number `+(`(line:`+t.line+` col:`+t.column+` offset=`+t.offset+`): "`+n+`"`);return r=e.call(this,i)||this,r}return t}(Error),Wg=function(e){J(t,e);function t(t,n){var r=this,i=`Failed to parse PDF document `+(`(line:`+t.line+` col:`+t.column+` offset=`+t.offset+`): `+n);return r=e.call(this,i)||this,r}return t}(Error),Gg=function(e){J(t,e);function t(t,n,r){var i=this,a=`Expected next byte to be `+n+` but it was actually `+r;return i=e.call(this,t,a)||this,i}return t}(Wg),Kg=function(e){J(t,e);function t(t,n){var r=this,i=`Failed to parse PDF object starting with the following byte: `+n;return r=e.call(this,t,i)||this,r}return t}(Wg),qg=function(e){J(t,e);function t(t){var n=this;return n=e.call(this,t,`Failed to parse invalid PDF object`)||this,n}return t}(Wg),Jg=function(e){J(t,e);function t(t){var n=this;return n=e.call(this,t,`Failed to parse PDF stream`)||this,n}return t}(Wg),Yg=function(e){J(t,e);function t(t){var n=this;return n=e.call(this,t,`Failed to parse PDF literal string due to unbalanced parenthesis`)||this,n}return t}(Wg),Xg=function(e){J(t,e);function t(t){var n=this;return n=e.call(this,t,`Parser stalled`)||this,n}return t}(Wg),Zg=function(e){J(t,e);function t(t){var n=this;return n=e.call(this,t,`No PDF header found`)||this,n}return t}(Wg),Qg=function(e){J(t,e);function t(t,n){var r=this,i=`Did not find expected keyword '`+Xm(n)+`'`;return r=e.call(this,t,i)||this,r}return t}(Wg),$g;(function(e){e[e.Null=0]=`Null`,e[e.Backspace=8]=`Backspace`,e[e.Tab=9]=`Tab`,e[e.Newline=10]=`Newline`,e[e.FormFeed=12]=`FormFeed`,e[e.CarriageReturn=13]=`CarriageReturn`,e[e.Space=32]=`Space`,e[e.ExclamationPoint=33]=`ExclamationPoint`,e[e.Hash=35]=`Hash`,e[e.Percent=37]=`Percent`,e[e.LeftParen=40]=`LeftParen`,e[e.RightParen=41]=`RightParen`,e[e.Plus=43]=`Plus`,e[e.Minus=45]=`Minus`,e[e.Dash=45]=`Dash`,e[e.Period=46]=`Period`,e[e.ForwardSlash=47]=`ForwardSlash`,e[e.Zero=48]=`Zero`,e[e.One=49]=`One`,e[e.Two=50]=`Two`,e[e.Three=51]=`Three`,e[e.Four=52]=`Four`,e[e.Five=53]=`Five`,e[e.Six=54]=`Six`,e[e.Seven=55]=`Seven`,e[e.Eight=56]=`Eight`,e[e.Nine=57]=`Nine`,e[e.LessThan=60]=`LessThan`,e[e.GreaterThan=62]=`GreaterThan`,e[e.A=65]=`A`,e[e.D=68]=`D`,e[e.E=69]=`E`,e[e.F=70]=`F`,e[e.O=79]=`O`,e[e.P=80]=`P`,e[e.R=82]=`R`,e[e.LeftSquareBracket=91]=`LeftSquareBracket`,e[e.BackSlash=92]=`BackSlash`,e[e.RightSquareBracket=93]=`RightSquareBracket`,e[e.a=97]=`a`,e[e.b=98]=`b`,e[e.d=100]=`d`,e[e.e=101]=`e`,e[e.f=102]=`f`,e[e.i=105]=`i`,e[e.j=106]=`j`,e[e.l=108]=`l`,e[e.m=109]=`m`,e[e.n=110]=`n`,e[e.o=111]=`o`,e[e.r=114]=`r`,e[e.s=115]=`s`,e[e.t=116]=`t`,e[e.u=117]=`u`,e[e.x=120]=`x`,e[e.LeftCurly=123]=`LeftCurly`,e[e.RightCurly=125]=`RightCurly`,e[e.Tilde=126]=`Tilde`})($g||={});var Z=$g,e_=function(){function e(e,t){this.major=String(e),this.minor=String(t)}return e.prototype.toString=function(){var e=km(129);return`%PDF-`+this.major+`.`+this.minor+`
|
|
43
|
+
%`+e+e+e+e},e.prototype.sizeInBytes=function(){return 12+this.major.length+this.minor.length},e.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=Z.Percent,e[t++]=Z.P,e[t++]=Z.D,e[t++]=Z.F,e[t++]=Z.Dash,t+=Mm(this.major,e,t),e[t++]=Z.Period,t+=Mm(this.minor,e,t),e[t++]=Z.Newline,e[t++]=Z.Percent,e[t++]=129,e[t++]=129,e[t++]=129,e[t++]=129,t-n},e.forVersion=function(t,n){return new e(t,n)},e}(),t_=function(){function e(){}return e.prototype.clone=function(e){throw new Eg(this.constructor.name,`clone`)},e.prototype.toString=function(){throw new Eg(this.constructor.name,`toString`)},e.prototype.sizeInBytes=function(){throw new Eg(this.constructor.name,`sizeInBytes`)},e.prototype.copyBytesInto=function(e,t){throw new Eg(this.constructor.name,`copyBytesInto`)},e}(),n_=function(e){J(t,e);function t(t){var n=e.call(this)||this;return n.numberValue=t,n.stringValue=xh(t),n}return t.prototype.asNumber=function(){return this.numberValue},t.prototype.value=function(){return this.numberValue},t.prototype.clone=function(){return t.of(this.numberValue)},t.prototype.toString=function(){return this.stringValue},t.prototype.sizeInBytes=function(){return this.stringValue.length},t.prototype.copyBytesInto=function(e,t){return t+=Mm(this.stringValue,e,t),this.stringValue.length},t.of=function(e){return new t(e)},t}(t_),r_=function(e){J(t,e);function t(t){var n=e.call(this)||this;return n.array=[],n.context=t,n}return t.prototype.size=function(){return this.array.length},t.prototype.push=function(e){this.array.push(e)},t.prototype.insert=function(e,t){this.array.splice(e,0,t)},t.prototype.indexOf=function(e){var t=this.array.indexOf(e);return t===-1?void 0:t},t.prototype.remove=function(e){this.array.splice(e,1)},t.prototype.set=function(e,t){this.array[e]=t},t.prototype.get=function(e){return this.array[e]},t.prototype.lookupMaybe=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(t=this.context).lookupMaybe.apply(t,_m([this.get(e)],n))},t.prototype.lookup=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return(t=this.context).lookup.apply(t,_m([this.get(e)],n))},t.prototype.asRectangle=function(){if(this.size()!==4)throw new Pg(this.size());var e=this.lookup(0,n_).asNumber(),t=this.lookup(1,n_).asNumber(),n=this.lookup(2,n_).asNumber(),r=this.lookup(3,n_).asNumber();return{x:e,y:t,width:n-e,height:r-t}},t.prototype.asArray=function(){return this.array.slice()},t.prototype.clone=function(e){for(var n=t.withContext(e||this.context),r=0,i=this.size();r<i;r++)n.push(this.array[r]);return n},t.prototype.toString=function(){for(var e=`[ `,t=0,n=this.size();t<n;t++)e+=this.get(t).toString(),e+=` `;return e+=`]`,e},t.prototype.sizeInBytes=function(){for(var e=3,t=0,n=this.size();t<n;t++)e+=this.get(t).sizeInBytes()+1;return e},t.prototype.copyBytesInto=function(e,t){var n=t;e[t++]=Z.LeftSquareBracket,e[t++]=Z.Space;for(var r=0,i=this.size();r<i;r++)t+=this.get(r).copyBytesInto(e,t),e[t++]=Z.Space;return e[t++]=Z.RightSquareBracket,t-n},t.prototype.scalePDFNumbers=function(e,t){for(var n=0,r=this.size();n<r;n++){var i=this.lookup(n);if(i instanceof n_){var a=n%2==0?e:t;this.set(n,n_.of(i.asNumber()*a))}}},t.withContext=function(e){return new t(e)},t}(t_),i_={},a_=function(e){J(t,e);function t(t,n){var r=this;if(t!==i_)throw new Dg(`PDFBool`);return r=e.call(this)||this,r.value=n,r}return t.prototype.asBoolean=function(){return this.value},t.prototype.clone=function(){return this},t.prototype.toString=function(){return String(this.value)},t.prototype.sizeInBytes=function(){return this.value?4:5},t.prototype.copyBytesInto=function(e,t){return this.value?(e[t++]=Z.t,e[t++]=Z.r,e[t++]=Z.u,e[t++]=Z.e,4):(e[t++]=Z.f,e[t++]=Z.a,e[t++]=Z.l,e[t++]=Z.s,e[t++]=Z.e,5)},t.True=new t(i_,!0),t.False=new t(i_,!1),t}(t_),o_=new Uint8Array(256);o_[Z.LeftParen]=1,o_[Z.RightParen]=1,o_[Z.LessThan]=1,o_[Z.GreaterThan]=1,o_[Z.LeftSquareBracket]=1,o_[Z.RightSquareBracket]=1,o_[Z.LeftCurly]=1,o_[Z.RightCurly]=1,o_[Z.ForwardSlash]=1,o_[Z.Percent]=1;var s_=new Uint8Array(256);s_[Z.Null]=1,s_[Z.Tab]=1,s_[Z.Newline]=1,s_[Z.FormFeed]=1,s_[Z.CarriageReturn]=1,s_[Z.Space]=1;for(var c_=new Uint8Array(256),l_=0,u_=256;l_<u_;l_++)c_[l_]=s_[l_]||o_[l_]?1:0;c_[Z.Hash]=1;var d_=function(e){return e.replace(/#([\dABCDEF]{2})/g,function(e,t){return Am(t)})},f_=function(e){return e>=Z.ExclamationPoint&&e<=Z.Tilde&&!c_[e]},p_={},m_=new Map,Q=function(e){J(t,e);function t(t,n){var r=this;if(t!==p_)throw new Dg(`PDFName`);r=e.call(this)||this;for(var i=`/`,a=0,o=n.length;a<o;a++){var s=n[a],c=Tm(s);i+=f_(c)?s:`#`+Om(c)}return r.encodedName=i,r}return t.prototype.asBytes=function(){for(var e=[],t=``,n=!1,r=function(t){t!==void 0&&e.push(t),n=!1},i=1,a=this.encodedName.length;i<a;i++){var o=this.encodedName[i],s=Tm(o),c=this.encodedName[i+1];n?s>=Z.Zero&&s<=Z.Nine||s>=Z.a&&s<=Z.f||s>=Z.A&&s<=Z.F?(t+=o,(t.length===2||!(c>=`0`&&c<=`9`||c>=`a`&&c<=`f`||c>=`A`&&c<=`F`))&&(r(parseInt(t,16)),t=``)):r(s):s===Z.Hash?n=!0:r(s)}return new Uint8Array(e)},t.prototype.decodeText=function(){var e=this.asBytes();return String.fromCharCode.apply(String,Array.from(e))},t.prototype.asString=function(){return this.encodedName},t.prototype.value=function(){return this.encodedName},t.prototype.clone=function(){return this},t.prototype.toString=function(){return this.encodedName},t.prototype.sizeInBytes=function(){return this.encodedName.length},t.prototype.copyBytesInto=function(e,t){return t+=Mm(this.encodedName,e,t),this.encodedName.length},t.of=function(e){var n=d_(e),r=m_.get(n);return r||(r=new t(p_,n),m_.set(n,r)),r},t.Length=t.of(`Length`),t.FlateDecode=t.of(`FlateDecode`),t.Resources=t.of(`Resources`),t.Font=t.of(`Font`),t.XObject=t.of(`XObject`),t.ExtGState=t.of(`ExtGState`),t.Contents=t.of(`Contents`),t.Type=t.of(`Type`),t.Parent=t.of(`Parent`),t.MediaBox=t.of(`MediaBox`),t.Page=t.of(`Page`),t.Annots=t.of(`Annots`),t.TrimBox=t.of(`TrimBox`),t.ArtBox=t.of(`ArtBox`),t.BleedBox=t.of(`BleedBox`),t.CropBox=t.of(`CropBox`),t.Rotate=t.of(`Rotate`),t.Title=t.of(`Title`),t.Author=t.of(`Author`),t.Subject=t.of(`Subject`),t.Creator=t.of(`Creator`),t.Keywords=t.of(`Keywords`),t.Producer=t.of(`Producer`),t.CreationDate=t.of(`CreationDate`),t.ModDate=t.of(`ModDate`),t}(t_),h_=new(function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.asNull=function(){return null},t.prototype.clone=function(){return this},t.prototype.toString=function(){return`null`},t.prototype.sizeInBytes=function(){return 4},t.prototype.copyBytesInto=function(e,t){return e[t++]=Z.n,e[t++]=Z.u,e[t++]=Z.l,e[t++]=Z.l,4},t}(t_)),g_=function(e){J(t,e);function t(t,n){var r=e.call(this)||this;return r.dict=t,r.context=n,r}return t.prototype.keys=function(){return Array.from(this.dict.keys())},t.prototype.values=function(){return Array.from(this.dict.values())},t.prototype.entries=function(){return Array.from(this.dict.entries())},t.prototype.set=function(e,t){this.dict.set(e,t)},t.prototype.get=function(e,t){t===void 0&&(t=!1);var n=this.dict.get(e);if(!(n===h_&&!t))return n},t.prototype.has=function(e){var t=this.dict.get(e);return t!==void 0&&t!==h_},t.prototype.lookupMaybe=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=n.includes(h_),a=(t=this.context).lookupMaybe.apply(t,_m([this.get(e,i)],n));if(!(a===h_&&!i))return a},t.prototype.lookup=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=n.includes(h_),a=(t=this.context).lookup.apply(t,_m([this.get(e,i)],n));if(!(a===h_&&!i))return a},t.prototype.delete=function(e){return this.dict.delete(e)},t.prototype.asMap=function(){return new Map(this.dict)},t.prototype.uniqueKey=function(e){e===void 0&&(e=``);for(var t=this.keys(),n=Q.of(this.context.addRandomSuffix(e,10));t.includes(n);)n=Q.of(this.context.addRandomSuffix(e,10));return n},t.prototype.clone=function(e){for(var n=t.withContext(e||this.context),r=this.entries(),i=0,a=r.length;i<a;i++){var o=r[i],s=o[0],c=o[1];n.set(s,c)}return n},t.prototype.toString=function(){for(var e=`<<
|
|
44
|
+
`,t=this.entries(),n=0,r=t.length;n<r;n++){var i=t[n],a=i[0],o=i[1];e+=a.toString()+` `+o.toString()+`
|
|
45
|
+
`}return e+=`>>`,e},t.prototype.sizeInBytes=function(){for(var e=5,t=this.entries(),n=0,r=t.length;n<r;n++){var i=t[n],a=i[0],o=i[1];e+=a.sizeInBytes()+o.sizeInBytes()+2}return e},t.prototype.copyBytesInto=function(e,t){var n=t;e[t++]=Z.LessThan,e[t++]=Z.LessThan,e[t++]=Z.Newline;for(var r=this.entries(),i=0,a=r.length;i<a;i++){var o=r[i],s=o[0],c=o[1];t+=s.copyBytesInto(e,t),e[t++]=Z.Space,t+=c.copyBytesInto(e,t),e[t++]=Z.Newline}return e[t++]=Z.GreaterThan,e[t++]=Z.GreaterThan,t-n},t.withContext=function(e){return new t(new Map,e)},t.fromMapWithContext=function(e,n){return new t(e,n)},t}(t_),__=function(e){J(t,e);function t(t){var n=e.call(this)||this;return n.dict=t,n}return t.prototype.clone=function(e){throw new Eg(this.constructor.name,`clone`)},t.prototype.getContentsString=function(){throw new Eg(this.constructor.name,`getContentsString`)},t.prototype.getContents=function(){throw new Eg(this.constructor.name,`getContents`)},t.prototype.getContentsSize=function(){throw new Eg(this.constructor.name,`getContentsSize`)},t.prototype.updateDict=function(){var e=this.getContentsSize();this.dict.set(Q.Length,n_.of(e))},t.prototype.sizeInBytes=function(){return this.updateDict(),this.dict.sizeInBytes()+this.getContentsSize()+18},t.prototype.toString=function(){this.updateDict();var e=this.dict.toString();return e+=`
|
|
46
|
+
stream
|
|
47
|
+
`,e+=this.getContentsString(),e+=`
|
|
48
|
+
endstream`,e},t.prototype.copyBytesInto=function(e,t){this.updateDict();var n=t;t+=this.dict.copyBytesInto(e,t),e[t++]=Z.Newline,e[t++]=Z.s,e[t++]=Z.t,e[t++]=Z.r,e[t++]=Z.e,e[t++]=Z.a,e[t++]=Z.m,e[t++]=Z.Newline;for(var r=this.getContents(),i=0,a=r.length;i<a;i++)e[t++]=r[i];return e[t++]=Z.Newline,e[t++]=Z.e,e[t++]=Z.n,e[t++]=Z.d,e[t++]=Z.s,e[t++]=Z.t,e[t++]=Z.r,e[t++]=Z.e,e[t++]=Z.a,e[t++]=Z.m,t-n},t}(t_),v_=function(e){J(t,e);function t(t,n){var r=e.call(this,t)||this;return r.contents=n,r}return t.prototype.asUint8Array=function(){return this.contents.slice()},t.prototype.clone=function(e){return t.of(this.dict.clone(e),this.contents.slice())},t.prototype.getContentsString=function(){return Xm(this.contents)},t.prototype.getContents=function(){return this.contents},t.prototype.getContentsSize=function(){return this.contents.length},t.of=function(e,n){return new t(e,n)},t}(__),y_={},b_=new Map,x_=function(e){J(t,e);function t(t,n,r){var i=this;if(t!==y_)throw new Dg(`PDFRef`);return i=e.call(this)||this,i.objectNumber=n,i.generationNumber=r,i.tag=n+` `+r+` R`,i}return t.prototype.clone=function(){return this},t.prototype.toString=function(){return this.tag},t.prototype.sizeInBytes=function(){return this.tag.length},t.prototype.copyBytesInto=function(e,t){return t+=Mm(this.tag,e,t),this.tag.length},t.of=function(e,n){n===void 0&&(n=0);var r=e+` `+n+` R`,i=b_.get(r);return i||(i=new t(y_,e,n),b_.set(r,i)),i},t}(t_),S_=function(){function e(e,t){this.name=e,this.args=t||[]}return e.prototype.clone=function(t){for(var n=Array(this.args.length),r=0,i=n.length;r<i;r++){var a=this.args[r];n[r]=a instanceof t_?a.clone(t):a}return e.of(this.name,n)},e.prototype.toString=function(){for(var e=``,t=0,n=this.args.length;t<n;t++)e+=String(this.args[t])+` `;return e+=this.name,e},e.prototype.sizeInBytes=function(){for(var e=0,t=0,n=this.args.length;t<n;t++){var r=this.args[t];e+=(r instanceof t_?r.sizeInBytes():r.length)+1}return e+=this.name.length,e},e.prototype.copyBytesInto=function(e,t){for(var n=t,r=0,i=this.args.length;r<i;r++){var a=this.args[r];a instanceof t_?t+=a.copyBytesInto(e,t):t+=Mm(a,e,t),e[t++]=Z.Space}return t+=Mm(this.name,e,t),t-n},e.of=function(t,n){return new e(t,n)},e}(),C_;(function(e){e.NonStrokingColor=`sc`,e.NonStrokingColorN=`scn`,e.NonStrokingColorRgb=`rg`,e.NonStrokingColorGray=`g`,e.NonStrokingColorCmyk=`k`,e.NonStrokingColorspace=`cs`,e.StrokingColor=`SC`,e.StrokingColorN=`SCN`,e.StrokingColorRgb=`RG`,e.StrokingColorGray=`G`,e.StrokingColorCmyk=`K`,e.StrokingColorspace=`CS`,e.BeginMarkedContentSequence=`BDC`,e.BeginMarkedContent=`BMC`,e.EndMarkedContent=`EMC`,e.MarkedContentPointWithProps=`DP`,e.MarkedContentPoint=`MP`,e.DrawObject=`Do`,e.ConcatTransformationMatrix=`cm`,e.PopGraphicsState=`Q`,e.PushGraphicsState=`q`,e.SetFlatness=`i`,e.SetGraphicsStateParams=`gs`,e.SetLineCapStyle=`J`,e.SetLineDashPattern=`d`,e.SetLineJoinStyle=`j`,e.SetLineMiterLimit=`M`,e.SetLineWidth=`w`,e.SetTextMatrix=`Tm`,e.SetRenderingIntent=`ri`,e.AppendRectangle=`re`,e.BeginInlineImage=`BI`,e.BeginInlineImageData=`ID`,e.EndInlineImage=`EI`,e.ClipEvenOdd=`W*`,e.ClipNonZero=`W`,e.CloseAndStroke=`s`,e.CloseFillEvenOddAndStroke=`b*`,e.CloseFillNonZeroAndStroke=`b`,e.ClosePath=`h`,e.AppendBezierCurve=`c`,e.CurveToReplicateFinalPoint=`y`,e.CurveToReplicateInitialPoint=`v`,e.EndPath=`n`,e.FillEvenOddAndStroke=`B*`,e.FillEvenOdd=`f*`,e.FillNonZeroAndStroke=`B`,e.FillNonZero=`f`,e.LegacyFillNonZero=`F`,e.LineTo=`l`,e.MoveTo=`m`,e.ShadingFill=`sh`,e.StrokePath=`S`,e.BeginText=`BT`,e.EndText=`ET`,e.MoveText=`Td`,e.MoveTextSetLeading=`TD`,e.NextLine=`T*`,e.SetCharacterSpacing=`Tc`,e.SetFontAndSize=`Tf`,e.SetTextHorizontalScaling=`Tz`,e.SetTextLineHeight=`TL`,e.SetTextRenderingMode=`Tr`,e.SetTextRise=`Ts`,e.SetWordSpacing=`Tw`,e.ShowText=`Tj`,e.ShowTextAdjusted=`TJ`,e.ShowTextLine=`'`,e.ShowTextLineAndSpace=`"`,e.Type3D0=`d0`,e.Type3D1=`d1`,e.BeginCompatibilitySection=`BX`,e.EndCompatibilitySection=`EX`})(C_||={});var w_=C_,T_=function(e){J(t,e);function t(t,n){var r=e.call(this,t)||this;return r.computeContents=function(){var e=r.getUnencodedContents();return r.encode?Bh.default.deflate(e):e},r.encode=n,n&&t.set(Q.of(`Filter`),Q.of(`FlateDecode`)),r.contentsCache=Tg.populatedBy(r.computeContents),r}return t.prototype.getContents=function(){return this.contentsCache.access()},t.prototype.getContentsSize=function(){return this.contentsCache.access().length},t.prototype.getUnencodedContents=function(){throw new Eg(this.constructor.name,`getUnencodedContents`)},t}(__),E_=function(e){J(t,e);function t(t,n,r){r===void 0&&(r=!0);var i=e.call(this,t,r)||this;return i.operators=n,i}return t.prototype.push=function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];(e=this.operators).push.apply(e,t)},t.prototype.clone=function(e){for(var n=Array(this.operators.length),r=0,i=this.operators.length;r<i;r++)n[r]=this.operators[r].clone(e);var a=this,o=a.dict,s=a.encode;return t.of(o.clone(e),n,s)},t.prototype.getContentsString=function(){for(var e=``,t=0,n=this.operators.length;t<n;t++)e+=this.operators[t]+`
|
|
49
|
+
`;return e},t.prototype.getUnencodedContents=function(){for(var e=new Uint8Array(this.getUnencodedContentsSize()),t=0,n=0,r=this.operators.length;n<r;n++)t+=this.operators[n].copyBytesInto(e,t),e[t++]=Z.Newline;return e},t.prototype.getUnencodedContentsSize=function(){for(var e=0,t=0,n=this.operators.length;t<n;t++)e+=this.operators[t].sizeInBytes()+1;return e},t.of=function(e,n,r){return r===void 0&&(r=!0),new t(e,n,r)},t}(T_),D_=function(){function e(e){this.seed=e}return e.prototype.nextInt=function(){var e=Math.sin(this.seed++)*1e4;return e-Math.floor(e)},e.withSeed=function(t){return new e(t)},e}(),O_=function(e,t){var n=e[0],r=t[0];return n.objectNumber-r.objectNumber},k_=function(){function e(){this.largestObjectNumber=0,this.header=e_.forVersion(1,7),this.trailerInfo={},this.indirectObjects=new Map,this.rng=D_.withSeed(1)}return e.prototype.assign=function(e,t){this.indirectObjects.set(e,t),e.objectNumber>this.largestObjectNumber&&(this.largestObjectNumber=e.objectNumber)},e.prototype.nextRef=function(){return this.largestObjectNumber+=1,x_.of(this.largestObjectNumber)},e.prototype.register=function(e){var t=this.nextRef();return this.assign(t,e),t},e.prototype.delete=function(e){return this.indirectObjects.delete(e)},e.prototype.lookupMaybe=function(e){var t=[...arguments].slice(1),n=t.includes(h_),r=e instanceof x_?this.indirectObjects.get(e):e;if(!(!r||r===h_&&!n)){for(var i=0,a=t.length;i<a;i++){var o=t[i];if(o===h_){if(r===h_)return r}else if(r instanceof o)return r}throw new Og(t,r)}},e.prototype.lookup=function(e){var t=[...arguments].slice(1),n=e instanceof x_?this.indirectObjects.get(e):e;if(t.length===0)return n;for(var r=0,i=t.length;r<i;r++){var a=t[r];if(a===h_){if(n===h_)return n}else if(n instanceof a)return n}throw new Og(t,n)},e.prototype.getObjectRef=function(e){for(var t=Array.from(this.indirectObjects.entries()),n=0,r=t.length;n<r;n++){var i=t[n],a=i[0];if(i[1]===e)return a}},e.prototype.enumerateIndirectObjects=function(){return Array.from(this.indirectObjects.entries()).sort(O_)},e.prototype.obj=function(e){if(e instanceof t_)return e;if(e==null)return h_;if(typeof e==`string`)return Q.of(e);if(typeof e==`number`)return n_.of(e);if(typeof e==`boolean`)return e?a_.True:a_.False;if(Array.isArray(e)){for(var t=r_.withContext(this),n=0,r=e.length;n<r;n++)t.push(this.obj(e[n]));return t}else{for(var i=g_.withContext(this),a=Object.keys(e),n=0,r=a.length;n<r;n++){var o=a[n],s=e[o];s!==void 0&&i.set(Q.of(o),this.obj(s))}return i}},e.prototype.stream=function(e,t){return t===void 0&&(t={}),v_.of(this.obj(t),qm(e))},e.prototype.flateStream=function(e,t){return t===void 0&&(t={}),this.stream(Bh.default.deflate(qm(e)),pm(pm({},t),{Filter:`FlateDecode`}))},e.prototype.contentStream=function(e,t){return t===void 0&&(t={}),E_.of(this.obj(t),e)},e.prototype.formXObject=function(e,t){return t===void 0&&(t={}),this.contentStream(e,pm(pm({BBox:this.obj([0,0,0,0]),Matrix:this.obj([1,0,0,1,0,0])},t),{Type:`XObject`,Subtype:`Form`}))},e.prototype.getPushGraphicsStateContentStream=function(){if(this.pushGraphicsStateContentStreamRef)return this.pushGraphicsStateContentStreamRef;var e=this.obj({}),t=S_.of(w_.PushGraphicsState),n=E_.of(e,[t]);return this.pushGraphicsStateContentStreamRef=this.register(n),this.pushGraphicsStateContentStreamRef},e.prototype.getPopGraphicsStateContentStream=function(){if(this.popGraphicsStateContentStreamRef)return this.popGraphicsStateContentStreamRef;var e=this.obj({}),t=S_.of(w_.PopGraphicsState),n=E_.of(e,[t]);return this.popGraphicsStateContentStreamRef=this.register(n),this.popGraphicsStateContentStreamRef},e.prototype.addRandomSuffix=function(e,t){return t===void 0&&(t=4),e+`-`+Math.floor(this.rng.nextInt()*10**t)},e.create=function(){return new e},e}(),A_=function(e){J(t,e);function t(t,n,r){r===void 0&&(r=!0);var i=e.call(this,t,n)||this;return i.normalized=!1,i.autoNormalizeCTM=r,i}return t.prototype.clone=function(e){for(var n=t.fromMapWithContext(new Map,e||this.context,this.autoNormalizeCTM),r=this.entries(),i=0,a=r.length;i<a;i++){var o=r[i],s=o[0],c=o[1];n.set(s,c)}return n},t.prototype.Parent=function(){return this.lookupMaybe(Q.Parent,g_)},t.prototype.Contents=function(){return this.lookup(Q.of(`Contents`))},t.prototype.Annots=function(){return this.lookupMaybe(Q.Annots,r_)},t.prototype.BleedBox=function(){return this.lookupMaybe(Q.BleedBox,r_)},t.prototype.TrimBox=function(){return this.lookupMaybe(Q.TrimBox,r_)},t.prototype.ArtBox=function(){return this.lookupMaybe(Q.ArtBox,r_)},t.prototype.Resources=function(){var e=this.getInheritableAttribute(Q.Resources);return this.context.lookupMaybe(e,g_)},t.prototype.MediaBox=function(){var e=this.getInheritableAttribute(Q.MediaBox);return this.context.lookup(e,r_)},t.prototype.CropBox=function(){var e=this.getInheritableAttribute(Q.CropBox);return this.context.lookupMaybe(e,r_)},t.prototype.Rotate=function(){var e=this.getInheritableAttribute(Q.Rotate);return this.context.lookupMaybe(e,n_)},t.prototype.getInheritableAttribute=function(e){var t;return this.ascend(function(n){t||=n.get(e)}),t},t.prototype.setParent=function(e){this.set(Q.Parent,e)},t.prototype.addContentStream=function(e){var t=this.normalizedEntries().Contents||this.context.obj([]);this.set(Q.Contents,t),t.push(e)},t.prototype.wrapContentStreams=function(e,t){var n=this.Contents();return n instanceof r_?(n.insert(0,e),n.push(t),!0):!1},t.prototype.addAnnot=function(e){this.normalizedEntries().Annots.push(e)},t.prototype.removeAnnot=function(e){var t=this.normalizedEntries().Annots,n=t.indexOf(e);n!==void 0&&t.remove(n)},t.prototype.setFontDictionary=function(e,t){this.normalizedEntries().Font.set(e,t)},t.prototype.newFontDictionaryKey=function(e){return this.normalizedEntries().Font.uniqueKey(e)},t.prototype.newFontDictionary=function(e,t){var n=this.newFontDictionaryKey(e);return this.setFontDictionary(n,t),n},t.prototype.setXObject=function(e,t){this.normalizedEntries().XObject.set(e,t)},t.prototype.newXObjectKey=function(e){return this.normalizedEntries().XObject.uniqueKey(e)},t.prototype.newXObject=function(e,t){var n=this.newXObjectKey(e);return this.setXObject(n,t),n},t.prototype.setExtGState=function(e,t){this.normalizedEntries().ExtGState.set(e,t)},t.prototype.newExtGStateKey=function(e){return this.normalizedEntries().ExtGState.uniqueKey(e)},t.prototype.newExtGState=function(e,t){var n=this.newExtGStateKey(e);return this.setExtGState(n,t),n},t.prototype.ascend=function(e){e(this);var t=this.Parent();t&&t.ascend(e)},t.prototype.normalize=function(){if(!this.normalized){var e=this.context,t=this.get(Q.Contents);this.context.lookup(t)instanceof __&&this.set(Q.Contents,e.obj([t])),this.autoNormalizeCTM&&this.wrapContentStreams(this.context.getPushGraphicsStateContentStream(),this.context.getPopGraphicsStateContentStream());var n=this.getInheritableAttribute(Q.Resources),r=e.lookupMaybe(n,g_)||e.obj({});this.set(Q.Resources,r);var i=r.lookupMaybe(Q.Font,g_)||e.obj({});r.set(Q.Font,i);var a=r.lookupMaybe(Q.XObject,g_)||e.obj({});r.set(Q.XObject,a);var o=r.lookupMaybe(Q.ExtGState,g_)||e.obj({});r.set(Q.ExtGState,o);var s=this.Annots()||e.obj([]);this.set(Q.Annots,s),this.normalized=!0}},t.prototype.normalizedEntries=function(){this.normalize();var e=this.Annots(),t=this.Resources();return{Annots:e,Resources:t,Contents:this.Contents(),Font:t.lookup(Q.Font,g_),XObject:t.lookup(Q.XObject,g_),ExtGState:t.lookup(Q.ExtGState,g_)}},t.InheritableEntries=[`Resources`,`MediaBox`,`CropBox`,`Rotate`],t.withContextAndParent=function(e,n){var r=new Map;return r.set(Q.Type,Q.Page),r.set(Q.Parent,n),r.set(Q.Resources,e.obj({})),r.set(Q.MediaBox,e.obj([0,0,612,792])),new t(r,e,!1)},t.fromMapWithContext=function(e,n,r){return r===void 0&&(r=!0),new t(e,n,r)},t}(g_),j_=function(){function e(e,t){var n=this;this.traversedObjects=new Map,this.copy=function(e){return e instanceof A_?n.copyPDFPage(e):e instanceof g_?n.copyPDFDict(e):e instanceof r_?n.copyPDFArray(e):e instanceof __?n.copyPDFStream(e):e instanceof x_?n.copyPDFIndirectObject(e):e.clone()},this.copyPDFPage=function(e){for(var t=e.clone(),r=A_.InheritableEntries,i=0,a=r.length;i<a;i++){var o=Q.of(r[i]),s=t.getInheritableAttribute(o);!t.get(o)&&s&&t.set(o,s)}return t.delete(Q.of(`Parent`)),n.copyPDFDict(t)},this.copyPDFDict=function(e){if(n.traversedObjects.has(e))return n.traversedObjects.get(e);var t=e.clone(n.dest);n.traversedObjects.set(e,t);for(var r=e.entries(),i=0,a=r.length;i<a;i++){var o=r[i],s=o[0],c=o[1];t.set(s,n.copy(c))}return t},this.copyPDFArray=function(e){if(n.traversedObjects.has(e))return n.traversedObjects.get(e);var t=e.clone(n.dest);n.traversedObjects.set(e,t);for(var r=0,i=e.size();r<i;r++){var a=e.get(r);t.set(r,n.copy(a))}return t},this.copyPDFStream=function(e){if(n.traversedObjects.has(e))return n.traversedObjects.get(e);var t=e.clone(n.dest);n.traversedObjects.set(e,t);for(var r=e.dict.entries(),i=0,a=r.length;i<a;i++){var o=r[i],s=o[0],c=o[1];t.dict.set(s,n.copy(c))}return t},this.copyPDFIndirectObject=function(e){if(!n.traversedObjects.has(e)){var t=n.dest.nextRef();n.traversedObjects.set(e,t);var r=n.src.lookup(e);if(r){var i=n.copy(r);n.dest.assign(t,i)}}return n.traversedObjects.get(e)},this.src=e,this.dest=t}return e.for=function(t,n){return new e(t,n)},e}(),M_=function(){function e(e){this.subsections=e?[[e]]:[],this.chunkIdx=0,this.chunkLength=+!!e}return e.prototype.addEntry=function(e,t){this.append({ref:e,offset:t,deleted:!1})},e.prototype.addDeletedEntry=function(e,t){this.append({ref:e,offset:t,deleted:!0})},e.prototype.toString=function(){for(var e=`xref
|
|
50
|
+
`,t=0,n=this.subsections.length;t<n;t++){var r=this.subsections[t];e+=r[0].ref.objectNumber+` `+r.length+`
|
|
51
|
+
`;for(var i=0,a=r.length;i<a;i++){var o=r[i];e+=jm(String(o.offset),10,`0`),e+=` `,e+=jm(String(o.ref.generationNumber),5,`0`),e+=` `,e+=o.deleted?`f`:`n`,e+=`
|
|
52
|
+
`}}return e},e.prototype.sizeInBytes=function(){for(var e=5,t=0,n=this.subsections.length;t<n;t++){var r=this.subsections[t],i=r.length,a=r[0];e+=2,e+=String(a.ref.objectNumber).length,e+=String(i).length,e+=20*i}return e},e.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=Z.x,e[t++]=Z.r,e[t++]=Z.e,e[t++]=Z.f,e[t++]=Z.Newline,t+=this.copySubsectionsIntoBuffer(this.subsections,e,t),t-n},e.prototype.copySubsectionsIntoBuffer=function(e,t,n){for(var r=n,i=e.length,a=0;a<i;a++){var o=this.subsections[a],s=String(o[0].ref.objectNumber);n+=Mm(s,t,n),t[n++]=Z.Space;var c=String(o.length);n+=Mm(c,t,n),t[n++]=Z.Newline,n+=this.copyEntriesIntoBuffer(o,t,n)}return n-r},e.prototype.copyEntriesIntoBuffer=function(e,t,n){for(var r=e.length,i=0;i<r;i++){var a=e[i],o=jm(String(a.offset),10,`0`);n+=Mm(o,t,n),t[n++]=Z.Space;var s=jm(String(a.ref.generationNumber),5,`0`);n+=Mm(s,t,n),t[n++]=Z.Space,t[n++]=a.deleted?Z.f:Z.n,t[n++]=Z.Space,t[n++]=Z.Newline}return 20*r},e.prototype.append=function(e){if(this.chunkLength===0){this.subsections.push([e]),this.chunkIdx=0,this.chunkLength=1;return}var t=this.subsections[this.chunkIdx],n=t[this.chunkLength-1];e.ref.objectNumber-n.ref.objectNumber>1?(this.subsections.push([e]),this.chunkIdx+=1,this.chunkLength=1):(t.push(e),this.chunkLength+=1)},e.create=function(){return new e({ref:x_.of(0,65535),offset:0,deleted:!0})},e.createEmpty=function(){return new e},e}(),N_=function(){function e(e){this.lastXRefOffset=String(e)}return e.prototype.toString=function(){return`startxref
|
|
53
|
+
`+this.lastXRefOffset+`
|
|
54
|
+
%%EOF`},e.prototype.sizeInBytes=function(){return 16+this.lastXRefOffset.length},e.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=Z.s,e[t++]=Z.t,e[t++]=Z.a,e[t++]=Z.r,e[t++]=Z.t,e[t++]=Z.x,e[t++]=Z.r,e[t++]=Z.e,e[t++]=Z.f,e[t++]=Z.Newline,t+=Mm(this.lastXRefOffset,e,t),e[t++]=Z.Newline,e[t++]=Z.Percent,e[t++]=Z.Percent,e[t++]=Z.E,e[t++]=Z.O,e[t++]=Z.F,t-n},e.forLastCrossRefSectionOffset=function(t){return new e(t)},e}(),P_=function(){function e(e){this.dict=e}return e.prototype.toString=function(){return`trailer
|
|
55
|
+
`+this.dict.toString()},e.prototype.sizeInBytes=function(){return 8+this.dict.sizeInBytes()},e.prototype.copyBytesInto=function(e,t){var n=t;return e[t++]=Z.t,e[t++]=Z.r,e[t++]=Z.a,e[t++]=Z.i,e[t++]=Z.l,e[t++]=Z.e,e[t++]=Z.r,e[t++]=Z.Newline,t+=this.dict.copyBytesInto(e,t),t-n},e.of=function(t){return new e(t)},e}(),F_=function(e){J(t,e);function t(t,n,r){r===void 0&&(r=!0);var i=e.call(this,t.obj({}),r)||this;return i.objects=n,i.offsets=i.computeObjectOffsets(),i.offsetsString=i.computeOffsetsString(),i.dict.set(Q.of(`Type`),Q.of(`ObjStm`)),i.dict.set(Q.of(`N`),n_.of(i.objects.length)),i.dict.set(Q.of(`First`),n_.of(i.offsetsString.length)),i}return t.prototype.getObjectsCount=function(){return this.objects.length},t.prototype.clone=function(e){return t.withContextAndObjects(e||this.dict.context,this.objects.slice(),this.encode)},t.prototype.getContentsString=function(){for(var e=this.offsetsString,t=0,n=this.objects.length;t<n;t++){var r=this.objects[t][1];e+=r+`
|
|
56
|
+
`}return e},t.prototype.getUnencodedContents=function(){for(var e=new Uint8Array(this.getUnencodedContentsSize()),t=Mm(this.offsetsString,e,0),n=0,r=this.objects.length;n<r;n++){var i=this.objects[n][1];t+=i.copyBytesInto(e,t),e[t++]=Z.Newline}return e},t.prototype.getUnencodedContentsSize=function(){return this.offsetsString.length+Km(this.offsets)[1]+Km(this.objects)[1].sizeInBytes()+1},t.prototype.computeOffsetsString=function(){for(var e=``,t=0,n=this.offsets.length;t<n;t++){var r=this.offsets[t],i=r[0],a=r[1];e+=i+` `+a+` `}return e},t.prototype.computeObjectOffsets=function(){for(var e=0,t=Array(this.objects.length),n=0,r=this.objects.length;n<r;n++){var i=this.objects[n],a=i[0],o=i[1];t[n]=[a.objectNumber,e],e+=o.sizeInBytes()+1}return t},t.withContextAndObjects=function(e,n,r){return r===void 0&&(r=!0),new t(e,n,r)},t}(T_),I_=function(){function e(e,t){var n=this;this.parsedObjects=0,this.shouldWaitForTick=function(e){return n.parsedObjects+=e,n.parsedObjects%n.objectsPerTick===0},this.context=e,this.objectsPerTick=t}return e.prototype.serializeToBuffer=function(){return hm(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;return gm(this,function(_){switch(_.label){case 0:return[4,this.computeBufferSize()];case 1:e=_.sent(),t=e.size,n=e.header,r=e.indirectObjects,i=e.xref,a=e.trailerDict,o=e.trailer,s=0,c=new Uint8Array(t),s+=n.copyBytesInto(c,s),c[s++]=Z.Newline,c[s++]=Z.Newline,l=0,u=r.length,_.label=2;case 2:return l<u?(d=r[l],f=d[0],p=d[1],m=String(f.objectNumber),s+=Mm(m,c,s),c[s++]=Z.Space,h=String(f.generationNumber),s+=Mm(h,c,s),c[s++]=Z.Space,c[s++]=Z.o,c[s++]=Z.b,c[s++]=Z.j,c[s++]=Z.Newline,s+=p.copyBytesInto(c,s),c[s++]=Z.Newline,c[s++]=Z.e,c[s++]=Z.n,c[s++]=Z.d,c[s++]=Z.o,c[s++]=Z.b,c[s++]=Z.j,c[s++]=Z.Newline,c[s++]=Z.Newline,g=p instanceof F_?p.getObjectsCount():1,this.shouldWaitForTick(g)?[4,ah()]:[3,4]):[3,5];case 3:_.sent(),_.label=4;case 4:return l++,[3,2];case 5:return i&&(s+=i.copyBytesInto(c,s),c[s++]=Z.Newline),a&&(s+=a.copyBytesInto(c,s),c[s++]=Z.Newline,c[s++]=Z.Newline),s+=o.copyBytesInto(c,s),[2,c]}})})},e.prototype.computeIndirectObjectSize=function(e){var t=e[0],n=e[1];return t.sizeInBytes()+3+(n.sizeInBytes()+9)},e.prototype.createTrailerDict=function(){return this.context.obj({Size:this.context.largestObjectNumber+1,Root:this.context.trailerInfo.Root,Encrypt:this.context.trailerInfo.Encrypt,Info:this.context.trailerInfo.Info,ID:this.context.trailerInfo.ID})},e.prototype.computeBufferSize=function(){return hm(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u;return gm(this,function(d){switch(d.label){case 0:e=e_.forVersion(1,7),t=e.sizeInBytes()+2,n=M_.create(),r=this.context.enumerateIndirectObjects(),i=0,a=r.length,d.label=1;case 1:return i<a?(o=r[i],s=o[0],n.addEntry(s,t),t+=this.computeIndirectObjectSize(o),this.shouldWaitForTick(1)?[4,ah()]:[3,3]):[3,4];case 2:d.sent(),d.label=3;case 3:return i++,[3,1];case 4:return c=t,t+=n.sizeInBytes()+1,l=P_.of(this.createTrailerDict()),t+=l.sizeInBytes()+2,u=N_.forLastCrossRefSectionOffset(c),t+=u.sizeInBytes(),[2,{size:t,header:e,indirectObjects:r,xref:n,trailerDict:l,trailer:u}]}})})},e.forContext=function(t,n){return new e(t,n)},e}(),L_=function(e){J(t,e);function t(t){var n=e.call(this)||this;return n.data=t,n}return t.prototype.clone=function(){return t.of(this.data.slice())},t.prototype.toString=function(){return`PDFInvalidObject(`+this.data.length+` bytes)`},t.prototype.sizeInBytes=function(){return this.data.length},t.prototype.copyBytesInto=function(e,t){for(var n=this.data.length,r=0;r<n;r++)e[t++]=this.data[r];return n},t.of=function(e){return new t(e)},t}(t_),R_;(function(e){e[e.Deleted=0]=`Deleted`,e[e.Uncompressed=1]=`Uncompressed`,e[e.Compressed=2]=`Compressed`})(R_||={});var z_=function(e){J(t,e);function t(t,n,r){r===void 0&&(r=!0);var i=e.call(this,t,r)||this;return i.computeIndex=function(){for(var e=[],t=0,n=0,r=i.entries.length;n<r;n++){var a=i.entries[n],o=i.entries[n-1];n===0?e.push(a.ref.objectNumber):a.ref.objectNumber-o.ref.objectNumber>1&&(e.push(t),e.push(a.ref.objectNumber),t=0),t+=1}return e.push(t),e},i.computeEntryTuples=function(){for(var e=Array(i.entries.length),t=0,n=i.entries.length;t<n;t++){var r=i.entries[t];if(r.type===R_.Deleted){var a=r.type,o=r.nextFreeObjectNumber,s=r.ref;e[t]=[a,o,s.generationNumber]}if(r.type===R_.Uncompressed){var a=r.type,c=r.offset,s=r.ref;e[t]=[a,c,s.generationNumber]}if(r.type===R_.Compressed){var a=r.type,l=r.objectStreamRef,u=r.index;e[t]=[a,l.objectNumber,u]}}return e},i.computeMaxEntryByteWidths=function(){for(var e=i.entryTuplesCache.access(),t=[0,0,0],n=0,r=e.length;n<r;n++){var a=e[n],o=a[0],s=a[1],c=a[2],l=Sh(o),u=Sh(s),d=Sh(c);l>t[0]&&(t[0]=l),u>t[1]&&(t[1]=u),d>t[2]&&(t[2]=d)}return t},i.entries=n||[],i.entryTuplesCache=Tg.populatedBy(i.computeEntryTuples),i.maxByteWidthsCache=Tg.populatedBy(i.computeMaxEntryByteWidths),i.indexCache=Tg.populatedBy(i.computeIndex),t.set(Q.of(`Type`),Q.of(`XRef`)),i}return t.prototype.addDeletedEntry=function(e,t){var n=R_.Deleted;this.entries.push({type:n,ref:e,nextFreeObjectNumber:t}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.addUncompressedEntry=function(e,t){var n=R_.Uncompressed;this.entries.push({type:n,ref:e,offset:t}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.addCompressedEntry=function(e,t,n){var r=R_.Compressed;this.entries.push({type:r,ref:e,objectStreamRef:t,index:n}),this.entryTuplesCache.invalidate(),this.maxByteWidthsCache.invalidate(),this.indexCache.invalidate(),this.contentsCache.invalidate()},t.prototype.clone=function(e){var n=this,r=n.dict,i=n.entries,a=n.encode;return t.of(r.clone(e),i.slice(),a)},t.prototype.getContentsString=function(){for(var e=this.entryTuplesCache.access(),t=this.maxByteWidthsCache.access(),n=``,r=0,i=e.length;r<i;r++){for(var a=e[r],o=a[0],s=a[1],c=a[2],l=$m(Ch(o)),u=$m(Ch(s)),d=$m(Ch(c)),f=t[0]-1;f>=0;f--)n+=(l[f]||0).toString(2);for(var f=t[1]-1;f>=0;f--)n+=(u[f]||0).toString(2);for(var f=t[2]-1;f>=0;f--)n+=(d[f]||0).toString(2)}return n},t.prototype.getUnencodedContents=function(){for(var e=this.entryTuplesCache.access(),t=this.maxByteWidthsCache.access(),n=new Uint8Array(this.getUnencodedContentsSize()),r=0,i=0,a=e.length;i<a;i++){for(var o=e[i],s=o[0],c=o[1],l=o[2],u=$m(Ch(s)),d=$m(Ch(c)),f=$m(Ch(l)),p=t[0]-1;p>=0;p--)n[r++]=u[p]||0;for(var p=t[1]-1;p>=0;p--)n[r++]=d[p]||0;for(var p=t[2]-1;p>=0;p--)n[r++]=f[p]||0}return n},t.prototype.getUnencodedContentsSize=function(){return eh(this.maxByteWidthsCache.access())*this.entries.length},t.prototype.updateDict=function(){e.prototype.updateDict.call(this);var t=this.maxByteWidthsCache.access(),n=this.indexCache.access(),r=this.dict.context;this.dict.set(Q.of(`W`),r.obj(t)),this.dict.set(Q.of(`Index`),r.obj(n))},t.create=function(e,n){n===void 0&&(n=!0);var r=new t(e,[],n);return r.addDeletedEntry(x_.of(0,65535),0),r},t.of=function(e,n,r){return r===void 0&&(r=!0),new t(e,n,r)},t}(T_),B_=function(e){J(t,e);function t(t,n,r,i){var a=e.call(this,t,n)||this;return a.encodeStreams=r,a.objectsPerStream=i,a}return t.prototype.computeBufferSize=function(){return hm(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,c,l,m,d,g,_,v,y;return gm(this,function(b){switch(b.label){case 0:e=this.context.largestObjectNumber+1,t=e_.forVersion(1,7),n=t.sizeInBytes()+2,r=z_.create(this.createTrailerDict(),this.encodeStreams),i=[],a=[],o=[],s=this.context.enumerateIndirectObjects(),c=0,l=s.length,b.label=1;case 1:return c<l?(u=s[c],d=u[0],f=u[1],p=d===this.context.trailerInfo.Encrypt||f instanceof __||f instanceof L_||d.generationNumber!==0,p?(i.push(u),r.addUncompressedEntry(d,n),n+=this.computeIndirectObjectSize(u),this.shouldWaitForTick(1)?[4,ah()]:[3,3]):[3,4]):[3,6];case 2:b.sent(),b.label=3;case 3:return[3,5];case 4:m=Km(a),h=Km(o),(!m||m.length%this.objectsPerStream===0)&&(m=[],a.push(m),h=x_.of(e++),o.push(h)),r.addCompressedEntry(d,h,m.length),m.push(u),b.label=5;case 5:return c++,[3,1];case 6:c=0,l=a.length,b.label=7;case 7:return c<l?(m=a[c],d=o[c],g=F_.withContextAndObjects(this.context,m,this.encodeStreams),r.addUncompressedEntry(d,n),n+=this.computeIndirectObjectSize([d,g]),i.push([d,g]),this.shouldWaitForTick(m.length)?[4,ah()]:[3,9]):[3,10];case 8:b.sent(),b.label=9;case 9:return c++,[3,7];case 10:return _=x_.of(e++),r.dict.set(Q.of(`Size`),n_.of(e)),r.addUncompressedEntry(_,n),v=n,n+=this.computeIndirectObjectSize([_,r]),i.push([_,r]),y=N_.forLastCrossRefSectionOffset(v),n+=y.sizeInBytes(),[2,{size:n,header:t,indirectObjects:i,trailer:y}]}})})},t.forContext=function(e,n,r,i){return r===void 0&&(r=!0),i===void 0&&(i=50),new t(e,n,r,i)},t}(I_),V_=function(e){J(t,e);function t(t){var n=e.call(this)||this;return n.value=t,n}return t.prototype.asBytes=function(){for(var e=this.value+(this.value.length%2==1?`0`:``),t=e.length,n=new Uint8Array(e.length/2),r=0,i=0;r<t;)n[i]=parseInt(e.substring(r,r+2),16),r+=2,i+=1;return n},t.prototype.decodeText=function(){var e=this.asBytes();return bh(e)?ph(e):wg(e)},t.prototype.decodeDate=function(){var e=this.decodeText(),t=Wm(e);if(!t)throw new Fg(e);return t},t.prototype.asString=function(){return this.value},t.prototype.clone=function(){return t.of(this.value)},t.prototype.toString=function(){return`<`+this.value+`>`},t.prototype.sizeInBytes=function(){return this.value.length+2},t.prototype.copyBytesInto=function(e,t){return e[t++]=Z.LessThan,t+=Mm(this.value,e,t),e[t++]=Z.GreaterThan,this.value.length+2},t.of=function(e){return new t(e)},t.fromText=function(e){for(var n=oh(e),r=``,i=0,a=n.length;i<a;i++)r+=Dm(n[i],4);return new t(r)},t}(t_),H_=function(){function e(e,t){this.encoding=e===Yh.ZapfDingbats?tg.ZapfDingbats:e===Yh.Symbol?tg.Symbol:tg.WinAnsi,this.font=Zh.load(e),this.fontName=this.font.FontName,this.customName=t}return e.prototype.encodeText=function(e){for(var t=this.encodeTextAsGlyphs(e),n=Array(t.length),r=0,i=t.length;r<i;r++)n[r]=Om(t[r].code);return V_.of(n.join(``))},e.prototype.widthOfTextAtSize=function(e,t){for(var n=this.encodeTextAsGlyphs(e),r=0,i=0,a=n.length;i<a;i++){var o=n[i].name,s=(n[i+1]||{}).name,c=this.font.getXAxisKerningForPair(o,s)||0;r+=this.widthOfGlyph(o)+c}var l=t/1e3;return r*l},e.prototype.heightOfFontAtSize=function(e,t){t===void 0&&(t={});var n=t.descender,r=n===void 0?!0:n,i=this.font,a=i.Ascender,o=i.Descender,s=i.FontBBox,c=(a||s[3])-(o||s[1]);return r||(c+=o||0),c/1e3*e},e.prototype.sizeOfFontAtHeight=function(e){var t=this.font,n=t.Ascender,r=t.Descender,i=t.FontBBox,a=n||i[3],o=r||i[1];return 1e3*e/(a-o)},e.prototype.embedIntoContext=function(e,t){var n=e.obj({Type:`Font`,Subtype:`Type1`,BaseFont:this.customName||this.fontName,Encoding:this.encoding===tg.WinAnsi?`WinAnsiEncoding`:void 0});return t?(e.assign(t,n),t):e.register(n)},e.prototype.widthOfGlyph=function(e){return this.font.getWidthOfGlyph(e)||250},e.prototype.encodeTextAsGlyphs=function(e){for(var t=Array.from(e),n=Array(t.length),r=0,i=t.length;r<i;r++){var a=Em(t[r]);n[r]=this.encoding.encodeUnicodeCodePoint(a)}return n},e.for=function(t,n){return new e(t,n)},e}(),U_=function(e,t){for(var n=Array(e.length),r=0,i=e.length;r<i;r++){var a=e[r];n[r]=[G_(K_(t(a))),G_.apply(void 0,a.codePoints.map(q_))]}return W_(n)},W_=function(e){return`/CIDInit /ProcSet findresource begin
|
|
57
|
+
12 dict begin
|
|
58
|
+
begincmap
|
|
59
|
+
/CIDSystemInfo <<
|
|
60
|
+
/Registry (Adobe)
|
|
61
|
+
/Ordering (UCS)
|
|
62
|
+
/Supplement 0
|
|
63
|
+
>> def
|
|
64
|
+
/CMapName /Adobe-Identity-UCS def
|
|
65
|
+
/CMapType 2 def
|
|
66
|
+
1 begincodespacerange
|
|
67
|
+
<0000><ffff>
|
|
68
|
+
endcodespacerange
|
|
69
|
+
`+e.length+` beginbfchar
|
|
70
|
+
`+e.map(function(e){var t=e[0],n=e[1];return t+` `+n}).join(`
|
|
71
|
+
`)+`
|
|
72
|
+
endbfchar
|
|
73
|
+
endcmap
|
|
74
|
+
CMapName currentdict /CMap defineresource pop
|
|
75
|
+
end
|
|
76
|
+
end`},G_=function(){return`<`+[...arguments].join(``)+`>`},K_=function(e){return Dm(e,4)},q_=function(e){if(sh(e))return K_(e);if(ch(e)){var t=lh(e),n=uh(e);return``+K_(t)+K_(n)}var r=`0x`+Om(e)+` is not a valid UTF-8 or UTF-16 codepoint.`;throw Error(r)},J_=function(e){var t=0,n=function(e){t|=1<<e-1};return e.fixedPitch&&n(1),e.serif&&n(2),e.symbolic&&n(3),e.script&&n(4),e.nonsymbolic&&n(6),e.italic&&n(7),e.allCap&&n(17),e.smallCap&&n(18),e.forceBold&&n(19),t},Y_=function(e){var t=e[`OS/2`]?e[`OS/2`].sFamilyClass:0;return J_({fixedPitch:e.post.isFixedPitch,serif:1<=t&&t<=7,symbolic:!0,script:t===10,italic:e.head.macStyle.italic})},X_=function(e){J(t,e);function t(t){var n=e.call(this)||this;return n.value=t,n}return t.prototype.asBytes=function(){for(var e=[],t=``,n=!1,r=function(t){t!==void 0&&e.push(t),n=!1},i=0,a=this.value.length;i<a;i++){var o=this.value[i],s=Tm(o),c=this.value[i+1];n?s===Z.Newline||s===Z.CarriageReturn?r():s===Z.n?r(Z.Newline):s===Z.r?r(Z.CarriageReturn):s===Z.t?r(Z.Tab):s===Z.b?r(Z.Backspace):s===Z.f?r(Z.FormFeed):s===Z.LeftParen?r(Z.LeftParen):s===Z.RightParen?r(Z.RightParen):s===Z.Backspace?r(Z.BackSlash):s>=Z.Zero&&s<=Z.Seven?(t+=o,(t.length===3||!(c>=`0`&&c<=`7`))&&(r(parseInt(t,8)),t=``)):r(s):s===Z.BackSlash?n=!0:r(s)}return new Uint8Array(e)},t.prototype.decodeText=function(){var e=this.asBytes();return bh(e)?ph(e):wg(e)},t.prototype.decodeDate=function(){var e=this.decodeText(),t=Wm(e);if(!t)throw new Fg(e);return t},t.prototype.asString=function(){return this.value},t.prototype.clone=function(){return t.of(this.value)},t.prototype.toString=function(){return`(`+this.value+`)`},t.prototype.sizeInBytes=function(){return this.value.length+2},t.prototype.copyBytesInto=function(e,t){return e[t++]=Z.LeftParen,t+=Mm(this.value,e,t),e[t++]=Z.RightParen,this.value.length+2},t.of=function(e){return new t(e)},t.fromDate=function(e){var n=jm(String(e.getUTCFullYear()),4,`0`),r=jm(String(e.getUTCMonth()+1),2,`0`),i=jm(String(e.getUTCDate()),2,`0`),a=jm(String(e.getUTCHours()),2,`0`),o=jm(String(e.getUTCMinutes()),2,`0`),s=jm(String(e.getUTCSeconds()),2,`0`);return new t(`D:`+n+r+i+a+o+s+`Z`)},t}(t_),Z_=function(){function e(e,t,n,r){var i=this;this.allGlyphsInFontSortedById=function(){for(var e=Array(i.font.characterSet.length),t=0,n=e.length;t<n;t++){var r=i.font.characterSet[t];e[t]=i.font.glyphForCodePoint(r)}return Qm(e.sort(Zm),function(e){return e.id})},this.font=e,this.scale=1e3/this.font.unitsPerEm,this.fontData=t,this.fontName=this.font.postscriptName||`Font`,this.customName=n,this.fontFeatures=r,this.baseFontName=``,this.glyphCache=Tg.populatedBy(this.allGlyphsInFontSortedById)}return e.for=function(t,n,r,i){return hm(this,void 0,void 0,function(){var a;return gm(this,function(o){switch(o.label){case 0:return[4,t.create(n)];case 1:return a=o.sent(),[2,new e(a,n,r,i)]}})})},e.prototype.encodeText=function(e){for(var t=this.font.layout(e,this.fontFeatures).glyphs,n=Array(t.length),r=0,i=t.length;r<i;r++)n[r]=Dm(t[r].id,4);return V_.of(n.join(``))},e.prototype.widthOfTextAtSize=function(e,t){for(var n=this.font.layout(e,this.fontFeatures).glyphs,r=0,i=0,a=n.length;i<a;i++)r+=n[i].advanceWidth*this.scale;var o=t/1e3;return r*o},e.prototype.heightOfFontAtSize=function(e,t){t===void 0&&(t={});var n=t.descender,r=n===void 0?!0:n,i=this.font,a=i.ascent,o=i.descent,s=i.bbox,c=(a||s.maxY)*this.scale-(o||s.minY)*this.scale;return r||(c-=Math.abs(o)||0),c/1e3*e},e.prototype.sizeOfFontAtHeight=function(e){var t=this.font,n=t.ascent,r=t.descent,i=t.bbox,a=(n||i.maxY)*this.scale,o=(r||i.minY)*this.scale;return 1e3*e/(a-o)},e.prototype.embedIntoContext=function(e,t){return this.baseFontName=this.customName||e.addRandomSuffix(this.fontName),this.embedFontDict(e,t)},e.prototype.embedFontDict=function(e,t){return hm(this,void 0,void 0,function(){var n,r,i;return gm(this,function(a){switch(a.label){case 0:return[4,this.embedCIDFontDict(e)];case 1:return n=a.sent(),r=this.embedUnicodeCmap(e),i=e.obj({Type:`Font`,Subtype:`Type0`,BaseFont:this.baseFontName,Encoding:`Identity-H`,DescendantFonts:[n],ToUnicode:r}),t?(e.assign(t,i),[2,t]):[2,e.register(i)]}})})},e.prototype.isCFF=function(){return this.font.cff},e.prototype.embedCIDFontDict=function(e){return hm(this,void 0,void 0,function(){var t,n;return gm(this,function(r){switch(r.label){case 0:return[4,this.embedFontDescriptor(e)];case 1:return t=r.sent(),n=e.obj({Type:`Font`,Subtype:this.isCFF()?`CIDFontType0`:`CIDFontType2`,CIDToGIDMap:`Identity`,BaseFont:this.baseFontName,CIDSystemInfo:{Registry:X_.of(`Adobe`),Ordering:X_.of(`Identity`),Supplement:0},FontDescriptor:t,W:this.computeWidths()}),[2,e.register(n)]}})})},e.prototype.embedFontDescriptor=function(e){return hm(this,void 0,void 0,function(){var t,n,r,i,a,o,s,c,l,u,d,f,p,m,h;return gm(this,function(g){switch(g.label){case 0:return[4,this.embedFontStream(e)];case 1:return t=g.sent(),n=this.scale,r=this.font,i=r.italicAngle,a=r.ascent,o=r.descent,s=r.capHeight,c=r.xHeight,l=this.font.bbox,u=l.minX,d=l.minY,f=l.maxX,p=l.maxY,m=e.obj((h={Type:`FontDescriptor`,FontName:this.baseFontName,Flags:Y_(this.font),FontBBox:[u*n,d*n,f*n,p*n],ItalicAngle:i,Ascent:a*n,Descent:o*n,CapHeight:(s||a)*n,XHeight:(c||0)*n,StemV:0},h[this.isCFF()?`FontFile3`:`FontFile2`]=t,h)),[2,e.register(m)]}})})},e.prototype.serializeFont=function(){return hm(this,void 0,void 0,function(){return gm(this,function(e){return[2,this.fontData]})})},e.prototype.embedFontStream=function(e){return hm(this,void 0,void 0,function(){var t,n,r;return gm(this,function(i){switch(i.label){case 0:return r=(n=e).flateStream,[4,this.serializeFont()];case 1:return t=r.apply(n,[i.sent(),{Subtype:this.isCFF()?`CIDFontType0C`:void 0}]),[2,e.register(t)]}})})},e.prototype.embedUnicodeCmap=function(e){var t=U_(this.glyphCache.access(),this.glyphId.bind(this)),n=e.flateStream(t);return e.register(n)},e.prototype.glyphId=function(e){return e?e.id:-1},e.prototype.computeWidths=function(){for(var e=this.glyphCache.access(),t=[],n=[],r=0,i=e.length;r<i;r++){var a=e[r],o=e[r-1],s=this.glyphId(a),c=this.glyphId(o);r===0?t.push(s):s-c!==1&&(t.push(n),t.push(s),n=[]),n.push(a.advanceWidth*this.scale)}return t.push(n),t},e}(),Q_=function(e){J(t,e);function t(t,n,r,i){var a=e.call(this,t,n,r,i)||this;return a.subset=a.font.createSubset(),a.glyphs=[],a.glyphCache=Tg.populatedBy(function(){return a.glyphs}),a.glyphIdMap=new Map,a}return t.for=function(e,n,r,i){return hm(this,void 0,void 0,function(){var a;return gm(this,function(o){switch(o.label){case 0:return[4,e.create(n)];case 1:return a=o.sent(),[2,new t(a,n,r,i)]}})})},t.prototype.encodeText=function(e){for(var t=this.font.layout(e,this.fontFeatures).glyphs,n=Array(t.length),r=0,i=t.length;r<i;r++){var a=t[r],o=this.subset.includeGlyph(a);this.glyphs[o-1]=a,this.glyphIdMap.set(a.id,o),n[r]=Dm(o,4)}return this.glyphCache.invalidate(),V_.of(n.join(``))},t.prototype.isCFF=function(){return this.subset.cff},t.prototype.glyphId=function(e){return e?this.glyphIdMap.get(e.id):-1},t.prototype.serializeFont=function(){var e=this;return new Promise(function(t,n){var r=[];e.subset.encodeStream().on(`data`,function(e){return r.push(e)}).on(`end`,function(){return t(Ym(r))}).on(`error`,function(e){return n(e)})})},t}(Z_),$_;(function(e){e.Source=`Source`,e.Data=`Data`,e.Alternative=`Alternative`,e.Supplement=`Supplement`,e.EncryptedPayload=`EncryptedPayload`,e.FormData=`EncryptedPayload`,e.Schema=`Schema`,e.Unspecified=`Unspecified`})($_||={});var ev=function(){function e(e,t,n){n===void 0&&(n={}),this.fileData=e,this.fileName=t,this.options=n}return e.for=function(t,n,r){return r===void 0&&(r={}),new e(t,n,r)},e.prototype.embedIntoContext=function(e,t){return hm(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u;return gm(this,function(d){return n=this.options,r=n.mimeType,i=n.description,a=n.creationDate,o=n.modificationDate,s=n.afRelationship,c=e.flateStream(this.fileData,{Type:`EmbeddedFile`,Subtype:r??void 0,Params:{Size:this.fileData.length,CreationDate:a?X_.fromDate(a):void 0,ModDate:o?X_.fromDate(o):void 0}}),l=e.register(c),u=e.obj({Type:`Filespec`,F:X_.of(this.fileName),UF:V_.fromText(this.fileName),EF:{F:l},Desc:i?V_.fromText(i):void 0,AFRelationship:s??void 0}),t?(e.assign(t,u),[2,t]):[2,e.register(u)]})})},e}(),tv=[65472,65473,65474,65475,65477,65478,65479,65480,65481,65482,65483,65484,65485,65486,65487],nv;(function(e){e.DeviceGray=`DeviceGray`,e.DeviceRGB=`DeviceRGB`,e.DeviceCMYK=`DeviceCMYK`})(nv||={});var rv={1:nv.DeviceGray,3:nv.DeviceRGB,4:nv.DeviceCMYK},iv=function(){function e(e,t,n,r,i){this.imageData=e,this.bitsPerComponent=t,this.width=n,this.height=r,this.colorSpace=i}return e.for=function(t){return hm(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d;return gm(this,function(f){if(n=new DataView(t.buffer),r=n.getUint16(0),r!==65496)throw Error(`SOI not found in JPEG`);for(i=2;i<n.byteLength&&(a=n.getUint16(i),i+=2,!tv.includes(a));)i+=n.getUint16(i);if(!tv.includes(a))throw Error(`Invalid JPEG`);if(i+=2,o=n.getUint8(i++),s=n.getUint16(i),i+=2,c=n.getUint16(i),i+=2,l=n.getUint8(i++),u=rv[l],!u)throw Error(`Unknown JPEG channel.`);return d=u,[2,new e(t,o,c,s,d)]})})},e.prototype.embedIntoContext=function(e,t){return hm(this,void 0,void 0,function(){var n;return gm(this,function(r){return n=e.stream(this.imageData,{Type:`XObject`,Subtype:`Image`,BitsPerComponent:this.bitsPerComponent,Width:this.width,Height:this.height,ColorSpace:this.colorSpace,Filter:`DCTDecode`,Decode:this.colorSpace===nv.DeviceCMYK?[1,0,1,0,1,0,1,0]:void 0}),t?(e.assign(t,n),[2,t]):[2,e.register(n)]})})},e}(),$={};$.toRGBA8=function(e){var t=e.width,n=e.height;if(e.tabs.acTL==null)return[$.toRGBA8.decodeImage(e.data,t,n,e).buffer];var r=[];e.frames[0].data??(e.frames[0].data=e.data);for(var i=t*n*4,a=new Uint8Array(i),o=new Uint8Array(i),s=new Uint8Array(i),c=0;c<e.frames.length;c++){var l=e.frames[c],u=l.rect.x,d=l.rect.y,f=l.rect.width,p=l.rect.height,m=$.toRGBA8.decodeImage(l.data,f,p,e);if(c!=0)for(var h=0;h<i;h++)s[h]=a[h];if(l.blend==0?$._copyTile(m,f,p,a,t,n,u,d,0):l.blend==1&&$._copyTile(m,f,p,a,t,n,u,d,1),r.push(a.buffer.slice(0)),l.dispose!=0){if(l.dispose==1)$._copyTile(o,f,p,a,t,n,u,d,0);else if(l.dispose==2)for(var h=0;h<i;h++)a[h]=s[h]}}return r},$.toRGBA8.decodeImage=function(e,t,n,r){var i=t*n,a=$.decode._getBPP(r),o=Math.ceil(t*a/8),s=new Uint8Array(i*4),c=new Uint32Array(s.buffer),l=r.ctype,u=r.depth,d=$._bin.readUshort;if(l==6){var f=i<<2;if(u==8)for(var p=0;p<f;p+=4)s[p]=e[p],s[p+1]=e[p+1],s[p+2]=e[p+2],s[p+3]=e[p+3];if(u==16)for(var p=0;p<f;p++)s[p]=e[p<<1]}else if(l==2){var m=r.tabs.tRNS;if(m==null){if(u==8)for(var p=0;p<i;p++){var h=p*3;c[p]=255<<24|e[h+2]<<16|e[h+1]<<8|e[h]}if(u==16)for(var p=0;p<i;p++){var h=p*6;c[p]=255<<24|e[h+4]<<16|e[h+2]<<8|e[h]}}else{var g=m[0],_=m[1],v=m[2];if(u==8)for(var p=0;p<i;p++){var y=p<<2,h=p*3;c[p]=255<<24|e[h+2]<<16|e[h+1]<<8|e[h],e[h]==g&&e[h+1]==_&&e[h+2]==v&&(s[y+3]=0)}if(u==16)for(var p=0;p<i;p++){var y=p<<2,h=p*6;c[p]=255<<24|e[h+4]<<16|e[h+2]<<8|e[h],d(e,h)==g&&d(e,h+2)==_&&d(e,h+4)==v&&(s[y+3]=0)}}}else if(l==3){var b=r.tabs.PLTE,x=r.tabs.tRNS,S=x?x.length:0;if(u==1)for(var C=0;C<n;C++)for(var w=C*o,T=C*t,p=0;p<t;p++){var y=T+p<<2,E=e[w+(p>>3)]>>7-((p&7)<<0)&1,D=3*E;s[y]=b[D],s[y+1]=b[D+1],s[y+2]=b[D+2],s[y+3]=E<S?x[E]:255}if(u==2)for(var C=0;C<n;C++)for(var w=C*o,T=C*t,p=0;p<t;p++){var y=T+p<<2,E=e[w+(p>>2)]>>6-((p&3)<<1)&3,D=3*E;s[y]=b[D],s[y+1]=b[D+1],s[y+2]=b[D+2],s[y+3]=E<S?x[E]:255}if(u==4)for(var C=0;C<n;C++)for(var w=C*o,T=C*t,p=0;p<t;p++){var y=T+p<<2,E=e[w+(p>>1)]>>4-((p&1)<<2)&15,D=3*E;s[y]=b[D],s[y+1]=b[D+1],s[y+2]=b[D+2],s[y+3]=E<S?x[E]:255}if(u==8)for(var p=0;p<i;p++){var y=p<<2,E=e[p],D=3*E;s[y]=b[D],s[y+1]=b[D+1],s[y+2]=b[D+2],s[y+3]=E<S?x[E]:255}}else if(l==4){if(u==8)for(var p=0;p<i;p++){var y=p<<2,O=p<<1,k=e[O];s[y]=k,s[y+1]=k,s[y+2]=k,s[y+3]=e[O+1]}if(u==16)for(var p=0;p<i;p++){var y=p<<2,O=p<<2,k=e[O];s[y]=k,s[y+1]=k,s[y+2]=k,s[y+3]=e[O+2]}}else if(l==0)for(var g=r.tabs.tRNS?r.tabs.tRNS:-1,C=0;C<n;C++){var A=C*o,j=C*t;if(u==1)for(var M=0;M<t;M++){var k=255*(e[A+(M>>>3)]>>>7-(M&7)&1),N=k==g*255?0:255;c[j+M]=N<<24|k<<16|k<<8|k}else if(u==2)for(var M=0;M<t;M++){var k=85*(e[A+(M>>>2)]>>>6-((M&3)<<1)&3),N=k==g*85?0:255;c[j+M]=N<<24|k<<16|k<<8|k}else if(u==4)for(var M=0;M<t;M++){var k=17*(e[A+(M>>>1)]>>>4-((M&1)<<2)&15),N=k==g*17?0:255;c[j+M]=N<<24|k<<16|k<<8|k}else if(u==8)for(var M=0;M<t;M++){var k=e[A+M],N=k==g?0:255;c[j+M]=N<<24|k<<16|k<<8|k}else if(u==16)for(var M=0;M<t;M++){var k=e[A+(M<<1)],N=d(e,A+(M<<p))==g?0:255;c[j+M]=N<<24|k<<16|k<<8|k}}return s},$.decode=function(e){for(var t=new Uint8Array(e),n=8,r=$._bin,i=r.readUshort,a=r.readUint,o={tabs:{},frames:[]},s=new Uint8Array(t.length),c=0,l,u=0,d=[137,80,78,71,13,10,26,10],f=0;f<8;f++)if(t[f]!=d[f])throw`The input is not a PNG file!`;for(;n<t.length;){var p=r.readUint(t,n);n+=4;var m=r.readASCII(t,n,4);if(n+=4,m==`IHDR`)$.decode._IHDR(t,n,o);else if(m==`IDAT`){for(var f=0;f<p;f++)s[c+f]=t[n+f];c+=p}else if(m==`acTL`)o.tabs[m]={num_frames:a(t,n),num_plays:a(t,n+4)},l=new Uint8Array(t.length);else if(m==`fcTL`){if(u!=0){var h=o.frames[o.frames.length-1];h.data=$.decode._decompress(o,l.slice(0,u),h.rect.width,h.rect.height),u=0}var g={x:a(t,n+12),y:a(t,n+16),width:a(t,n+4),height:a(t,n+8)},_=i(t,n+22);_=i(t,n+20)/(_==0?100:_);var v={rect:g,delay:Math.round(_*1e3),dispose:t[n+24],blend:t[n+25]};o.frames.push(v)}else if(m==`fdAT`){for(var f=0;f<p-4;f++)l[u+f]=t[n+f+4];u+=p-4}else if(m==`pHYs`)o.tabs[m]=[r.readUint(t,n),r.readUint(t,n+4),t[n+8]];else if(m==`cHRM`){o.tabs[m]=[];for(var f=0;f<8;f++)o.tabs[m].push(r.readUint(t,n+f*4))}else if(m==`tEXt`){o.tabs[m]??(o.tabs[m]={});var y=r.nextZero(t,n),b=r.readASCII(t,n,y-n),x=r.readASCII(t,y+1,n+p-y-1);o.tabs[m][b]=x}else if(m==`iTXt`){o.tabs[m]??(o.tabs[m]={});var y=0,S=n;y=r.nextZero(t,S);var b=r.readASCII(t,S,y-S);S=y+1,t[S],t[S+1],S+=2,y=r.nextZero(t,S),r.readASCII(t,S,y-S),S=y+1,y=r.nextZero(t,S),r.readUTF8(t,S,y-S),S=y+1;var x=r.readUTF8(t,S,p-(S-n));o.tabs[m][b]=x}else if(m==`PLTE`)o.tabs[m]=r.readBytes(t,n,p);else if(m==`hIST`){var C=o.tabs.PLTE.length/3;o.tabs[m]=[];for(var f=0;f<C;f++)o.tabs[m].push(i(t,n+f*2))}else if(m==`tRNS`)o.ctype==3?o.tabs[m]=r.readBytes(t,n,p):o.ctype==0?o.tabs[m]=i(t,n):o.ctype==2&&(o.tabs[m]=[i(t,n),i(t,n+2),i(t,n+4)]);else if(m==`gAMA`)o.tabs[m]=r.readUint(t,n)/1e5;else if(m==`sRGB`)o.tabs[m]=t[n];else if(m==`bKGD`)o.ctype==0||o.ctype==4?o.tabs[m]=[i(t,n)]:o.ctype==2||o.ctype==6?o.tabs[m]=[i(t,n),i(t,n+2),i(t,n+4)]:o.ctype==3&&(o.tabs[m]=t[n]);else if(m==`IEND`)break;n+=p,r.readUint(t,n),n+=4}if(u!=0){var h=o.frames[o.frames.length-1];h.data=$.decode._decompress(o,l.slice(0,u),h.rect.width,h.rect.height),u=0}return o.data=$.decode._decompress(o,s,o.width,o.height),delete o.compress,delete o.interlace,delete o.filter,o},$.decode._decompress=function(e,t,n,r){var i=$.decode._getBPP(e),a=Math.ceil(n*i/8),o=new Uint8Array((a+1+e.interlace)*r);return t=$.decode._inflate(t,o),e.interlace==0?t=$.decode._filterZero(t,e,0,n,r):e.interlace==1&&(t=$.decode._readInterlace(t,e)),t},$.decode._inflate=function(e,t){return $.inflateRaw(new Uint8Array(e.buffer,2,e.length-6),t)},$.inflateRaw=function(){var e={};return e.H={},e.H.N=function(t,n){var r=Uint8Array,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p,m;if(t[0]==3&&t[1]==0)return n||new r(0);var h=e.H,g=h.b,_=h.e,v=h.R,y=h.n,b=h.A,x=h.Z,S=h.m,C=n==null;for(C&&(n=new r(t.length>>>2<<3));i==0;){if(i=g(t,f,1),a=g(t,f+1,2),f+=3,a==0){f&7&&(f+=8-(f&7));var w=(f>>>3)+4,T=t[w-4]|t[w-3]<<8;C&&(n=e.H.W(n,d+T)),n.set(new r(t.buffer,t.byteOffset+w,T),d),f=w+T<<3,d+=T;continue}if(C&&(n=e.H.W(n,d+(1<<17))),a==1&&(p=S.J,m=S.h,l=511,u=31),a==2){o=_(t,f,5)+257,s=_(t,f+5,5)+1,c=_(t,f+10,4)+4,f+=14;for(var E=1,D=0;D<38;D+=2)S.Q[D]=0,S.Q[D+1]=0;for(var D=0;D<c;D++){var O=_(t,f+D*3,3);S.Q[(S.X[D]<<1)+1]=O,O>E&&(E=O)}f+=3*c,y(S.Q,E),b(S.Q,E,S.u),p=S.w,m=S.d,f=v(S.u,(1<<E)-1,o+s,t,f,S.v);var k=h.V(S.v,0,o,S.C);l=(1<<k)-1;var A=h.V(S.v,o,s,S.D);u=(1<<A)-1,y(S.C,k),b(S.C,k,p),y(S.D,A),b(S.D,A,m)}for(;;){var j=p[x(t,f)&l];f+=j&15;var M=j>>>4;if(!(M>>>8))n[d++]=M;else if(M==256)break;else{var N=d+M-254;if(M>264){var P=S.q[M-257];N=d+(P>>>3)+_(t,f,P&7),f+=P&7}var F=m[x(t,f)&u];f+=F&15;var I=F>>>4,L=S.c[I],R=(L>>>4)+g(t,f,L&15);for(f+=L&15;d<N;)n[d]=n[d++-R],n[d]=n[d++-R],n[d]=n[d++-R],n[d]=n[d++-R];d=N}}}return n.length==d?n:n.slice(0,d)},e.H.W=function(e,t){var n=e.length;if(t<=n)return e;var r=new Uint8Array(n<<1);return r.set(e,0),r},e.H.R=function(t,n,r,i,a,o){for(var s=e.H.e,c=e.H.Z,l=0;l<r;){var u=t[c(i,a)&n];a+=u&15;var d=u>>>4;if(d<=15)o[l]=d,l++;else{var f=0,p=0;d==16?(p=3+s(i,a,2),a+=2,f=o[l-1]):d==17?(p=3+s(i,a,3),a+=3):d==18&&(p=11+s(i,a,7),a+=7);for(var m=l+p;l<m;)o[l]=f,l++}}return a},e.H.V=function(e,t,n,r){for(var i=0,a=0,o=r.length>>>1;a<n;){var s=e[a+t];r[a<<1]=0,r[(a<<1)+1]=s,s>i&&(i=s),a++}for(;a<o;)r[a<<1]=0,r[(a<<1)+1]=0,a++;return i},e.H.n=function(t,n){for(var r=e.H.m,i=t.length,a,o,s,c,l,u=r.j,c=0;c<=n;c++)u[c]=0;for(c=1;c<i;c+=2)u[t[c]]++;var d=r.K;for(a=0,u[0]=0,o=1;o<=n;o++)a=a+u[o-1]<<1,d[o]=a;for(s=0;s<i;s+=2)l=t[s+1],l!=0&&(t[s]=d[l],d[l]++)},e.H.A=function(t,n,r){for(var i=t.length,a=e.H.m.r,o=0;o<i;o+=2)if(t[o+1]!=0)for(var s=o>>1,c=t[o+1],l=s<<4|c,u=n-c,d=t[o]<<u,f=d+(1<<u);d!=f;){var p=a[d]>>>15-n;r[p]=l,d++}},e.H.l=function(t,n){for(var r=e.H.m.r,i=15-n,a=0;a<t.length;a+=2)t[a]=r[t[a]<<n-t[a+1]]>>>i},e.H.M=function(e,t,n){n<<=t&7;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8},e.H.I=function(e,t,n){n<<=t&7;var r=t>>>3;e[r]|=n,e[r+1]|=n>>>8,e[r+2]|=n>>>16},e.H.e=function(e,t,n){return(e[t>>>3]|e[(t>>>3)+1]<<8)>>>(t&7)&(1<<n)-1},e.H.b=function(e,t,n){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)&(1<<n)-1},e.H.Z=function(e,t){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16)>>>(t&7)},e.H.i=function(e,t){return(e[t>>>3]|e[(t>>>3)+1]<<8|e[(t>>>3)+2]<<16|e[(t>>>3)+3]<<24)>>>(t&7)},e.H.m=function(){var 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(){for(var t=e.H.m,n=32768,r=0;r<n;r++){var i=r;i=(i&2863311530)>>>1|(i&1431655765)<<1,i=(i&3435973836)>>>2|(i&858993459)<<2,i=(i&4042322160)>>>4|(i&252645135)<<4,i=(i&4278255360)>>>8|(i&16711935)<<8,t.r[r]=(i>>>16|i<<16)>>>17}function a(e,t,n){for(;t--!=0;)e.push(0,n)}for(var 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];a(t._,144,8),a(t._,112,9),a(t._,24,7),a(t._,8,8),e.H.n(t._,9),e.H.A(t._,9,t.J),e.H.l(t._,9),a(t.$,32,5),e.H.n(t.$,5),e.H.A(t.$,5,t.h),e.H.l(t.$,5),a(t.Q,19,0),a(t.C,286,0),a(t.D,30,0),a(t.v,320,0)})(),e.H.N}(),$.decode._readInterlace=function(e,t){for(var n=t.width,r=t.height,i=$.decode._getBPP(t),a=i>>3,o=Math.ceil(n*i/8),s=new Uint8Array(r*o),c=0,l=[0,0,4,0,2,0,1],u=[0,4,0,2,0,1,0],d=[8,8,8,4,4,2,2],f=[8,8,4,4,2,2,1],p=0;p<7;){for(var m=d[p],h=f[p],g=0,_=0,v=l[p];v<r;)v+=m,_++;for(var y=u[p];y<n;)y+=h,g++;var b=Math.ceil(g*i/8);$.decode._filterZero(e,t,c,g,_);for(var x=0,S=l[p];S<r;){for(var C=u[p],w=c+x*b<<3;C<n;){if(i==1){var T=e[w>>3];T=T>>7-(w&7)&1,s[S*o+(C>>3)]|=T<<7-((C&7)<<0)}if(i==2){var T=e[w>>3];T=T>>6-(w&7)&3,s[S*o+(C>>2)]|=T<<6-((C&3)<<1)}if(i==4){var T=e[w>>3];T=T>>4-(w&7)&15,s[S*o+(C>>1)]|=T<<4-((C&1)<<2)}if(i>=8)for(var E=S*o+C*a,D=0;D<a;D++)s[E+D]=e[(w>>3)+D];w+=i,C+=h}x++,S+=m}g*_!=0&&(c+=_*(1+b)),p+=1}return s},$.decode._getBPP=function(e){return[1,null,3,1,2,null,4][e.ctype]*e.depth},$.decode._filterZero=function(e,t,n,r,i){var a=$.decode._getBPP(t),o=Math.ceil(r*a/8),s=$.decode._paeth;a=Math.ceil(a/8);var c=0,l=1,u=e[n],d=0;if(u>1&&(e[n]=[0,0,1][u-2]),u==3)for(d=a;d<o;d++)e[d+1]=e[d+1]+(e[d+1-a]>>>1)&255;for(var f=0;f<i;f++)if(c=n+f*o,l=c+f+1,u=e[l-1],d=0,u==0)for(;d<o;d++)e[c+d]=e[l+d];else if(u==1){for(;d<a;d++)e[c+d]=e[l+d];for(;d<o;d++)e[c+d]=e[l+d]+e[c+d-a]}else if(u==2)for(;d<o;d++)e[c+d]=e[l+d]+e[c+d-o];else if(u==3){for(;d<a;d++)e[c+d]=e[l+d]+(e[c+d-o]>>>1);for(;d<o;d++)e[c+d]=e[l+d]+(e[c+d-o]+e[c+d-a]>>>1)}else{for(;d<a;d++)e[c+d]=e[l+d]+s(0,e[c+d-o],0);for(;d<o;d++)e[c+d]=e[l+d]+s(e[c+d-a],e[c+d-o],e[c+d-a-o])}return e},$.decode._paeth=function(e,t,n){var r=e+t-n,i=r-e,a=r-t,o=r-n;return i*i<=a*a&&i*i<=o*o?e:a*a<=o*o?t:n},$.decode._IHDR=function(e,t,n){var r=$._bin;n.width=r.readUint(e,t),t+=4,n.height=r.readUint(e,t),t+=4,n.depth=e[t],t++,n.ctype=e[t],t++,n.compress=e[t],t++,n.filter=e[t],t++,n.interlace=e[t],t++},$._bin={nextZero:function(e,t){for(;e[t]!=0;)t++;return t},readUshort:function(e,t){return e[t]<<8|e[t+1]},writeUshort:function(e,t,n){e[t]=n>>8&255,e[t+1]=n&255},readUint:function(e,t){return e[t]*(256*256*256)+(e[t+1]<<16|e[t+2]<<8|e[t+3])},writeUint:function(e,t,n){e[t]=n>>24&255,e[t+1]=n>>16&255,e[t+2]=n>>8&255,e[t+3]=n&255},readASCII:function(e,t,n){for(var r=``,i=0;i<n;i++)r+=String.fromCharCode(e[t+i]);return r},writeASCII:function(e,t,n){for(var r=0;r<n.length;r++)e[t+r]=n.charCodeAt(r)},readBytes:function(e,t,n){for(var r=[],i=0;i<n;i++)r.push(e[t+i]);return r},pad:function(e){return e.length<2?`0`+e:e},readUTF8:function(e,t,n){for(var r=``,i,a=0;a<n;a++)r+=`%`+$._bin.pad(e[t+a].toString(16));try{i=decodeURIComponent(r)}catch{return $._bin.readASCII(e,t,n)}return i}},$._copyTile=function(e,t,n,r,i,a,o,s,c){for(var l=Math.min(t,i),u=Math.min(n,a),d=0,f=0,p=0;p<u;p++)for(var m=0;m<l;m++)if(o>=0&&s>=0?(d=p*t+m<<2,f=(s+p)*i+o+m<<2):(d=(-s+p)*t-o+m<<2,f=p*i+m<<2),c==0)r[f]=e[d],r[f+1]=e[d+1],r[f+2]=e[d+2],r[f+3]=e[d+3];else if(c==1){var h=e[d+3]*(1/255),g=e[d]*h,_=e[d+1]*h,v=e[d+2]*h,y=r[f+3]*(1/255),b=r[f]*y,x=r[f+1]*y,S=r[f+2]*y,C=1-h,w=h+y*C,T=w==0?0:1/w;r[f+3]=255*w,r[f+0]=(g+b*C)*T,r[f+1]=(_+x*C)*T,r[f+2]=(v+S*C)*T}else if(c==2){var h=e[d+3],g=e[d],_=e[d+1],v=e[d+2],y=r[f+3],b=r[f],x=r[f+1],S=r[f+2];h==y&&g==b&&_==x&&v==S?(r[f]=0,r[f+1]=0,r[f+2]=0,r[f+3]=0):(r[f]=g,r[f+1]=_,r[f+2]=v,r[f+3]=h)}else if(c==3){var h=e[d+3],g=e[d],_=e[d+1],v=e[d+2],y=r[f+3],b=r[f],x=r[f+1],S=r[f+2];if(h==y&&g==b&&_==x&&v==S)continue;if(h<220&&y>20)return!1}return!0},$.encode=function(e,t,n,r,i,a,o){r??=0,o??=!1;var s=$.encode.compress(e,t,n,r,[!1,!1,!1,0,o]);return $.encode.compressPNG(s,-1),$.encode._main(s,t,n,i,a)},$.encodeLL=function(e,t,n,r,i,a,o,s){for(var c={ctype:0+(r==1?0:2)+(i==0?0:4),depth:a,frames:[]},l=(r+i)*a,u=l*t,d=0;d<e.length;d++)c.frames.push({rect:{x:0,y:0,width:t,height:n},img:new Uint8Array(e[d]),blend:0,dispose:1,bpp:Math.ceil(l/8),bpl:Math.ceil(u/8)});return $.encode.compressPNG(c,0,!0),$.encode._main(c,t,n,o,s)},$.encode._main=function(e,t,n,r,i){i??={};var a=$.crc.crc,o=$._bin.writeUint,s=$._bin.writeUshort,c=$._bin.writeASCII,l=8,u=e.frames.length>1,d=!1,f=33+(u?20:0);if(i.sRGB!=null&&(f+=13),i.pHYs!=null&&(f+=21),e.ctype==3){for(var p=e.plte.length,m=0;m<p;m++)e.plte[m]>>>24!=255&&(d=!0);f+=8+p*3+4+(d?8+p*1+4:0)}for(var h=0;h<e.frames.length;h++){var g=e.frames[h];u&&(f+=38),f+=g.cimg.length+12,h!=0&&(f+=4)}f+=12;for(var _=new Uint8Array(f),v=[137,80,78,71,13,10,26,10],m=0;m<8;m++)_[m]=v[m];if(o(_,l,13),l+=4,c(_,l,`IHDR`),l+=4,o(_,l,t),l+=4,o(_,l,n),l+=4,_[l]=e.depth,l++,_[l]=e.ctype,l++,_[l]=0,l++,_[l]=0,l++,_[l]=0,l++,o(_,l,a(_,l-17,17)),l+=4,i.sRGB!=null&&(o(_,l,1),l+=4,c(_,l,`sRGB`),l+=4,_[l]=i.sRGB,l++,o(_,l,a(_,l-5,5)),l+=4),i.pHYs!=null&&(o(_,l,9),l+=4,c(_,l,`pHYs`),l+=4,o(_,l,i.pHYs[0]),l+=4,o(_,l,i.pHYs[1]),l+=4,_[l]=i.pHYs[2],l++,o(_,l,a(_,l-13,13)),l+=4),u&&(o(_,l,8),l+=4,c(_,l,`acTL`),l+=4,o(_,l,e.frames.length),l+=4,o(_,l,i.loop==null?0:i.loop),l+=4,o(_,l,a(_,l-12,12)),l+=4),e.ctype==3){var p=e.plte.length;o(_,l,p*3),l+=4,c(_,l,`PLTE`),l+=4;for(var m=0;m<p;m++){var y=m*3,b=e.plte[m],x=b&255,S=b>>>8&255,C=b>>>16&255;_[l+y+0]=x,_[l+y+1]=S,_[l+y+2]=C}if(l+=p*3,o(_,l,a(_,l-p*3-4,p*3+4)),l+=4,d){o(_,l,p),l+=4,c(_,l,`tRNS`),l+=4;for(var m=0;m<p;m++)_[l+m]=e.plte[m]>>>24&255;l+=p,o(_,l,a(_,l-p-4,p+4)),l+=4}}for(var w=0,h=0;h<e.frames.length;h++){var g=e.frames[h];u&&(o(_,l,26),l+=4,c(_,l,`fcTL`),l+=4,o(_,l,w++),l+=4,o(_,l,g.rect.width),l+=4,o(_,l,g.rect.height),l+=4,o(_,l,g.rect.x),l+=4,o(_,l,g.rect.y),l+=4,s(_,l,r[h]),l+=2,s(_,l,1e3),l+=2,_[l]=g.dispose,l++,_[l]=g.blend,l++,o(_,l,a(_,l-30,30)),l+=4);var T=g.cimg,p=T.length;o(_,l,p+(h==0?0:4)),l+=4;var E=l;c(_,l,h==0?`IDAT`:`fdAT`),l+=4,h!=0&&(o(_,l,w++),l+=4),_.set(T,l),l+=p,o(_,l,a(_,E,l-E)),l+=4}return o(_,l,0),l+=4,c(_,l,`IEND`),l+=4,o(_,l,a(_,l-4,4)),l+=4,_.buffer},$.encode.compressPNG=function(e,t,n){for(var r=0;r<e.frames.length;r++){var i=e.frames[r];i.rect.width;var a=i.rect.height,o=new Uint8Array(a*i.bpl+a);i.cimg=$.encode._filterZero(i.img,a,i.bpp,i.bpl,o,t,n)}},$.encode.compress=function(e,t,n,r,i){for(var a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=6,d=8,f=255,p=0;p<e.length;p++)for(var m=new Uint8Array(e[p]),h=m.length,g=0;g<h;g+=4)f&=m[g+3];var _=f!=255,v=$.encode.framize(e,t,n,a,o,s),y={},b=[],x=[];if(r!=0){for(var S=[],g=0;g<v.length;g++)S.push(v[g].img.buffer);for(var C=$.encode.concatRGBA(S),w=$.quantize(C,r),T=0,E=new Uint8Array(w.abuf),g=0;g<v.length;g++){var D=v[g].img,O=D.length;x.push(new Uint8Array(w.inds.buffer,T>>2,O>>2));for(var p=0;p<O;p+=4)D[p]=E[T+p],D[p+1]=E[T+p+1],D[p+2]=E[T+p+2],D[p+3]=E[T+p+3];T+=O}for(var g=0;g<w.plte.length;g++)b.push(w.plte[g].est.rgba)}else for(var p=0;p<v.length;p++){var k=v[p],A=new Uint32Array(k.img.buffer),j=k.rect.width,h=A.length,M=new Uint8Array(h);x.push(M);for(var g=0;g<h;g++){var N=A[g];if(g!=0&&N==A[g-1])M[g]=M[g-1];else if(g>j&&N==A[g-j])M[g]=M[g-j];else{var P=y[N];if(P==null&&(y[N]=P=b.length,b.push(N),b.length>=300))break;M[g]=P}}}var F=b.length;F<=256&&l==0&&(d=F<=2?1:F<=4?2:F<=16?4:8,d=Math.max(d,c));for(var p=0;p<v.length;p++){var k=v[p];k.rect.x,k.rect.y;var j=k.rect.width,I=k.rect.height,L=k.img;new Uint32Array(L.buffer);var R=4*j,ee=4;if(F<=256&&l==0){R=Math.ceil(d*j/8);for(var te=new Uint8Array(R*I),ne=x[p],re=0;re<I;re++){var g=re*R,z=re*j;if(d==8)for(var ie=0;ie<j;ie++)te[g+ie]=ne[z+ie];else if(d==4)for(var ie=0;ie<j;ie++)te[g+(ie>>1)]|=ne[z+ie]<<4-(ie&1)*4;else if(d==2)for(var ie=0;ie<j;ie++)te[g+(ie>>2)]|=ne[z+ie]<<6-(ie&3)*2;else if(d==1)for(var ie=0;ie<j;ie++)te[g+(ie>>3)]|=ne[z+ie]<<7-(ie&7)*1}L=te,u=3,ee=1}else if(_==0&&v.length==1){for(var te=new Uint8Array(j*I*3),ae=j*I,g=0;g<ae;g++){var D=g*3,oe=g*4;te[D]=L[oe],te[D+1]=L[oe+1],te[D+2]=L[oe+2]}L=te,u=2,ee=3,R=3*j}k.img=L,k.bpl=R,k.bpp=ee}return{ctype:u,depth:d,plte:b,frames:v}},$.encode.framize=function(e,t,n,r,i,a){for(var o=[],s=0;s<e.length;s++){var c=new Uint8Array(e[s]),l=new Uint32Array(c.buffer),u,d=0,f=0,p=t,m=n,h=+!!r;if(s!=0){for(var g=a||r||s==1||o[s-2].dispose!=0?1:2,_=0,v=1e9,y=0;y<g;y++){for(var b=new Uint8Array(e[s-1-y]),x=new Uint32Array(e[s-1-y]),S=t,C=n,w=-1,T=-1,E=0;E<n;E++)for(var D=0;D<t;D++){var O=E*t+D;l[O]!=x[O]&&(D<S&&(S=D),D>w&&(w=D),E<C&&(C=E),E>T&&(T=E))}w==-1&&(S=C=w=T=0),i&&((S&1)==1&&S--,(C&1)==1&&C--);var k=(w-S+1)*(T-C+1);k<v&&(v=k,_=y,d=S,f=C,p=w-S+1,m=T-C+1)}var b=new Uint8Array(e[s-1-_]);_==1&&(o[s-1].dispose=2),u=new Uint8Array(p*m*4),$._copyTile(b,t,n,u,p,m,-d,-f,0),h=+!!$._copyTile(c,t,n,u,p,m,-d,-f,3),h==1?$.encode._prepareDiff(c,t,n,u,{x:d,y:f,width:p,height:m}):$._copyTile(c,t,n,u,p,m,-d,-f,0)}else u=c.slice(0);o.push({rect:{x:d,y:f,width:p,height:m},img:u,blend:h,dispose:0})}if(r)for(var s=0;s<o.length;s++){var A=o[s];if(A.blend!=1){var j=A.rect,M=o[s-1].rect,N=Math.min(j.x,M.x),P=Math.min(j.y,M.y),F=Math.max(j.x+j.width,M.x+M.width),I=Math.max(j.y+j.height,M.y+M.height),L={x:N,y:P,width:F-N,height:I-P};o[s-1].dispose=1,s-1!=0&&$.encode._updateFrame(e,t,n,o,s-1,L,i),$.encode._updateFrame(e,t,n,o,s,L,i)}}var R=0;if(e.length!=1)for(var O=0;O<o.length;O++){var A=o[O];R+=A.rect.width*A.rect.height}return o},$.encode._updateFrame=function(e,t,n,r,i,a,o){for(var s=Uint8Array,c=Uint32Array,l=new s(e[i-1]),u=new c(e[i-1]),d=i+1<e.length?new s(e[i+1]):null,f=new s(e[i]),p=new c(f.buffer),m=t,h=n,g=-1,_=-1,v=0;v<a.height;v++)for(var y=0;y<a.width;y++){var b=a.x+y,x=a.y+v,S=x*t+b,C=p[S];C==0||r[i-1].dispose==0&&u[S]==C&&(d==null||d[S*4+3]!=0)||(b<m&&(m=b),b>g&&(g=b),x<h&&(h=x),x>_&&(_=x))}g==-1&&(m=h=g=_=0),o&&((m&1)==1&&m--,(h&1)==1&&h--),a={x:m,y:h,width:g-m+1,height:_-h+1};var w=r[i];w.rect=a,w.blend=1,w.img=new Uint8Array(a.width*a.height*4),r[i-1].dispose==0?($._copyTile(l,t,n,w.img,a.width,a.height,-a.x,-a.y,0),$.encode._prepareDiff(f,t,n,w.img,a)):$._copyTile(f,t,n,w.img,a.width,a.height,-a.x,-a.y,0)},$.encode._prepareDiff=function(e,t,n,r,i){$._copyTile(e,t,n,r,i.width,i.height,-i.x,-i.y,2)},$.encode._filterZero=function(e,t,n,r,i,a,o){var s=[],c=[0,1,2,3,4];a==-1?(t*r>5e5||n==1)&&(c=[0]):c=[a];var l;o&&(l={level:0});for(var u=o&&UZIP!=null?UZIP:Bh.default,d=0;d<c.length;d++){for(var f=0;f<t;f++)$.encode._filterLine(i,e,f,r,n,c[d]);s.push(u.deflate(i,l))}for(var p,m=1e9,d=0;d<s.length;d++)s[d].length<m&&(p=d,m=s[d].length);return s[p]},$.encode._filterLine=function(e,t,n,r,i,a){var o=n*r,s=o+n,c=$.decode._paeth;if(e[s]=a,s++,a==0)if(r<500)for(var l=0;l<r;l++)e[s+l]=t[o+l];else e.set(new Uint8Array(t.buffer,o,r),s);else if(a==1){for(var l=0;l<i;l++)e[s+l]=t[o+l];for(var l=i;l<r;l++)e[s+l]=t[o+l]-t[o+l-i]+256&255}else if(n==0){for(var l=0;l<i;l++)e[s+l]=t[o+l];if(a==2)for(var l=i;l<r;l++)e[s+l]=t[o+l];if(a==3)for(var l=i;l<r;l++)e[s+l]=t[o+l]-(t[o+l-i]>>1)+256&255;if(a==4)for(var l=i;l<r;l++)e[s+l]=t[o+l]-c(t[o+l-i],0,0)+256&255}else{if(a==2)for(var l=0;l<r;l++)e[s+l]=t[o+l]+256-t[o+l-r]&255;if(a==3){for(var l=0;l<i;l++)e[s+l]=t[o+l]+256-(t[o+l-r]>>1)&255;for(var l=i;l<r;l++)e[s+l]=t[o+l]+256-(t[o+l-r]+t[o+l-i]>>1)&255}if(a==4){for(var l=0;l<i;l++)e[s+l]=t[o+l]+256-c(0,t[o+l-r],0)&255;for(var l=i;l<r;l++)e[s+l]=t[o+l]+256-c(t[o+l-i],t[o+l-r],t[o+l-i-r])&255}}},$.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var n=t,r=0;r<8;r++)n&1?n=3988292384^n>>>1:n>>>=1;e[t]=n}return e})(),update:function(e,t,n,r){for(var i=0;i<r;i++)e=$.crc.table[(e^t[n+i])&255]^e>>>8;return e},crc:function(e,t,n){return $.crc.update(4294967295,e,t,n)^4294967295}},$.quantize=function(e,t){var n=new Uint8Array(e),r=n.slice(0),i=new Uint32Array(r.buffer),a=$.quantize.getKDtree(r,t),o=a[0],s=a[1];$.quantize.planeDst;for(var c=n,l=i,u=c.length,d=new Uint8Array(n.length>>2),f=0;f<u;f+=4){var p=c[f]*(1/255),m=c[f+1]*(1/255),h=c[f+2]*(1/255),g=c[f+3]*(1/255),_=$.quantize.getNearest(o,p,m,h,g);d[f>>2]=_.ind,l[f>>2]=_.est.rgba}return{abuf:r.buffer,inds:d,plte:s}},$.quantize.getKDtree=function(e,t,n){n??=1e-4;var r=new Uint32Array(e.buffer),i={i0:0,i1:e.length,bst:null,est:null,tdst:0,left:null,right:null};i.bst=$.quantize.stats(e,i.i0,i.i1),i.est=$.quantize.estats(i.bst);for(var a=[i];a.length<t;){for(var o=0,s=0,c=0;c<a.length;c++)a[c].est.L>o&&(o=a[c].est.L,s=c);if(o<n)break;var l=a[s],u=$.quantize.splitPixels(e,r,l.i0,l.i1,l.est.e,l.est.eMq255);if(l.i0>=u||l.i1<=u){l.est.L=0;continue}var d={i0:l.i0,i1:u,bst:null,est:null,tdst:0,left:null,right:null};d.bst=$.quantize.stats(e,d.i0,d.i1),d.est=$.quantize.estats(d.bst);var f={i0:u,i1:l.i1,bst:null,est:null,tdst:0,left:null,right:null};f.bst={R:[],m:[],N:l.bst.N-d.bst.N};for(var c=0;c<16;c++)f.bst.R[c]=l.bst.R[c]-d.bst.R[c];for(var c=0;c<4;c++)f.bst.m[c]=l.bst.m[c]-d.bst.m[c];f.est=$.quantize.estats(f.bst),l.left=d,l.right=f,a[s]=d,a.push(f)}a.sort(function(e,t){return t.bst.N-e.bst.N});for(var c=0;c<a.length;c++)a[c].ind=c;return[i,a]},$.quantize.getNearest=function(e,t,n,r,i){if(e.left==null)return e.tdst=$.quantize.dist(e.est.q,t,n,r,i),e;var a=$.quantize.planeDst(e.est,t,n,r,i),o=e.left,s=e.right;a>0&&(o=e.right,s=e.left);var c=$.quantize.getNearest(o,t,n,r,i);if(c.tdst<=a*a)return c;var l=$.quantize.getNearest(s,t,n,r,i);return l.tdst<c.tdst?l:c},$.quantize.planeDst=function(e,t,n,r,i){var a=e.e;return a[0]*t+a[1]*n+a[2]*r+a[3]*i-e.eMq},$.quantize.dist=function(e,t,n,r,i){var a=t-e[0],o=n-e[1],s=r-e[2],c=i-e[3];return a*a+o*o+s*s+c*c},$.quantize.splitPixels=function(e,t,n,r,i,a){var o=$.quantize.vecDot;for(r-=4;n<r;){for(;o(e,n,i)<=a;)n+=4;for(;o(e,r,i)>a;)r-=4;if(n>=r)break;var s=t[n>>2];t[n>>2]=t[r>>2],t[r>>2]=s,n+=4,r-=4}for(;o(e,n,i)>a;)n-=4;return n+4},$.quantize.vecDot=function(e,t,n){return e[t]*n[0]+e[t+1]*n[1]+e[t+2]*n[2]+e[t+3]*n[3]},$.quantize.stats=function(e,t,n){for(var r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],i=[0,0,0,0],a=n-t>>2,o=t;o<n;o+=4){var s=e[o]*(1/255),c=e[o+1]*(1/255),l=e[o+2]*(1/255),u=e[o+3]*(1/255);i[0]+=s,i[1]+=c,i[2]+=l,i[3]+=u,r[0]+=s*s,r[1]+=s*c,r[2]+=s*l,r[3]+=s*u,r[5]+=c*c,r[6]+=c*l,r[7]+=c*u,r[10]+=l*l,r[11]+=l*u,r[15]+=u*u}return r[4]=r[1],r[8]=r[2],r[9]=r[6],r[12]=r[3],r[13]=r[7],r[14]=r[11],{R:r,m:i,N:a}},$.quantize.estats=function(e){var t=e.R,n=e.m,r=e.N,i=n[0],a=n[1],o=n[2],s=n[3],c=r==0?0:1/r,l=[t[0]-i*i*c,t[1]-i*a*c,t[2]-i*o*c,t[3]-i*s*c,t[4]-a*i*c,t[5]-a*a*c,t[6]-a*o*c,t[7]-a*s*c,t[8]-o*i*c,t[9]-o*a*c,t[10]-o*o*c,t[11]-o*s*c,t[12]-s*i*c,t[13]-s*a*c,t[14]-s*o*c,t[15]-s*s*c],u=l,d=$.M4,f=[.5,.5,.5,.5],p=0,m=0;if(r!=0)for(var h=0;h<10&&(f=d.multVec(u,f),m=Math.sqrt(d.dot(f,f)),f=d.sml(1/m,f),!(Math.abs(m-p)<1e-9));h++)p=m;var g=[i*c,a*c,o*c,s*c],_=d.dot(d.sml(255,g),f);return{Cov:l,q:g,e:f,L:p,eMq255:_,eMq:d.dot(f,g),rgba:(Math.round(255*g[3])<<24|Math.round(255*g[2])<<16|Math.round(255*g[1])<<8|Math.round(255*g[0])<<0)>>>0}},$.M4={multVec:function(e,t){return[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:function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},sml:function(e,t){return[e*t[0],e*t[1],e*t[2],e*t[3]]}},$.encode.concatRGBA=function(e){for(var t=0,n=0;n<e.length;n++)t+=e[n].byteLength;for(var r=new Uint8Array(t),i=0,n=0;n<e.length;n++){for(var a=new Uint8Array(e[n]),o=a.length,s=0;s<o;s+=4){var c=a[s],l=a[s+1],u=a[s+2],d=a[s+3];d==0&&(c=l=u=0),r[i+s]=c,r[i+s+1]=l,r[i+s+2]=u,r[i+s+3]=d}i+=o}return r.buffer};var av=function(e){if(e===0)return sv.Greyscale;if(e===2)return sv.Truecolour;if(e===3)return sv.IndexedColour;if(e===4)return sv.GreyscaleWithAlpha;if(e===6)return sv.TruecolourWithAlpha;throw Error(`Unknown color type: `+e)},ov=function(e){for(var t=Math.floor(e.length/4),n=new Uint8Array(t*3),r=new Uint8Array(t*1),i=0,a=0,o=0;i<e.length;)n[a++]=e[i++],n[a++]=e[i++],n[a++]=e[i++],r[o++]=e[i++];return{rgbChannel:n,alphaChannel:r}},sv;(function(e){e.Greyscale=`Greyscale`,e.Truecolour=`Truecolour`,e.IndexedColour=`IndexedColour`,e.GreyscaleWithAlpha=`GreyscaleWithAlpha`,e.TruecolourWithAlpha=`TruecolourWithAlpha`})(sv||={});var cv=function(){function e(e){var t=$.decode(e),n=$.toRGBA8(t);if(n.length>1)throw Error(`Animated PNGs are not supported`);var r=ov(new Uint8Array(n[0])),i=r.rgbChannel,a=r.alphaChannel;this.rgbChannel=i,a.some(function(e){return e<255})&&(this.alphaChannel=a),this.type=av(t.ctype),this.width=t.width,this.height=t.height,this.bitsPerComponent=8}return e.load=function(t){return new e(t)},e}(),lv=function(){function e(e){this.image=e,this.bitsPerComponent=e.bitsPerComponent,this.width=e.width,this.height=e.height,this.colorSpace=`DeviceRGB`}return e.for=function(t){return hm(this,void 0,void 0,function(){var n;return gm(this,function(r){return n=cv.load(t),[2,new e(n)]})})},e.prototype.embedIntoContext=function(e,t){return hm(this,void 0,void 0,function(){var n,r;return gm(this,function(i){return n=this.embedAlphaChannel(e),r=e.flateStream(this.image.rgbChannel,{Type:`XObject`,Subtype:`Image`,BitsPerComponent:this.image.bitsPerComponent,Width:this.image.width,Height:this.image.height,ColorSpace:this.colorSpace,SMask:n}),t?(e.assign(t,r),[2,t]):[2,e.register(r)]})})},e.prototype.embedAlphaChannel=function(e){if(this.image.alphaChannel){var t=e.flateStream(this.image.alphaChannel,{Type:`XObject`,Subtype:`Image`,Height:this.image.height,Width:this.image.width,BitsPerComponent:this.image.bitsPerComponent,ColorSpace:`DeviceGray`,Decode:[0,1]});return e.register(t)}},e}(),uv=function(){function e(e,t,n){this.bytes=e,this.start=t||0,this.pos=this.start,this.end=t&&n?t+n:this.bytes.length}return Object.defineProperty(e.prototype,"length",{get:function(){return this.end-this.start},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.length===0},enumerable:!1,configurable:!0}),e.prototype.getByte=function(){return this.pos>=this.end?-1:this.bytes[this.pos++]},e.prototype.getUint16=function(){var e=this.getByte(),t=this.getByte();return e===-1||t===-1?-1:(e<<8)+t},e.prototype.getInt32=function(){var e=this.getByte(),t=this.getByte(),n=this.getByte(),r=this.getByte();return(e<<24)+(t<<16)+(n<<8)+r},e.prototype.getBytes=function(e,t){t===void 0&&(t=!1);var n=this.bytes,r=this.pos,i=this.end;if(e){var a=r+e;a>i&&(a=i),this.pos=a;var o=n.subarray(r,a);return t?new Uint8ClampedArray(o):o}else{var o=n.subarray(r,i);return t?new Uint8ClampedArray(o):o}},e.prototype.peekByte=function(){var e=this.getByte();return this.pos--,e},e.prototype.peekBytes=function(e,t){t===void 0&&(t=!1);var n=this.getBytes(e,t);return this.pos-=n.length,n},e.prototype.skip=function(e){e||=1,this.pos+=e},e.prototype.reset=function(){this.pos=this.start},e.prototype.moveStart=function(){this.start=this.pos},e.prototype.makeSubStream=function(t,n){return new e(this.bytes,t,n)},e.prototype.decode=function(){return this.bytes},e}(),dv=new Uint8Array,fv=function(){function e(e){if(this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=dv,this.minBufferLength=512,e)for(;this.minBufferLength<e;)this.minBufferLength*=2}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){for(;!this.eof&&this.bufferLength===0;)this.readBlock();return this.bufferLength===0},enumerable:!1,configurable:!0}),e.prototype.getByte=function(){for(var e=this.pos;this.bufferLength<=e;){if(this.eof)return-1;this.readBlock()}return this.buffer[this.pos++]},e.prototype.getUint16=function(){var e=this.getByte(),t=this.getByte();return e===-1||t===-1?-1:(e<<8)+t},e.prototype.getInt32=function(){var e=this.getByte(),t=this.getByte(),n=this.getByte(),r=this.getByte();return(e<<24)+(t<<16)+(n<<8)+r},e.prototype.getBytes=function(e,t){t===void 0&&(t=!1);var n,r=this.pos;if(e){for(this.ensureBuffer(r+e),n=r+e;!this.eof&&this.bufferLength<n;)this.readBlock();var i=this.bufferLength;n>i&&(n=i)}else{for(;!this.eof;)this.readBlock();n=this.bufferLength}this.pos=n;var a=this.buffer.subarray(r,n);return t&&!(a instanceof Uint8ClampedArray)?new Uint8ClampedArray(a):a},e.prototype.peekByte=function(){var e=this.getByte();return this.pos--,e},e.prototype.peekBytes=function(e,t){t===void 0&&(t=!1);var n=this.getBytes(e,t);return this.pos-=n.length,n},e.prototype.skip=function(e){e||=1,this.pos+=e},e.prototype.reset=function(){this.pos=0},e.prototype.makeSubStream=function(e,t){for(var n=e+t;this.bufferLength<=n&&!this.eof;)this.readBlock();return new uv(this.buffer,e,t)},e.prototype.decode=function(){for(;!this.eof;)this.readBlock();return this.buffer.subarray(0,this.bufferLength)},e.prototype.readBlock=function(){throw new Eg(this.constructor.name,`readBlock`)},e.prototype.ensureBuffer=function(e){var t=this.buffer;if(e<=t.byteLength)return t;for(var n=this.minBufferLength;n<e;)n*=2;var r=new Uint8Array(n);return r.set(t),this.buffer=r},e}(),pv=function(e){return e===32||e===9||e===13||e===10},mv=function(e){J(t,e);function t(t,n){var r=e.call(this,n)||this;return r.stream=t,r.input=new Uint8Array(5),n&&=.8*n,r}return t.prototype.readBlock=function(){for(var e=126,t=122,n=-1,r=this.stream,i=r.getByte();pv(i);)i=r.getByte();if(i===n||i===e){this.eof=!0;return}var a=this.bufferLength,o,s;if(i===t){for(o=this.ensureBuffer(a+4),s=0;s<4;++s)o[a+s]=0;this.bufferLength+=4}else{var c=this.input;for(c[0]=i,s=1;s<5;++s){for(i=r.getByte();pv(i);)i=r.getByte();if(c[s]=i,i===n||i===e)break}if(o=this.ensureBuffer(a+s-1),this.bufferLength+=s-1,s<5){for(;s<5;++s)c[s]=117;this.eof=!0}var l=0;for(s=0;s<5;++s)l=l*85+(c[s]-33);for(s=3;s>=0;--s)o[a+s]=l&255,l>>=8}},t}(fv),hv=function(e){J(t,e);function t(t,n){var r=e.call(this,n)||this;return r.stream=t,r.firstDigit=-1,n&&=.5*n,r}return t.prototype.readBlock=function(){var e=this.stream.getBytes(8e3);if(!e.length){this.eof=!0;return}for(var t=e.length+1>>1,n=this.ensureBuffer(this.bufferLength+t),r=this.bufferLength,i=this.firstDigit,a=0,o=e.length;a<o;a++){var s=e[a],c=void 0;if(s>=48&&s<=57)c=s&15;else if(s>=65&&s<=70||s>=97&&s<=102)c=(s&15)+9;else if(s===62){this.eof=!0;break}else continue;i<0?i=c:(n[r++]=i<<4|c,i=-1)}i>=0&&this.eof&&(n[r++]=i<<4,i=-1),this.firstDigit=i,this.bufferLength=r},t}(fv),gv=new Int32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),_v=new Int32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),vv=new Int32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),yv=[new Int32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],bv=[new Int32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5],xv=function(e){J(t,e);function t(t,n){var r=e.call(this,n)||this;r.stream=t;var i=t.getByte(),a=t.getByte();if(i===-1||a===-1)throw Error(`Invalid header in flate stream: `+i+`, `+a);if((i&15)!=8)throw Error(`Unknown compression method in flate stream: `+i+`, `+a);if(((i<<8)+a)%31!=0)throw Error(`Bad FCHECK in flate stream: `+i+`, `+a);if(a&32)throw Error(`FDICT bit set in flate stream: `+i+`, `+a);return r.codeSize=0,r.codeBuf=0,r}return t.prototype.readBlock=function(){var e,t,n=this.stream,r=this.getBits(3);if(r&1&&(this.eof=!0),r>>=1,r===0){var i=void 0;if((i=n.getByte())===-1)throw Error(`Bad block header in flate stream`);var a=i;if((i=n.getByte())===-1||(a|=i<<8,(i=n.getByte())===-1))throw Error(`Bad block header in flate stream`);var o=i;if((i=n.getByte())===-1)throw Error(`Bad block header in flate stream`);if(o|=i<<8,o!==(~a&65535)&&(a!==0||o!==0))throw Error(`Bad uncompressed block length in flate stream`);this.codeBuf=0,this.codeSize=0;var s=this.bufferLength;e=this.ensureBuffer(s+a);var c=s+a;if(this.bufferLength=c,a===0)n.peekByte()===-1&&(this.eof=!0);else for(var l=s;l<c;++l){if((i=n.getByte())===-1){this.eof=!0;break}e[l]=i}return}var u,d;if(r===1)u=yv,d=bv;else if(r===2){var f=this.getBits(5)+257,p=this.getBits(5)+1,m=this.getBits(4)+4,h=new Uint8Array(gv.length),g=void 0;for(g=0;g<m;++g)h[gv[g]]=this.getBits(3);var _=this.generateHuffmanTable(h);t=0,g=0;for(var v=f+p,y=new Uint8Array(v),b=void 0,x=void 0,S=void 0;g<v;){var C=this.getCode(_);if(C===16)b=2,x=3,S=t;else if(C===17)b=3,x=3,S=t=0;else if(C===18)b=7,x=11,S=t=0;else{y[g++]=t=C;continue}for(var w=this.getBits(b)+x;w-- >0;)y[g++]=S}u=this.generateHuffmanTable(y.subarray(0,f)),d=this.generateHuffmanTable(y.subarray(f,v))}else throw Error(`Unknown block type in flate stream`);e=this.buffer;for(var T=e?e.length:0,E=this.bufferLength;;){var D=this.getCode(u);if(D<256){E+1>=T&&(e=this.ensureBuffer(E+1),T=e.length),e[E++]=D;continue}if(D===256){this.bufferLength=E;return}D-=257,D=_v[D];var O=D>>16;O>0&&(O=this.getBits(O)),t=(D&65535)+O,D=this.getCode(d),D=vv[D],O=D>>16,O>0&&(O=this.getBits(O));var k=(D&65535)+O;E+t>=T&&(e=this.ensureBuffer(E+t),T=e.length);for(var A=0;A<t;++A,++E)e[E]=e[E-k]}},t.prototype.getBits=function(e){for(var t=this.stream,n=this.codeSize,r=this.codeBuf,i;n<e;){if((i=t.getByte())===-1)throw Error(`Bad encoding in flate stream`);r|=i<<n,n+=8}return i=r&(1<<e)-1,this.codeBuf=r>>e,this.codeSize=n-=e,i},t.prototype.getCode=function(e){for(var t=this.stream,n=e[0],r=e[1],i=this.codeSize,a=this.codeBuf,o;i<r&&(o=t.getByte())!==-1;)a|=o<<i,i+=8;var s=n[a&(1<<r)-1];typeof n==`number`&&console.log(`FLATE:`,s);var c=s>>16,l=s&65535;if(c<1||i<c)throw Error(`Bad encoding in flate stream`);return this.codeBuf=a>>c,this.codeSize=i-c,l},t.prototype.generateHuffmanTable=function(e){var t=e.length,n=0,r;for(r=0;r<t;++r)e[r]>n&&(n=e[r]);for(var i=1<<n,a=new Int32Array(i),o=1,s=0,c=2;o<=n;++o,s<<=1,c<<=1)for(var l=0;l<t;++l)if(e[l]===o){var u=0,d=s;for(r=0;r<o;++r)u=u<<1|d&1,d>>=1;for(r=u;r<i;r+=c)a[r]=o<<16|l;++s}return[a,n]},t}(fv),Sv=function(e){J(t,e);function t(t,n,r){var i=e.call(this,n)||this;i.stream=t,i.cachedData=0,i.bitsCached=0;for(var a=4096,o={earlyChange:r,codeLength:9,nextCode:258,dictionaryValues:new Uint8Array(a),dictionaryLengths:new Uint16Array(a),dictionaryPrevCodes:new Uint16Array(a),currentSequence:new Uint8Array(a),currentSequenceLength:0},s=0;s<256;++s)o.dictionaryValues[s]=s,o.dictionaryLengths[s]=1;return i.lzwState=o,i}return t.prototype.readBlock=function(){var e=512,t=e*2,n=e,r,i,a,o=this.lzwState;if(o){var s=o.earlyChange,c=o.nextCode,l=o.dictionaryValues,u=o.dictionaryLengths,d=o.dictionaryPrevCodes,f=o.codeLength,p=o.prevCode,m=o.currentSequence,h=o.currentSequenceLength,g=0,_=this.bufferLength,v=this.ensureBuffer(this.bufferLength+t);for(r=0;r<e;r++){var y=this.readBits(f),b=h>0;if(!y||y<256)m[0]=y,h=1;else if(y>=258)if(y<c)for(h=u[y],i=h-1,a=y;i>=0;i--)m[i]=l[a],a=d[a];else m[h++]=m[0];else if(y===256){f=9,c=258,h=0;continue}else{this.eof=!0,delete this.lzwState;break}if(b&&(d[c]=p,u[c]=u[p]+1,l[c]=m[0],c++,f=c+s&c+s-1?f:Math.min(Math.log(c+s)/.6931471805599453+1,12)|0),p=y,g+=h,t<g){do t+=n;while(t<g);v=this.ensureBuffer(this.bufferLength+t)}for(i=0;i<h;i++)v[_++]=m[i]}o.nextCode=c,o.codeLength=f,o.prevCode=p,o.currentSequenceLength=h,this.bufferLength=_}},t.prototype.readBits=function(e){for(var t=this.bitsCached,n=this.cachedData;t<e;){var r=this.stream.getByte();if(r===-1)return this.eof=!0,null;n=n<<8|r,t+=8}return this.bitsCached=t-=e,this.cachedData=n,n>>>t&(1<<e)-1},t}(fv),Cv=function(e){J(t,e);function t(t,n){var r=e.call(this,n)||this;return r.stream=t,r}return t.prototype.readBlock=function(){var e=this.stream.getBytes(2);if(!e||e.length<2||e[0]===128){this.eof=!0;return}var t,n=this.bufferLength,r=e[0];if(r<128){if(t=this.ensureBuffer(n+r+1),t[n++]=e[1],r>0){var i=this.stream.getBytes(r);t.set(i,n),n+=r}}else{r=257-r;var a=e[1];t=this.ensureBuffer(n+r+1);for(var o=0;o<r;o++)t[n++]=a}this.bufferLength=n},t}(fv),wv=function(e,t,n){if(t===Q.of(`FlateDecode`))return new xv(e);if(t===Q.of(`LZWDecode`)){var r=1;if(n instanceof g_){var i=n.lookup(Q.of(`EarlyChange`));i instanceof n_&&(r=i.asNumber())}return new Sv(e,void 0,r)}if(t===Q.of(`ASCII85Decode`))return new mv(e);if(t===Q.of(`ASCIIHexDecode`))return new hv(e);if(t===Q.of(`RunLengthDecode`))return new Cv(e);throw new kg(t.asString())},Tv=function(e){var t=e.dict,n=e.contents,r=new uv(n),i=t.lookup(Q.of(`Filter`)),a=t.lookup(Q.of(`DecodeParms`));if(i instanceof Q)r=wv(r,i,a);else if(i instanceof r_)for(var o=0,s=i.size();o<s;o++)r=wv(r,i.lookup(o,Q),a&&a.lookupMaybe(o,g_));else if(i)throw new Og([Q,r_],i);return r},Ev=function(e){var t=e.MediaBox();return{left:0,bottom:0,right:t.lookup(2,n_).asNumber()-t.lookup(0,n_).asNumber(),top:t.lookup(3,n_).asNumber()-t.lookup(1,n_).asNumber()}},Dv=function(e){return[1,0,0,1,-e.left,-e.bottom]},Ov=function(){function e(e,t,n){this.page=e;var r=t??Ev(e);this.width=r.right-r.left,this.height=r.top-r.bottom,this.boundingBox=r,this.transformationMatrix=n??Dv(r)}return e.for=function(t,n,r){return hm(this,void 0,void 0,function(){return gm(this,function(i){return[2,new e(t,n,r)]})})},e.prototype.embedIntoContext=function(e,t){return hm(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d;return gm(this,function(f){if(n=this.page.normalizedEntries(),r=n.Contents,i=n.Resources,!r)throw new jg;return a=this.decodeContents(r),o=this.boundingBox,s=o.left,c=o.bottom,l=o.right,u=o.top,d=e.flateStream(a,{Type:`XObject`,Subtype:`Form`,FormType:1,BBox:[s,c,l,u],Matrix:this.transformationMatrix,Resources:i}),t?(e.assign(t,d),[2,t]):[2,e.register(d)]})})},e.prototype.decodeContents=function(e){for(var t=Uint8Array.of(Z.Newline),n=[],r=0,i=e.size();r<i;r++){var a=e.lookup(r,__),o=void 0;if(a instanceof v_)o=Tv(a).decode();else if(a instanceof E_)o=a.getUnencodedContents();else throw new Mg(a);n.push(o,t)}return Jm.apply(void 0,n)},e}(),kv=function(e,t){if(e!==void 0)return t[e]},Av;(function(e){e.UseNone=`UseNone`,e.UseOutlines=`UseOutlines`,e.UseThumbs=`UseThumbs`,e.UseOC=`UseOC`})(Av||={});var jv;(function(e){e.L2R=`L2R`,e.R2L=`R2L`})(jv||={});var Mv;(function(e){e.None=`None`,e.AppDefault=`AppDefault`})(Mv||={});var Nv;(function(e){e.Simplex=`Simplex`,e.DuplexFlipShortEdge=`DuplexFlipShortEdge`,e.DuplexFlipLongEdge=`DuplexFlipLongEdge`})(Nv||={});var Pv=function(){function e(e){this.dict=e}return e.prototype.lookupBool=function(e){var t=this.dict.lookup(Q.of(e));if(t instanceof a_)return t},e.prototype.lookupName=function(e){var t=this.dict.lookup(Q.of(e));if(t instanceof Q)return t},e.prototype.HideToolbar=function(){return this.lookupBool(`HideToolbar`)},e.prototype.HideMenubar=function(){return this.lookupBool(`HideMenubar`)},e.prototype.HideWindowUI=function(){return this.lookupBool(`HideWindowUI`)},e.prototype.FitWindow=function(){return this.lookupBool(`FitWindow`)},e.prototype.CenterWindow=function(){return this.lookupBool(`CenterWindow`)},e.prototype.DisplayDocTitle=function(){return this.lookupBool(`DisplayDocTitle`)},e.prototype.NonFullScreenPageMode=function(){return this.lookupName(`NonFullScreenPageMode`)},e.prototype.Direction=function(){return this.lookupName(`Direction`)},e.prototype.PrintScaling=function(){return this.lookupName(`PrintScaling`)},e.prototype.Duplex=function(){return this.lookupName(`Duplex`)},e.prototype.PickTrayByPDFSize=function(){return this.lookupBool(`PickTrayByPDFSize`)},e.prototype.PrintPageRange=function(){var e=this.dict.lookup(Q.of(`PrintPageRange`));if(e instanceof r_)return e},e.prototype.NumCopies=function(){var e=this.dict.lookup(Q.of(`NumCopies`));if(e instanceof n_)return e},e.prototype.getHideToolbar=function(){return this.HideToolbar()?.asBoolean()??!1},e.prototype.getHideMenubar=function(){return this.HideMenubar()?.asBoolean()??!1},e.prototype.getHideWindowUI=function(){return this.HideWindowUI()?.asBoolean()??!1},e.prototype.getFitWindow=function(){return this.FitWindow()?.asBoolean()??!1},e.prototype.getCenterWindow=function(){return this.CenterWindow()?.asBoolean()??!1},e.prototype.getDisplayDocTitle=function(){return this.DisplayDocTitle()?.asBoolean()??!1},e.prototype.getNonFullScreenPageMode=function(){return kv(this.NonFullScreenPageMode()?.decodeText(),Av)??Av.UseNone},e.prototype.getReadingDirection=function(){return kv(this.Direction()?.decodeText(),jv)??jv.L2R},e.prototype.getPrintScaling=function(){return kv(this.PrintScaling()?.decodeText(),Mv)??Mv.AppDefault},e.prototype.getDuplex=function(){return kv(this.Duplex()?.decodeText(),Nv)},e.prototype.getPickTrayByPDFSize=function(){return this.PickTrayByPDFSize()?.asBoolean()},e.prototype.getPrintPageRange=function(){var e=this.PrintPageRange();if(!e)return[];for(var t=[],n=0;n<e.size();n+=2){var r=e.lookup(n,n_).asNumber(),i=e.lookup(n+1,n_).asNumber();t.push({start:r,end:i})}return t},e.prototype.getNumCopies=function(){return this.NumCopies()?.asNumber()??1},e.prototype.setHideToolbar=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`HideToolbar`),t)},e.prototype.setHideMenubar=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`HideMenubar`),t)},e.prototype.setHideWindowUI=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`HideWindowUI`),t)},e.prototype.setFitWindow=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`FitWindow`),t)},e.prototype.setCenterWindow=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`CenterWindow`),t)},e.prototype.setDisplayDocTitle=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`DisplayDocTitle`),t)},e.prototype.setNonFullScreenPageMode=function(e){ug(e,`nonFullScreenPageMode`,Av);var t=Q.of(e);this.dict.set(Q.of(`NonFullScreenPageMode`),t)},e.prototype.setReadingDirection=function(e){ug(e,`readingDirection`,jv);var t=Q.of(e);this.dict.set(Q.of(`Direction`),t)},e.prototype.setPrintScaling=function(e){ug(e,`printScaling`,Mv);var t=Q.of(e);this.dict.set(Q.of(`PrintScaling`),t)},e.prototype.setDuplex=function(e){ug(e,`duplex`,Nv);var t=Q.of(e);this.dict.set(Q.of(`Duplex`),t)},e.prototype.setPickTrayByPDFSize=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`PickTrayByPDFSize`),t)},e.prototype.setPrintPageRange=function(e){Array.isArray(e)||(e=[e]);for(var t=[],n=0,r=e.length;n<r;n++)t.push(e[n].start),t.push(e[n].end);gg(t,`printPageRange`,[`number`]);var i=this.dict.context.obj(t);this.dict.set(Q.of(`PrintPageRange`),i)},e.prototype.setNumCopies=function(e){_g(e,`numCopies`,1,Number.MAX_VALUE),bg(e,`numCopies`);var t=this.dict.context.obj(e);this.dict.set(Q.of(`NumCopies`),t)},e.fromDict=function(t){return new e(t)},e.create=function(t){return new e(t.obj({}))},e}(),Fv=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+Tf/,Iv=function(){function e(e,t){this.dict=e,this.ref=t}return e.prototype.T=function(){return this.dict.lookupMaybe(Q.of(`T`),X_,V_)},e.prototype.Ff=function(){var e=this.getInheritableAttribute(Q.of(`Ff`));return this.dict.context.lookupMaybe(e,n_)},e.prototype.V=function(){var e=this.getInheritableAttribute(Q.of(`V`));return this.dict.context.lookup(e)},e.prototype.Kids=function(){return this.dict.lookupMaybe(Q.of(`Kids`),r_)},e.prototype.DA=function(){var e=this.dict.lookup(Q.of(`DA`));if(e instanceof X_||e instanceof V_)return e},e.prototype.setKids=function(e){this.dict.set(Q.of(`Kids`),this.dict.context.obj(e))},e.prototype.getParent=function(){var t=this.dict.get(Q.of(`Parent`));if(t instanceof x_)return new e(this.dict.lookup(Q.of(`Parent`),g_),t)},e.prototype.setParent=function(e){e?this.dict.set(Q.of(`Parent`),e):this.dict.delete(Q.of(`Parent`))},e.prototype.getFullyQualifiedName=function(){var e=this.getParent();return e?e.getFullyQualifiedName()+`.`+this.getPartialName():this.getPartialName()},e.prototype.getPartialName=function(){return this.T()?.decodeText()},e.prototype.setPartialName=function(e){e?this.dict.set(Q.of(`T`),V_.fromText(e)):this.dict.delete(Q.of(`T`))},e.prototype.setDefaultAppearance=function(e){this.dict.set(Q.of(`DA`),X_.of(e))},e.prototype.getDefaultAppearance=function(){var e=this.DA();return e instanceof V_?e.decodeText():e?.asString()},e.prototype.setFontSize=function(e){var t=this.getFullyQualifiedName()??``,n=this.getDefaultAppearance();if(!n)throw new Vg(t);var r=Gm(n,Fv);if(!r.match)throw new Hg(t);var i=n.slice(0,r.pos-r.match[0].length),a=r.pos<=n.length?n.slice(r.pos):``,o=r.match[1],s=i+` /`+o+` `+e+` Tf `+a;this.setDefaultAppearance(s)},e.prototype.getFlags=function(){return this.Ff()?.asNumber()??0},e.prototype.setFlags=function(e){this.dict.set(Q.of(`Ff`),n_.of(e))},e.prototype.hasFlag=function(e){return(this.getFlags()&e)!==0},e.prototype.setFlag=function(e){var t=this.getFlags();this.setFlags(t|e)},e.prototype.clearFlag=function(e){var t=this.getFlags();this.setFlags(t&~e)},e.prototype.setFlagTo=function(e,t){t?this.setFlag(e):this.clearFlag(e)},e.prototype.getInheritableAttribute=function(e){var t;return this.ascend(function(n){t||=n.dict.get(e)}),t},e.prototype.ascend=function(e){e(this);var t=this.getParent();t&&t.ascend(e)},e}(),Lv=function(){function e(e){this.dict=e}return e.prototype.W=function(){var e=this.dict.lookup(Q.of(`W`));if(e instanceof n_)return e},e.prototype.getWidth=function(){return this.W()?.asNumber()??1},e.prototype.setWidth=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`W`),t)},e.fromDict=function(t){return new e(t)},e}(),Rv=function(){function e(e){this.dict=e}return e.prototype.Rect=function(){return this.dict.lookup(Q.of(`Rect`),r_)},e.prototype.AP=function(){return this.dict.lookupMaybe(Q.of(`AP`),g_)},e.prototype.F=function(){var e=this.dict.lookup(Q.of(`F`));return this.dict.context.lookupMaybe(e,n_)},e.prototype.getRectangle=function(){return this.Rect()?.asRectangle()??{x:0,y:0,width:0,height:0}},e.prototype.setRectangle=function(e){var t=e.x,n=e.y,r=e.width,i=e.height,a=this.dict.context.obj([t,n,t+r,n+i]);this.dict.set(Q.of(`Rect`),a)},e.prototype.getAppearanceState=function(){var e=this.dict.lookup(Q.of(`AS`));if(e instanceof Q)return e},e.prototype.setAppearanceState=function(e){this.dict.set(Q.of(`AS`),e)},e.prototype.setAppearances=function(e){this.dict.set(Q.of(`AP`),e)},e.prototype.ensureAP=function(){var e=this.AP();return e||(e=this.dict.context.obj({}),this.dict.set(Q.of(`AP`),e)),e},e.prototype.getNormalAppearance=function(){var e=this.ensureAP().get(Q.of(`N`));if(e instanceof x_||e instanceof g_)return e;throw Error(`Unexpected N type: `+e?.constructor.name)},e.prototype.setNormalAppearance=function(e){this.ensureAP().set(Q.of(`N`),e)},e.prototype.setRolloverAppearance=function(e){this.ensureAP().set(Q.of(`R`),e)},e.prototype.setDownAppearance=function(e){this.ensureAP().set(Q.of(`D`),e)},e.prototype.removeRolloverAppearance=function(){this.AP()?.delete(Q.of(`R`))},e.prototype.removeDownAppearance=function(){this.AP()?.delete(Q.of(`D`))},e.prototype.getAppearances=function(){var e=this.AP();if(e)return{normal:e.lookup(Q.of(`N`),g_,__),rollover:e.lookupMaybe(Q.of(`R`),g_,__),down:e.lookupMaybe(Q.of(`D`),g_,__)}},e.prototype.getFlags=function(){return this.F()?.asNumber()??0},e.prototype.setFlags=function(e){this.dict.set(Q.of(`F`),n_.of(e))},e.prototype.hasFlag=function(e){return(this.getFlags()&e)!==0},e.prototype.setFlag=function(e){var t=this.getFlags();this.setFlags(t|e)},e.prototype.clearFlag=function(e){var t=this.getFlags();this.setFlags(t&~e)},e.prototype.setFlagTo=function(e,t){t?this.setFlag(e):this.clearFlag(e)},e.fromDict=function(t){return new e(t)},e}(),zv=function(){function e(e){this.dict=e}return e.prototype.R=function(){var e=this.dict.lookup(Q.of(`R`));if(e instanceof n_)return e},e.prototype.BC=function(){var e=this.dict.lookup(Q.of(`BC`));if(e instanceof r_)return e},e.prototype.BG=function(){var e=this.dict.lookup(Q.of(`BG`));if(e instanceof r_)return e},e.prototype.CA=function(){var e=this.dict.lookup(Q.of(`CA`));if(e instanceof V_||e instanceof X_)return e},e.prototype.RC=function(){var e=this.dict.lookup(Q.of(`RC`));if(e instanceof V_||e instanceof X_)return e},e.prototype.AC=function(){var e=this.dict.lookup(Q.of(`AC`));if(e instanceof V_||e instanceof X_)return e},e.prototype.getRotation=function(){return this.R()?.asNumber()},e.prototype.getBorderColor=function(){var e=this.BC();if(e){for(var t=[],n=0,r=e?.size();n<r;n++){var i=e.get(n);i instanceof n_&&t.push(i.asNumber())}return t}},e.prototype.getBackgroundColor=function(){var e=this.BG();if(e){for(var t=[],n=0,r=e?.size();n<r;n++){var i=e.get(n);i instanceof n_&&t.push(i.asNumber())}return t}},e.prototype.getCaptions=function(){var e=this.CA(),t=this.RC(),n=this.AC();return{normal:e?.decodeText(),rollover:t?.decodeText(),down:n?.decodeText()}},e.prototype.setRotation=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`R`),t)},e.prototype.setBorderColor=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`BC`),t)},e.prototype.setBackgroundColor=function(e){var t=this.dict.context.obj(e);this.dict.set(Q.of(`BG`),t)},e.prototype.setCaptions=function(e){var t=V_.fromText(e.normal);if(this.dict.set(Q.of(`CA`),t),e.rollover){var n=V_.fromText(e.rollover);this.dict.set(Q.of(`RC`),n)}else this.dict.delete(Q.of(`RC`));if(e.down){var r=V_.fromText(e.down);this.dict.set(Q.of(`AC`),r)}else this.dict.delete(Q.of(`AC`))},e.fromDict=function(t){return new e(t)},e}(),Bv=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.MK=function(){var e=this.dict.lookup(Q.of(`MK`));if(e instanceof g_)return e},t.prototype.BS=function(){var e=this.dict.lookup(Q.of(`BS`));if(e instanceof g_)return e},t.prototype.DA=function(){var e=this.dict.lookup(Q.of(`DA`));if(e instanceof X_||e instanceof V_)return e},t.prototype.P=function(){var e=this.dict.get(Q.of(`P`));if(e instanceof x_)return e},t.prototype.setP=function(e){this.dict.set(Q.of(`P`),e)},t.prototype.setDefaultAppearance=function(e){this.dict.set(Q.of(`DA`),X_.of(e))},t.prototype.getDefaultAppearance=function(){var e=this.DA();return e instanceof V_?e.decodeText():e?.asString()},t.prototype.getAppearanceCharacteristics=function(){var e=this.MK();if(e)return zv.fromDict(e)},t.prototype.getOrCreateAppearanceCharacteristics=function(){var e=this.MK();if(e)return zv.fromDict(e);var t=zv.fromDict(this.dict.context.obj({}));return this.dict.set(Q.of(`MK`),t.dict),t},t.prototype.getBorderStyle=function(){var e=this.BS();if(e)return Lv.fromDict(e)},t.prototype.getOrCreateBorderStyle=function(){var e=this.BS();if(e)return Lv.fromDict(e);var t=Lv.fromDict(this.dict.context.obj({}));return this.dict.set(Q.of(`BS`),t.dict),t},t.prototype.getOnValue=function(){var e=this.getAppearances()?.normal;if(e instanceof g_)for(var t=e.keys(),n=0,r=t.length;n<r;n++){var i=t[n];if(i!==Q.of(`Off`))return i}},t.fromDict=function(e){return new t(e)},t.create=function(e,n){return new t(e.obj({Type:`Annot`,Subtype:`Widget`,Rect:[0,0,0,0],Parent:n}))},t}(Rv),Vv=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.FT=function(){var e=this.getInheritableAttribute(Q.of(`FT`));return this.dict.context.lookup(e,Q)},t.prototype.getWidgets=function(){var e=this.Kids();if(!e)return[Bv.fromDict(this.dict)];for(var t=Array(e.size()),n=0,r=e.size();n<r;n++){var i=e.lookup(n,g_);t[n]=Bv.fromDict(i)}return t},t.prototype.addWidget=function(e){this.normalizedEntries().Kids.push(e)},t.prototype.removeWidget=function(e){var t=this.Kids();if(t){if(e<0||e>t.size())throw new Rg(e,0,t.size());t.remove(e)}else{if(e!==0)throw new Rg(e,0,0);this.setKids([])}},t.prototype.normalizedEntries=function(){var e=this.Kids();return e||(e=this.dict.context.obj([this.ref]),this.dict.set(Q.of(`Kids`),e)),{Kids:e}},t.fromDict=function(e,n){return new t(e,n)},t}(Iv),Hv=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.Opt=function(){return this.dict.lookupMaybe(Q.of(`Opt`),X_,V_,r_)},t.prototype.setOpt=function(e){this.dict.set(Q.of(`Opt`),this.dict.context.obj(e))},t.prototype.getExportValues=function(){var e=this.Opt();if(e){if(e instanceof X_||e instanceof V_)return[e];for(var t=[],n=0,r=e.size();n<r;n++){var i=e.lookup(n);(i instanceof X_||i instanceof V_)&&t.push(i)}return t}},t.prototype.removeExportValue=function(e){var t=this.Opt();if(t)if(t instanceof X_||t instanceof V_){if(e!==0)throw new Rg(e,0,0);this.setOpt([])}else{if(e<0||e>t.size())throw new Rg(e,0,t.size());t.remove(e)}},t.prototype.normalizeExportValues=function(){for(var e=this.getExportValues()??[],t=[],n=this.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r],o=e[r]??V_.fromText(a.getOnValue()?.decodeText()??``);t.push(o)}this.setOpt(t)},t.prototype.addOpt=function(e,t){this.normalizeExportValues();var n=e.decodeText(),r;if(t)for(var i=this.getExportValues()??[],a=0,o=i.length;a<o;a++)i[a].decodeText()===n&&(r=a);var s=this.Opt();return s.push(e),r??s.size()-1},t.prototype.addWidgetWithOpt=function(e,t,n){var r=this.addOpt(t,n),i=Q.of(String(r));return this.addWidget(e),i},t}(Vv),Uv=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.setValue=function(e){if(e!==(this.getOnValue()??Q.of(`Yes`))&&e!==Q.of(`Off`))throw new zg;this.dict.set(Q.of(`V`),e);for(var t=this.getWidgets(),n=0,r=t.length;n<r;n++){var i=t[n],a=i.getOnValue()===e?e:Q.of(`Off`);i.setAppearanceState(a)}},t.prototype.getValue=function(){var e=this.V();return e instanceof Q?e:Q.of(`Off`)},t.prototype.getOnValue=function(){return this.getWidgets()[0]?.getOnValue()},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Btn`,Kids:[]});return new t(n,e.register(n))},t}(Hv),Wv=function(e){return 1<<e},Gv;(function(e){e[e.ReadOnly=Wv(0)]=`ReadOnly`,e[e.Required=Wv(1)]=`Required`,e[e.NoExport=Wv(2)]=`NoExport`})(Gv||={});var Kv;(function(e){e[e.NoToggleToOff=Wv(14)]=`NoToggleToOff`,e[e.Radio=Wv(15)]=`Radio`,e[e.PushButton=Wv(16)]=`PushButton`,e[e.RadiosInUnison=Wv(25)]=`RadiosInUnison`})(Kv||={});var qv;(function(e){e[e.Multiline=Wv(12)]=`Multiline`,e[e.Password=Wv(13)]=`Password`,e[e.FileSelect=Wv(20)]=`FileSelect`,e[e.DoNotSpellCheck=Wv(22)]=`DoNotSpellCheck`,e[e.DoNotScroll=Wv(23)]=`DoNotScroll`,e[e.Comb=Wv(24)]=`Comb`,e[e.RichText=Wv(25)]=`RichText`})(qv||={});var Jv;(function(e){e[e.Combo=Wv(17)]=`Combo`,e[e.Edit=Wv(18)]=`Edit`,e[e.Sort=Wv(19)]=`Sort`,e[e.MultiSelect=Wv(21)]=`MultiSelect`,e[e.DoNotSpellCheck=Wv(22)]=`DoNotSpellCheck`,e[e.CommitOnSelChange=Wv(26)]=`CommitOnSelChange`})(Jv||={});var Yv=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.setValues=function(e){if(this.hasFlag(Jv.Combo)&&!this.hasFlag(Jv.Edit)&&!this.valuesAreValid(e))throw new zg;if(e.length===0&&this.dict.delete(Q.of(`V`)),e.length===1&&this.dict.set(Q.of(`V`),e[0]),e.length>1){if(!this.hasFlag(Jv.MultiSelect))throw new Bg;this.dict.set(Q.of(`V`),this.dict.context.obj(e))}this.updateSelectedIndices(e)},t.prototype.valuesAreValid=function(e){for(var t=this.getOptions(),n=function(n,r){var i=e[n].decodeText();if(!t.find(function(e){return i===(e.display||e.value).decodeText()}))return{value:!1}},r=0,i=e.length;r<i;r++){var a=n(r,i);if(typeof a==`object`)return a.value}return!0},t.prototype.updateSelectedIndices=function(e){if(e.length>1){for(var t=Array(e.length),n=this.getOptions(),r=function(r,i){var a=e[r].decodeText();t[r]=n.findIndex(function(e){return a===(e.display||e.value).decodeText()})},i=0,a=e.length;i<a;i++)r(i,a);this.dict.set(Q.of(`I`),this.dict.context.obj(t.sort()))}else this.dict.delete(Q.of(`I`))},t.prototype.getValues=function(){var e=this.V();if(e instanceof X_||e instanceof V_)return[e];if(e instanceof r_){for(var t=[],n=0,r=e.size();n<r;n++){var i=e.lookup(n);(i instanceof X_||i instanceof V_)&&t.push(i)}return t}return[]},t.prototype.Opt=function(){return this.dict.lookupMaybe(Q.of(`Opt`),X_,V_,r_)},t.prototype.setOptions=function(e){for(var t=Array(e.length),n=0,r=e.length;n<r;n++){var i=e[n],a=i.value,o=i.display;t[n]=this.dict.context.obj([a,o||a])}this.dict.set(Q.of(`Opt`),this.dict.context.obj(t))},t.prototype.getOptions=function(){var e=this.Opt();if(e instanceof X_||e instanceof V_)return[{value:e,display:e}];if(e instanceof r_){for(var t=[],n=0,r=e.size();n<r;n++){var i=e.lookup(n);if((i instanceof X_||i instanceof V_)&&t.push({value:i,display:i}),i instanceof r_&&i.size()>0){var a=i.lookup(0,X_,V_),o=i.lookupMaybe(1,X_,V_);t.push({value:a,display:o||a})}}return t}return[]},t}(Vv),Xv=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Ch`,Ff:Jv.Combo,Kids:[]});return new t(n,e.register(n))},t}(Yv),Zv=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.addField=function(e){this.normalizedEntries().Kids?.push(e)},t.prototype.normalizedEntries=function(){var e=this.Kids();return e||(e=this.dict.context.obj([]),this.dict.set(Q.of(`Kids`),e)),{Kids:e}},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({});return new t(n,e.register(n))},t}(Iv),Qv=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t}(Vv),$v=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.MaxLen=function(){var e=this.dict.lookup(Q.of(`MaxLen`));if(e instanceof n_)return e},t.prototype.Q=function(){var e=this.dict.lookup(Q.of(`Q`));if(e instanceof n_)return e},t.prototype.setMaxLength=function(e){this.dict.set(Q.of(`MaxLen`),n_.of(e))},t.prototype.removeMaxLength=function(){this.dict.delete(Q.of(`MaxLen`))},t.prototype.getMaxLength=function(){return this.MaxLen()?.asNumber()},t.prototype.setQuadding=function(e){this.dict.set(Q.of(`Q`),n_.of(e))},t.prototype.getQuadding=function(){return this.Q()?.asNumber()},t.prototype.setValue=function(e){this.dict.set(Q.of(`V`),e)},t.prototype.removeValue=function(){this.dict.delete(Q.of(`V`))},t.prototype.getValue=function(){var e=this.V();if(e instanceof X_||e instanceof V_)return e},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Tx`,Kids:[]});return new t(n,e.register(n))},t}(Vv),ey=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Btn`,Ff:Kv.PushButton,Kids:[]});return new t(n,e.register(n))},t}(Hv),ty=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.setValue=function(e){if(!this.getOnValues().includes(e)&&e!==Q.of(`Off`))throw new zg;this.dict.set(Q.of(`V`),e);for(var t=this.getWidgets(),n=0,r=t.length;n<r;n++){var i=t[n],a=i.getOnValue()===e?e:Q.of(`Off`);i.setAppearanceState(a)}},t.prototype.getValue=function(){var e=this.V();return e instanceof Q?e:Q.of(`Off`)},t.prototype.getOnValues=function(){for(var e=this.getWidgets(),t=[],n=0,r=e.length;n<r;n++){var i=e[n].getOnValue();i&&t.push(i)}return t},t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Btn`,Ff:Kv.Radio,Kids:[]});return new t(n,e.register(n))},t}(Hv),ny=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.fromDict=function(e,n){return new t(e,n)},t.create=function(e){var n=e.obj({FT:`Ch`,Kids:[]});return new t(n,e.register(n))},t}(Yv),ry=function(e){if(!e)return[];for(var t=[],n=0,r=e.size();n<r;n++){var i=e.get(n),a=e.lookup(n);i instanceof x_&&a instanceof g_&&t.push([iy(a,i),i])}return t},iy=function(e,t){return ay(e)?Zv.fromDict(e,t):oy(e,t)},ay=function(e){var t=e.lookup(Q.of(`Kids`));if(t instanceof r_)for(var n=0,r=t.size();n<r;n++){var i=t.lookup(n);if(i instanceof g_&&i.has(Q.of(`T`)))return!0}return!1},oy=function(e,t){var n=uy(e,Q.of(`FT`)),r=e.context.lookup(n,Q);return r===Q.of(`Btn`)?sy(e,t):r===Q.of(`Ch`)?cy(e,t):r===Q.of(`Tx`)?$v.fromDict(e,t):r===Q.of(`Sig`)?Qv.fromDict(e,t):Vv.fromDict(e,t)},sy=function(e,t){var n=uy(e,Q.of(`Ff`)),r=e.context.lookupMaybe(n,n_)?.asNumber()??0;return ly(r,Kv.PushButton)?ey.fromDict(e,t):ly(r,Kv.Radio)?ty.fromDict(e,t):Uv.fromDict(e,t)},cy=function(e,t){var n=uy(e,Q.of(`Ff`));return ly(e.context.lookupMaybe(n,n_)?.asNumber()??0,Jv.Combo)?Xv.fromDict(e,t):ny.fromDict(e,t)},ly=function(e,t){return(e&t)!==0},uy=function(e,t){var n;return dy(e,function(e){n||=e.get(t)}),n},dy=function(e,t){t(e);var n=e.lookupMaybe(Q.of(`Parent`),g_);n&&dy(n,t)},fy=function(){function e(e){this.dict=e}return e.prototype.Fields=function(){var e=this.dict.lookup(Q.of(`Fields`));if(e instanceof r_)return e},e.prototype.getFields=function(){for(var e=this.normalizedEntries().Fields,t=Array(e.size()),n=0,r=e.size();n<r;n++){var i=e.get(n);t[n]=[iy(e.lookup(n,g_),i),i]}return t},e.prototype.getAllFields=function(){var e=[],t=function(n){if(n)for(var r=0,i=n.length;r<i;r++){var a=n[r];e.push(a);var o=a[0];o instanceof Zv&&t(ry(o.Kids()))}};return t(this.getFields()),e},e.prototype.addField=function(e){this.normalizedEntries().Fields?.push(e)},e.prototype.removeField=function(e){var t=e.getParent(),n=t===void 0?this.normalizedEntries().Fields:t.Kids(),r=n?.indexOf(e.ref);if(n===void 0||r===void 0)throw Error(`Tried to remove inexistent field `+e.getFullyQualifiedName());n.remove(r),t!==void 0&&n.size()===0&&this.removeField(t)},e.prototype.normalizedEntries=function(){var e=this.Fields();return e||(e=this.dict.context.obj([]),this.dict.set(Q.of(`Fields`),e)),{Fields:e}},e.fromDict=function(t){return new e(t)},e.create=function(t){return new e(t.obj({Fields:[]}))},e}(),py=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.Pages=function(){return this.lookup(Q.of(`Pages`),g_)},t.prototype.AcroForm=function(){return this.lookupMaybe(Q.of(`AcroForm`),g_)},t.prototype.getAcroForm=function(){var e=this.AcroForm();if(e)return fy.fromDict(e)},t.prototype.getOrCreateAcroForm=function(){var e=this.getAcroForm();if(!e){e=fy.create(this.context);var t=this.context.register(e.dict);this.set(Q.of(`AcroForm`),t)}return e},t.prototype.ViewerPreferences=function(){return this.lookupMaybe(Q.of(`ViewerPreferences`),g_)},t.prototype.getViewerPreferences=function(){var e=this.ViewerPreferences();if(e)return Pv.fromDict(e)},t.prototype.getOrCreateViewerPreferences=function(){var e=this.getViewerPreferences();if(!e){e=Pv.create(this.context);var t=this.context.register(e.dict);this.set(Q.of(`ViewerPreferences`),t)}return e},t.prototype.insertLeafNode=function(e,t){var n=this.get(Q.of(`Pages`));return this.Pages().insertLeafNode(e,t)||n},t.prototype.removeLeafNode=function(e){this.Pages().removeLeafNode(e)},t.withContextAndPages=function(e,n){var r=new Map;return r.set(Q.of(`Type`),Q.of(`Catalog`)),r.set(Q.of(`Pages`),n),new t(r,e)},t.fromMapWithContext=function(e,n){return new t(e,n)},t}(g_),my=function(e){J(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.Parent=function(){return this.lookup(Q.of(`Parent`))},t.prototype.Kids=function(){return this.lookup(Q.of(`Kids`),r_)},t.prototype.Count=function(){return this.lookup(Q.of(`Count`),n_)},t.prototype.pushTreeNode=function(e){this.Kids().push(e)},t.prototype.pushLeafNode=function(e){var t=this.Kids();this.insertLeafKid(t.size(),e)},t.prototype.insertLeafNode=function(e,n){var r=this.Kids(),i=this.Count().asNumber();if(n>i)throw new Ig(n,i);for(var a=n,o=0,s=r.size();o<s;o++){if(a===0){this.insertLeafKid(o,e);return}var c=r.get(o),l=this.context.lookup(c);if(l instanceof t){if(l.Count().asNumber()>a)return l.insertLeafNode(e,a)||c;a-=l.Count().asNumber()}l instanceof A_&&--a}if(a===0){this.insertLeafKid(r.size(),e);return}throw new Lg(n,`insertLeafNode`)},t.prototype.removeLeafNode=function(e,n){n===void 0&&(n=!0);var r=this.Kids(),i=this.Count().asNumber();if(e>=i)throw new Ig(e,i);for(var a=e,o=0,s=r.size();o<s;o++){var c=r.get(o),l=this.context.lookup(c);if(l instanceof t)if(l.Count().asNumber()>a){l.removeLeafNode(a,n),n&&l.Kids().size()===0&&r.remove(o);return}else a-=l.Count().asNumber();if(l instanceof A_)if(a===0){this.removeKid(o);return}else --a}throw new Lg(e,`removeLeafNode`)},t.prototype.ascend=function(e){e(this);var t=this.Parent();t&&t.ascend(e)},t.prototype.traverse=function(e){for(var n=this.Kids(),r=0,i=n.size();r<i;r++){var a=n.get(r),o=this.context.lookup(a);o instanceof t&&o.traverse(e),e(o,a)}},t.prototype.insertLeafKid=function(e,t){var n=this.Kids();this.ascend(function(e){var t=e.Count().asNumber()+1;e.set(Q.of(`Count`),n_.of(t))}),n.insert(e,t)},t.prototype.removeKid=function(e){var t=this.Kids();t.lookup(e)instanceof A_&&this.ascend(function(e){var t=e.Count().asNumber()-1;e.set(Q.of(`Count`),n_.of(t))}),t.remove(e)},t.withContext=function(e,n){var r=new Map;return r.set(Q.of(`Type`),Q.of(`Pages`)),r.set(Q.of(`Kids`),e.obj([])),r.set(Q.of(`Count`),e.obj(0)),n&&r.set(Q.of(`Parent`),n),new t(r,e)},t.fromMapWithContext=function(e,n){return new t(e,n)},t}(g_),hy=new Uint8Array(256);hy[Z.Zero]=1,hy[Z.One]=1,hy[Z.Two]=1,hy[Z.Three]=1,hy[Z.Four]=1,hy[Z.Five]=1,hy[Z.Six]=1,hy[Z.Seven]=1,hy[Z.Eight]=1,hy[Z.Nine]=1;var gy=new Uint8Array(256);gy[Z.Period]=1,gy[Z.Plus]=1,gy[Z.Minus]=1;for(var _y=new Uint8Array(256),vy=0,yy=256;vy<yy;vy++)_y[vy]=hy[vy]||gy[vy]?1:0;var by=Z.Newline,xy=Z.CarriageReturn,Sy=function(){function e(e,t){t===void 0&&(t=!1),this.bytes=e,this.capNumbers=t}return e.prototype.parseRawInt=function(){for(var e=``;!this.bytes.done()&&hy[this.bytes.peek()];)e+=km(this.bytes.next());var t=Number(e);if(!e||!isFinite(t))throw new Ug(this.bytes.position(),e);return t},e.prototype.parseRawNumber=function(){for(var e=``;!this.bytes.done();){var t=this.bytes.peek();if(!_y[t]||(e+=km(this.bytes.next()),t===Z.Period))break}for(;!this.bytes.done();){var t=this.bytes.peek();if(!hy[t])break;e+=km(this.bytes.next())}var n=Number(e);if(!e||!isFinite(n))throw new Ug(this.bytes.position(),e);if(n>2**53-1)if(this.capNumbers){var r=`Parsed number that is too large for some PDF readers: `+e+`, using Number.MAX_SAFE_INTEGER instead.`;return console.warn(r),2**53-1}else{var r=`Parsed number that is too large for some PDF readers: `+e+`, not capping.`;console.warn(r)}return n},e.prototype.skipWhitespace=function(){for(;!this.bytes.done()&&s_[this.bytes.peek()];)this.bytes.next()},e.prototype.skipLine=function(){for(;!this.bytes.done();){var e=this.bytes.peek();if(e===by||e===xy)return;this.bytes.next()}},e.prototype.skipComment=function(){if(this.bytes.peek()!==Z.Percent)return!1;for(;!this.bytes.done();){var e=this.bytes.peek();if(e===by||e===xy)return!0;this.bytes.next()}return!0},e.prototype.skipWhitespaceAndComments=function(){for(this.skipWhitespace();this.skipComment();)this.skipWhitespace()},e.prototype.matchKeyword=function(e){for(var t=this.bytes.offset(),n=0,r=e.length;n<r;n++)if(this.bytes.done()||this.bytes.next()!==e[n])return this.bytes.moveTo(t),!1;return!0},e}(),Cy=function(){function e(e){this.idx=0,this.line=0,this.column=0,this.bytes=e,this.length=this.bytes.length}return e.prototype.moveTo=function(e){this.idx=e},e.prototype.next=function(){var e=this.bytes[this.idx++];return e===Z.Newline?(this.line+=1,this.column=0):this.column+=1,e},e.prototype.assertNext=function(e){if(this.peek()!==e)throw new Gg(this.position(),e,this.peek());return this.next()},e.prototype.peek=function(){return this.bytes[this.idx]},e.prototype.peekAhead=function(e){return this.bytes[this.idx+e]},e.prototype.peekAt=function(e){return this.bytes[e]},e.prototype.done=function(){return this.idx>=this.length},e.prototype.offset=function(){return this.idx},e.prototype.slice=function(e,t){return this.bytes.slice(e,t)},e.prototype.position=function(){return{line:this.line,column:this.column,offset:this.idx}},e.of=function(t){return new e(t)},e.fromPDFRawStream=function(t){return e.of(Tv(t).decode())},e}(),wy=Z.Space,Ty=Z.CarriageReturn,Ey=Z.Newline,Dy=[Z.s,Z.t,Z.r,Z.e,Z.a,Z.m],Oy=[Z.e,Z.n,Z.d,Z.s,Z.t,Z.r,Z.e,Z.a,Z.m],ky={header:[Z.Percent,Z.P,Z.D,Z.F,Z.Dash],eof:[Z.Percent,Z.Percent,Z.E,Z.O,Z.F],obj:[Z.o,Z.b,Z.j],endobj:[Z.e,Z.n,Z.d,Z.o,Z.b,Z.j],xref:[Z.x,Z.r,Z.e,Z.f],trailer:[Z.t,Z.r,Z.a,Z.i,Z.l,Z.e,Z.r],startxref:[Z.s,Z.t,Z.a,Z.r,Z.t,Z.x,Z.r,Z.e,Z.f],true:[Z.t,Z.r,Z.u,Z.e],false:[Z.f,Z.a,Z.l,Z.s,Z.e],null:[Z.n,Z.u,Z.l,Z.l],stream:Dy,streamEOF1:_m(Dy,[wy,Ty,Ey]),streamEOF2:_m(Dy,[Ty,Ey]),streamEOF3:_m(Dy,[Ty]),streamEOF4:_m(Dy,[Ey]),endstream:Oy,EOF1endstream:_m([Ty,Ey],Oy),EOF2endstream:_m([Ty],Oy),EOF3endstream:_m([Ey],Oy)},Ay=function(e){J(t,e);function t(t,n,r){r===void 0&&(r=!1);var i=e.call(this,t,r)||this;return i.context=n,i}return t.prototype.parseObject=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(ky.true))return a_.True;if(this.matchKeyword(ky.false))return a_.False;if(this.matchKeyword(ky.null))return h_;var e=this.bytes.peek();if(e===Z.LessThan&&this.bytes.peekAhead(1)===Z.LessThan)return this.parseDictOrStream();if(e===Z.LessThan)return this.parseHexString();if(e===Z.LeftParen)return this.parseString();if(e===Z.ForwardSlash)return this.parseName();if(e===Z.LeftSquareBracket)return this.parseArray();if(_y[e])return this.parseNumberOrRef();throw new Kg(this.bytes.position(),e)},t.prototype.parseNumberOrRef=function(){var e=this.parseRawNumber();this.skipWhitespaceAndComments();var t=this.bytes.offset();if(hy[this.bytes.peek()]){var n=this.parseRawNumber();if(this.skipWhitespaceAndComments(),this.bytes.peek()===Z.R)return this.bytes.assertNext(Z.R),x_.of(e,n)}return this.bytes.moveTo(t),n_.of(e)},t.prototype.parseHexString=function(){var e=``;for(this.bytes.assertNext(Z.LessThan);!this.bytes.done()&&this.bytes.peek()!==Z.GreaterThan;)e+=km(this.bytes.next());return this.bytes.assertNext(Z.GreaterThan),V_.of(e)},t.prototype.parseString=function(){for(var e=0,t=!1,n=``;!this.bytes.done();){var r=this.bytes.next();if(n+=km(r),t||(r===Z.LeftParen&&(e+=1),r===Z.RightParen&&--e),r===Z.BackSlash?t=!t:t&&=!1,e===0)return X_.of(n.substring(1,n.length-1))}throw new Yg(this.bytes.position())},t.prototype.parseName=function(){this.bytes.assertNext(Z.ForwardSlash);for(var e=``;!this.bytes.done();){var t=this.bytes.peek();if(s_[t]||o_[t])break;e+=km(t),this.bytes.next()}return Q.of(e)},t.prototype.parseArray=function(){this.bytes.assertNext(Z.LeftSquareBracket),this.skipWhitespaceAndComments();for(var e=r_.withContext(this.context);this.bytes.peek()!==Z.RightSquareBracket;){var t=this.parseObject();e.push(t),this.skipWhitespaceAndComments()}return this.bytes.assertNext(Z.RightSquareBracket),e},t.prototype.parseDict=function(){this.bytes.assertNext(Z.LessThan),this.bytes.assertNext(Z.LessThan),this.skipWhitespaceAndComments();for(var e=new Map;!this.bytes.done()&&this.bytes.peek()!==Z.GreaterThan&&this.bytes.peekAhead(1)!==Z.GreaterThan;){var t=this.parseName(),n=this.parseObject();e.set(t,n),this.skipWhitespaceAndComments()}this.skipWhitespaceAndComments(),this.bytes.assertNext(Z.GreaterThan),this.bytes.assertNext(Z.GreaterThan);var r=e.get(Q.of(`Type`));return r===Q.of(`Catalog`)?py.fromMapWithContext(e,this.context):r===Q.of(`Pages`)?my.fromMapWithContext(e,this.context):r===Q.of(`Page`)?A_.fromMapWithContext(e,this.context):g_.fromMapWithContext(e,this.context)},t.prototype.parseDictOrStream=function(){var e=this.bytes.position(),t=this.parseDict();if(this.skipWhitespaceAndComments(),!this.matchKeyword(ky.streamEOF1)&&!this.matchKeyword(ky.streamEOF2)&&!this.matchKeyword(ky.streamEOF3)&&!this.matchKeyword(ky.streamEOF4)&&!this.matchKeyword(ky.stream))return t;var n=this.bytes.offset(),r,i=t.get(Q.of(`Length`));i instanceof n_?(r=n+i.asNumber(),this.bytes.moveTo(r),this.skipWhitespaceAndComments(),this.matchKeyword(ky.endstream)||(this.bytes.moveTo(n),r=this.findEndOfStreamFallback(e))):r=this.findEndOfStreamFallback(e);var a=this.bytes.slice(n,r);return v_.of(t,a)},t.prototype.findEndOfStreamFallback=function(e){for(var t=1,n=this.bytes.offset();!this.bytes.done()&&(n=this.bytes.offset(),this.matchKeyword(ky.stream)?t+=1:this.matchKeyword(ky.EOF1endstream)||this.matchKeyword(ky.EOF2endstream)||this.matchKeyword(ky.EOF3endstream)||this.matchKeyword(ky.endstream)?--t:this.bytes.next(),t!==0););if(t!==0)throw new Jg(e);return n},t.forBytes=function(e,n,r){return new t(Cy.of(e),n,r)},t.forByteStream=function(e,n,r){return r===void 0&&(r=!1),new t(e,n,r)},t}(Sy),jy=function(e){J(t,e);function t(t,n){var r=e.call(this,Cy.fromPDFRawStream(t),t.dict.context)||this,i=t.dict;return r.alreadyParsed=!1,r.shouldWaitForTick=n||(function(){return!1}),r.firstOffset=i.lookup(Q.of(`First`),n_).asNumber(),r.objectCount=i.lookup(Q.of(`N`),n_).asNumber(),r}return t.prototype.parseIntoContext=function(){return hm(this,void 0,void 0,function(){var e,t,n,r,i,a,o,s;return gm(this,function(c){switch(c.label){case 0:if(this.alreadyParsed)throw new Ag(`PDFObjectStreamParser`,`parseIntoContext`);this.alreadyParsed=!0,e=this.parseOffsetsAndObjectNumbers(),t=0,n=e.length,c.label=1;case 1:return t<n?(r=e[t],i=r.objectNumber,a=r.offset,this.bytes.moveTo(this.firstOffset+a),o=this.parseObject(),s=x_.of(i,0),this.context.assign(s,o),this.shouldWaitForTick()?[4,ah()]:[3,3]):[3,4];case 2:c.sent(),c.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},t.prototype.parseOffsetsAndObjectNumbers=function(){for(var e=[],t=0,n=this.objectCount;t<n;t++){this.skipWhitespaceAndComments();var r=this.parseRawInt();this.skipWhitespaceAndComments();var i=this.parseRawInt();e.push({objectNumber:r,offset:i})}return e},t.forStream=function(e,n){return new t(e,n)},t}(Ay),My=function(){function e(e){this.alreadyParsed=!1,this.dict=e.dict,this.bytes=Cy.fromPDFRawStream(e),this.context=this.dict.context;var t=this.dict.lookup(Q.of(`Size`),n_),n=this.dict.lookup(Q.of(`Index`));if(n instanceof r_){this.subsections=[];for(var r=0,i=n.size();r<i;r+=2){var a=n.lookup(r+0,n_).asNumber(),o=n.lookup(r+1,n_).asNumber();this.subsections.push({firstObjectNumber:a,length:o})}}else this.subsections=[{firstObjectNumber:0,length:t.asNumber()}];var s=this.dict.lookup(Q.of(`W`),r_);this.byteWidths=[-1,-1,-1];for(var r=0,i=s.size();r<i;r++)this.byteWidths[r]=s.lookup(r,n_).asNumber()}return e.prototype.parseIntoContext=function(){if(this.alreadyParsed)throw new Ag(`PDFXRefStreamParser`,`parseIntoContext`);return this.alreadyParsed=!0,this.context.trailerInfo={Root:this.dict.get(Q.of(`Root`)),Encrypt:this.dict.get(Q.of(`Encrypt`)),Info:this.dict.get(Q.of(`Info`)),ID:this.dict.get(Q.of(`ID`))},this.parseEntries()},e.prototype.parseEntries=function(){for(var e=[],t=this.byteWidths,n=t[0],r=t[1],i=t[2],a=0,o=this.subsections.length;a<o;a++)for(var s=this.subsections[a],c=s.firstObjectNumber,l=s.length,u=0;u<l;u++){for(var d=0,f=0,p=n;f<p;f++)d=d<<8|this.bytes.next();for(var m=0,f=0,p=r;f<p;f++)m=m<<8|this.bytes.next();for(var h=0,f=0,p=i;f<p;f++)h=h<<8|this.bytes.next();n===0&&(d=1);var g=c+u,_={ref:x_.of(g,h),offset:m,deleted:d===0,inObjectStream:d===2};e.push(_)}return e},e.forStream=function(t){return new e(t)},e}(),Ny=function(e){J(t,e);function t(t,n,r,i){n===void 0&&(n=1/0),r===void 0&&(r=!1),i===void 0&&(i=!1);var a=e.call(this,Cy.of(t),k_.create(),i)||this;return a.alreadyParsed=!1,a.parsedObjects=0,a.shouldWaitForTick=function(){return a.parsedObjects+=1,a.parsedObjects%a.objectsPerTick===0},a.objectsPerTick=n,a.throwOnInvalidObject=r,a}return t.prototype.parseDocument=function(){return hm(this,void 0,void 0,function(){var e,t;return gm(this,function(n){switch(n.label){case 0:if(this.alreadyParsed)throw new Ag(`PDFParser`,`parseDocument`);this.alreadyParsed=!0,this.context.header=this.parseHeader(),n.label=1;case 1:return this.bytes.done()?[3,3]:[4,this.parseDocumentSection()];case 2:if(n.sent(),t=this.bytes.offset(),t===e)throw new Xg(this.bytes.position());return e=t,[3,1];case 3:return this.maybeRecoverRoot(),this.context.lookup(x_.of(0))&&(console.warn(`Removing parsed object: 0 0 R`),this.context.delete(x_.of(0))),[2,this.context]}})})},t.prototype.maybeRecoverRoot=function(){var e=function(e){return e instanceof g_&&e.lookup(Q.of(`Type`))===Q.of(`Catalog`)};if(!e(this.context.lookup(this.context.trailerInfo.Root)))for(var t=this.context.enumerateIndirectObjects(),n=0,r=t.length;n<r;n++){var i=t[n],a=i[0],o=i[1];e(o)&&(this.context.trailerInfo.Root=a)}},t.prototype.parseHeader=function(){for(;!this.bytes.done();){if(this.matchKeyword(ky.header)){var e=this.parseRawInt();this.bytes.assertNext(Z.Period);var t=this.parseRawInt(),n=e_.forVersion(e,t);return this.skipBinaryHeaderComment(),n}this.bytes.next()}throw new Zg(this.bytes.position())},t.prototype.parseIndirectObjectHeader=function(){this.skipWhitespaceAndComments();var e=this.parseRawInt();this.skipWhitespaceAndComments();var t=this.parseRawInt();if(this.skipWhitespaceAndComments(),!this.matchKeyword(ky.obj))throw new Qg(this.bytes.position(),ky.obj);return x_.of(e,t)},t.prototype.matchIndirectObjectHeader=function(){var e=this.bytes.offset();try{return this.parseIndirectObjectHeader(),!0}catch{return this.bytes.moveTo(e),!1}},t.prototype.parseIndirectObject=function(){return hm(this,void 0,void 0,function(){var e,t;return gm(this,function(n){switch(n.label){case 0:return e=this.parseIndirectObjectHeader(),this.skipWhitespaceAndComments(),t=this.parseObject(),this.skipWhitespaceAndComments(),this.matchKeyword(ky.endobj),t instanceof v_&&t.dict.lookup(Q.of(`Type`))===Q.of(`ObjStm`)?[4,jy.forStream(t,this.shouldWaitForTick).parseIntoContext()]:[3,2];case 1:return n.sent(),[3,3];case 2:t instanceof v_&&t.dict.lookup(Q.of(`Type`))===Q.of(`XRef`)?My.forStream(t).parseIntoContext():this.context.assign(e,t),n.label=3;case 3:return[2,e]}})})},t.prototype.tryToParseInvalidIndirectObject=function(){var e=this.bytes.position(),t=`Trying to parse invalid object: `+JSON.stringify(e)+`)`;if(this.throwOnInvalidObject)throw Error(t);console.warn(t);var n=this.parseIndirectObjectHeader();console.warn(`Invalid object ref: `+n),this.skipWhitespaceAndComments();for(var r=this.bytes.offset(),i=!0;!this.bytes.done()&&(this.matchKeyword(ky.endobj)&&(i=!1),i);)this.bytes.next();if(i)throw new qg(e);var a=this.bytes.offset()-ky.endobj.length,o=L_.of(this.bytes.slice(r,a));return this.context.assign(n,o),n},t.prototype.parseIndirectObjects=function(){return hm(this,void 0,void 0,function(){var e;return gm(this,function(t){switch(t.label){case 0:this.skipWhitespaceAndComments(),t.label=1;case 1:if(!(!this.bytes.done()&&hy[this.bytes.peek()]))return[3,8];e=this.bytes.offset(),t.label=2;case 2:return t.trys.push([2,4,,5]),[4,this.parseIndirectObject()];case 3:return t.sent(),[3,5];case 4:return t.sent(),this.bytes.moveTo(e),this.tryToParseInvalidIndirectObject(),[3,5];case 5:return this.skipWhitespaceAndComments(),this.skipJibberish(),this.shouldWaitForTick()?[4,ah()]:[3,7];case 6:t.sent(),t.label=7;case 7:return[3,1];case 8:return[2]}})})},t.prototype.maybeParseCrossRefSection=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(ky.xref)){this.skipWhitespaceAndComments();for(var e=-1,t=M_.createEmpty();!this.bytes.done()&&hy[this.bytes.peek()];){var n=this.parseRawInt();this.skipWhitespaceAndComments();var r=this.parseRawInt();this.skipWhitespaceAndComments();var i=this.bytes.peek();if(i===Z.n||i===Z.f){var a=x_.of(e,r);this.bytes.next()===Z.n?t.addEntry(a,n):t.addDeletedEntry(a,n),e+=1}else e=n;this.skipWhitespaceAndComments()}return t}},t.prototype.maybeParseTrailerDict=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(ky.trailer)){this.skipWhitespaceAndComments();var e=this.parseDict(),t=this.context;t.trailerInfo={Root:e.get(Q.of(`Root`))||t.trailerInfo.Root,Encrypt:e.get(Q.of(`Encrypt`))||t.trailerInfo.Encrypt,Info:e.get(Q.of(`Info`))||t.trailerInfo.Info,ID:e.get(Q.of(`ID`))||t.trailerInfo.ID}}},t.prototype.maybeParseTrailer=function(){if(this.skipWhitespaceAndComments(),this.matchKeyword(ky.startxref)){this.skipWhitespaceAndComments();var e=this.parseRawInt();return this.skipWhitespace(),this.matchKeyword(ky.eof),this.skipWhitespaceAndComments(),this.matchKeyword(ky.eof),this.skipWhitespaceAndComments(),N_.forLastCrossRefSectionOffset(e)}},t.prototype.parseDocumentSection=function(){return hm(this,void 0,void 0,function(){return gm(this,function(e){switch(e.label){case 0:return[4,this.parseIndirectObjects()];case 1:return e.sent(),this.maybeParseCrossRefSection(),this.maybeParseTrailerDict(),this.maybeParseTrailer(),this.skipJibberish(),[2]}})})},t.prototype.skipJibberish=function(){for(this.skipWhitespaceAndComments();!this.bytes.done();){var e=this.bytes.offset(),t=this.bytes.peek();if(t>=Z.Space&&t<=Z.Tilde&&(this.matchKeyword(ky.xref)||this.matchKeyword(ky.trailer)||this.matchKeyword(ky.startxref)||this.matchIndirectObjectHeader())){this.bytes.moveTo(e);break}this.bytes.next()}},t.prototype.skipBinaryHeaderComment=function(){this.skipWhitespaceAndComments();try{var e=this.bytes.offset();this.parseIndirectObjectHeader(),this.bytes.moveTo(e)}catch{this.bytes.next(),this.skipWhitespaceAndComments()}},t.forBytesWithOptions=function(e,n,r,i){return new t(e,n,r,i)},t}(Ay),Py=function(e){return 1<<e},Fy;(function(e){e[e.Invisible=Py(0)]=`Invisible`,e[e.Hidden=Py(1)]=`Hidden`,e[e.Print=Py(2)]=`Print`,e[e.NoZoom=Py(3)]=`NoZoom`,e[e.NoRotate=Py(4)]=`NoRotate`,e[e.NoView=Py(5)]=`NoView`,e[e.ReadOnly=Py(6)]=`ReadOnly`,e[e.Locked=Py(7)]=`Locked`,e[e.ToggleNoView=Py(8)]=`ToggleNoView`,e[e.LockedContents=Py(9)]=`LockedContents`})(Fy||={});var Iy=function(e){return e instanceof Q?e:Q.of(e)},Ly=function(e){return e instanceof n_?e:n_.of(e)},Ry=function(e){return e instanceof n_?e.asNumber():e},zy;(function(e){e.Degrees=`degrees`,e.Radians=`radians`})(zy||={});var By=function(e){return Y(e,`degreeAngle`,[`number`]),{type:zy.Degrees,angle:e}},Vy=zy.Radians,Hy=zy.Degrees,Uy=function(e){return e*Math.PI/180},Wy=function(e){return e*180/Math.PI},Gy=function(e){return e.type===Vy?e.angle:e.type===Hy?Uy(e.angle):wh(`Invalid rotation: `+JSON.stringify(e))},Ky=function(e){return e.type===Vy?Wy(e.angle):e.type===Hy?e.angle:wh(`Invalid rotation: `+JSON.stringify(e))},qy=function(e){e===void 0&&(e=0);var t=e/90%4;return t===0?0:t===1?90:t===2?180:t===3?270:0},Jy=function(e,t){t===void 0&&(t=0);var n=qy(t);return n===90||n===270?{width:e.height,height:e.width}:{width:e.width,height:e.height}},Yy=function(e,t,n){t===void 0&&(t=0),n===void 0&&(n=0);var r=e.x,i=e.y,a=e.width,o=e.height,s=qy(n),c=t/2;return s===0?{x:r-c,y:i-c,width:a,height:o}:s===90?{x:r-o+c,y:i-c,width:o,height:a}:s===180?{x:r-a+c,y:i-o+c,width:a,height:o}:s===270?{x:r-c,y:i-a+c,width:o,height:a}:{x:r-c,y:i-c,width:a,height:o}},Xy=function(){return S_.of(w_.ClipNonZero)},Zy=Math.cos,Qy=Math.sin,$y=Math.tan,eb=function(e,t,n,r,i,a){return S_.of(w_.ConcatTransformationMatrix,[Ly(e),Ly(t),Ly(n),Ly(r),Ly(i),Ly(a)])},tb=function(e,t){return eb(1,0,0,1,e,t)},nb=function(e,t){return eb(e,0,0,t,0,0)},rb=function(e){return eb(Zy(Ry(e)),Qy(Ry(e)),-Qy(Ry(e)),Zy(Ry(e)),0,0)},ib=function(e){return rb(Uy(Ry(e)))},ab=function(e,t){return eb(1,$y(Ry(e)),$y(Ry(t)),1,0,0)},ob=function(e,t){return S_.of(w_.SetLineDashPattern,[`[`+e.map(Ly).join(` `)+`]`,Ly(t)])},sb;(function(e){e[e.Butt=0]=`Butt`,e[e.Round=1]=`Round`,e[e.Projecting=2]=`Projecting`})(sb||={});var cb=function(e){return S_.of(w_.SetLineCapStyle,[Ly(e)])},lb;(function(e){e[e.Miter=0]=`Miter`,e[e.Round=1]=`Round`,e[e.Bevel=2]=`Bevel`})(lb||={});var ub=function(e){return S_.of(w_.SetGraphicsStateParams,[Iy(e)])},db=function(){return S_.of(w_.PushGraphicsState)},fb=function(){return S_.of(w_.PopGraphicsState)},pb=function(e){return S_.of(w_.SetLineWidth,[Ly(e)])},mb=function(e,t,n,r,i,a){return S_.of(w_.AppendBezierCurve,[Ly(e),Ly(t),Ly(n),Ly(r),Ly(i),Ly(a)])},hb=function(e,t,n,r){return S_.of(w_.CurveToReplicateInitialPoint,[Ly(e),Ly(t),Ly(n),Ly(r)])},gb=function(){return S_.of(w_.ClosePath)},_b=function(e,t){return S_.of(w_.MoveTo,[Ly(e),Ly(t)])},vb=function(e,t){return S_.of(w_.LineTo,[Ly(e),Ly(t)])},yb=function(){return S_.of(w_.StrokePath)},bb=function(){return S_.of(w_.FillNonZero)},xb=function(){return S_.of(w_.FillNonZeroAndStroke)},Sb=function(){return S_.of(w_.EndPath)},Cb=function(){return S_.of(w_.NextLine)},wb=function(e){return S_.of(w_.ShowText,[e])},Tb=function(){return S_.of(w_.BeginText)},Eb=function(){return S_.of(w_.EndText)},Db=function(e,t){return S_.of(w_.SetFontAndSize,[Iy(e),Ly(t)])},Ob=function(e){return S_.of(w_.SetTextLineHeight,[Ly(e)])},kb;(function(e){e[e.Fill=0]=`Fill`,e[e.Outline=1]=`Outline`,e[e.FillAndOutline=2]=`FillAndOutline`,e[e.Invisible=3]=`Invisible`,e[e.FillAndClip=4]=`FillAndClip`,e[e.OutlineAndClip=5]=`OutlineAndClip`,e[e.FillAndOutlineAndClip=6]=`FillAndOutlineAndClip`,e[e.Clip=7]=`Clip`})(kb||={});var Ab=function(e,t,n,r,i,a){return S_.of(w_.SetTextMatrix,[Ly(e),Ly(t),Ly(n),Ly(r),Ly(i),Ly(a)])},jb=function(e,t,n,r,i){return Ab(Zy(Ry(e)),Qy(Ry(e))+$y(Ry(t)),-Qy(Ry(e))+$y(Ry(n)),Zy(Ry(e)),r,i)},Mb=function(e){return S_.of(w_.DrawObject,[Iy(e)])},Nb=function(e){return S_.of(w_.NonStrokingColorGray,[Ly(e)])},Pb=function(e){return S_.of(w_.StrokingColorGray,[Ly(e)])},Fb=function(e,t,n){return S_.of(w_.NonStrokingColorRgb,[Ly(e),Ly(t),Ly(n)])},Ib=function(e,t,n){return S_.of(w_.StrokingColorRgb,[Ly(e),Ly(t),Ly(n)])},Lb=function(e,t,n,r){return S_.of(w_.NonStrokingColorCmyk,[Ly(e),Ly(t),Ly(n),Ly(r)])},Rb=function(e,t,n,r){return S_.of(w_.StrokingColorCmyk,[Ly(e),Ly(t),Ly(n),Ly(r)])},zb=function(e){return S_.of(w_.BeginMarkedContent,[Iy(e)])},Bb=function(){return S_.of(w_.EndMarkedContent)},Vb;(function(e){e.Grayscale=`Grayscale`,e.RGB=`RGB`,e.CMYK=`CMYK`})(Vb||={});var Hb=function(e){return _g(e,`gray`,0,1),{type:Vb.Grayscale,gray:e}},Ub=function(e,t,n){return _g(e,`red`,0,1),_g(t,`green`,0,1),_g(n,`blue`,0,1),{type:Vb.RGB,red:e,green:t,blue:n}},Wb=function(e,t,n,r){return _g(e,`cyan`,0,1),_g(t,`magenta`,0,1),_g(n,`yellow`,0,1),_g(r,`key`,0,1),{type:Vb.CMYK,cyan:e,magenta:t,yellow:n,key:r}},Gb=Vb.Grayscale,Kb=Vb.RGB,qb=Vb.CMYK,Jb=function(e){return e.type===Gb?Nb(e.gray):e.type===Kb?Fb(e.red,e.green,e.blue):e.type===qb?Lb(e.cyan,e.magenta,e.yellow,e.key):wh(`Invalid color: `+JSON.stringify(e))},Yb=function(e){return e.type===Gb?Pb(e.gray):e.type===Kb?Ib(e.red,e.green,e.blue):e.type===qb?Rb(e.cyan,e.magenta,e.yellow,e.key):wh(`Invalid color: `+JSON.stringify(e))},Xb=function(e,t){return t===void 0&&(t=1),e?.length===1?Hb(e[0]*t):e?.length===3?Ub(e[0]*t,e[1]*t,e[2]*t):e?.length===4?Wb(e[0]*t,e[1]*t,e[2]*t,e[3]*t):void 0},Zb=function(e){return e.type===Gb?[e.gray]:e.type===Kb?[e.red,e.green,e.blue]:e.type===qb?[e.cyan,e.magenta,e.yellow,e.key]:wh(`Invalid color: `+JSON.stringify(e))},Qb=0,$b=0,ex=0,tx=0,nx=0,rx=0,ix=new Map([[`A`,7],[`a`,7],[`C`,6],[`c`,6],[`H`,1],[`h`,1],[`L`,2],[`l`,2],[`M`,2],[`m`,2],[`Q`,4],[`q`,4],[`S`,4],[`s`,4],[`T`,2],[`t`,2],[`V`,1],[`v`,1],[`Z`,0],[`z`,0]]),ax=function(e){for(var t,n=[],r=[],i=``,a=!1,o=0,s=0,c=e;s<c.length;s++){var l=c[s];if(ix.has(l))o=ix.get(l),t&&(i.length>0&&(r[r.length]=+i),n[n.length]={cmd:t,args:r},r=[],i=``,a=!1),t=l;else if([` `,`,`].includes(l)||l===`-`&&i.length>0&&i[i.length-1]!==`e`||l===`.`&&a){if(i.length===0)continue;r.length===o?(n[n.length]={cmd:t,args:r},r=[+i],t===`M`&&(t=`L`),t===`m`&&(t=`l`)):r[r.length]=+i,a=l===`.`,i=[`-`,`.`].includes(l)?l:``}else i+=l,l===`.`&&(a=!0)}return i.length>0&&(r.length===o?(n[n.length]={cmd:t,args:r},r=[+i],t===`M`&&(t=`L`),t===`m`&&(t=`l`)):r[r.length]=+i),n[n.length]={cmd:t,args:r},n},ox=function(e){Qb=$b=ex=tx=nx=rx=0;for(var t=[],n=0;n<e.length;n++){var r=e[n];if(r.cmd&&typeof sx[r.cmd]==`function`){var i=sx[r.cmd](r.args);Array.isArray(i)?t=t.concat(i):t.push(i)}}return t},sx={M:function(e){return Qb=e[0],$b=e[1],ex=tx=null,nx=Qb,rx=$b,_b(Qb,$b)},m:function(e){return Qb+=e[0],$b+=e[1],ex=tx=null,nx=Qb,rx=$b,_b(Qb,$b)},C:function(e){return Qb=e[4],$b=e[5],ex=e[2],tx=e[3],mb(e[0],e[1],e[2],e[3],e[4],e[5])},c:function(e){var t=mb(e[0]+Qb,e[1]+$b,e[2]+Qb,e[3]+$b,e[4]+Qb,e[5]+$b);return ex=Qb+e[2],tx=$b+e[3],Qb+=e[4],$b+=e[5],t},S:function(e){(ex===null||tx===null)&&(ex=Qb,tx=$b);var t=mb(Qb-(ex-Qb),$b-(tx-$b),e[0],e[1],e[2],e[3]);return ex=e[0],tx=e[1],Qb=e[2],$b=e[3],t},s:function(e){(ex===null||tx===null)&&(ex=Qb,tx=$b);var t=mb(Qb-(ex-Qb),$b-(tx-$b),Qb+e[0],$b+e[1],Qb+e[2],$b+e[3]);return ex=Qb+e[0],tx=$b+e[1],Qb+=e[2],$b+=e[3],t},Q:function(e){return ex=e[0],tx=e[1],Qb=e[2],$b=e[3],hb(e[0],e[1],Qb,$b)},q:function(e){var t=hb(e[0]+Qb,e[1]+$b,e[2]+Qb,e[3]+$b);return ex=Qb+e[0],tx=$b+e[1],Qb+=e[2],$b+=e[3],t},T:function(e){ex===null||tx===null?(ex=Qb,tx=$b):(ex=Qb-(ex-Qb),tx=$b-(tx-$b));var t=hb(ex,tx,e[0],e[1]);return ex=Qb-(ex-Qb),tx=$b-(tx-$b),Qb=e[0],$b=e[1],t},t:function(e){ex===null||tx===null?(ex=Qb,tx=$b):(ex=Qb-(ex-Qb),tx=$b-(tx-$b));var t=hb(ex,tx,Qb+e[0],$b+e[1]);return Qb+=e[0],$b+=e[1],t},A:function(e){var t=cx(Qb,$b,e);return Qb=e[5],$b=e[6],t},a:function(e){e[5]+=Qb,e[6]+=$b;var t=cx(Qb,$b,e);return Qb=e[5],$b=e[6],t},L:function(e){return Qb=e[0],$b=e[1],ex=tx=null,vb(Qb,$b)},l:function(e){return Qb+=e[0],$b+=e[1],ex=tx=null,vb(Qb,$b)},H:function(e){return Qb=e[0],ex=tx=null,vb(Qb,$b)},h:function(e){return Qb+=e[0],ex=tx=null,vb(Qb,$b)},V:function(e){return $b=e[0],ex=tx=null,vb(Qb,$b)},v:function(e){return $b+=e[0],ex=tx=null,vb(Qb,$b)},Z:function(){var e=gb();return Qb=nx,$b=rx,e},z:function(){var e=gb();return Qb=nx,$b=rx,e}},cx=function(e,t,n){for(var r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=lx(c,l,r,i,o,s,a,e,t),d=[],f=0,p=u;f<p.length;f++){var m=p[f],h=ux.apply(void 0,m);d.push(mb.apply(void 0,h))}return d},lx=function(e,t,n,r,i,a,o,s,c){var l=Math.PI/180*o,u=Math.sin(l),d=Math.cos(l);n=Math.abs(n),r=Math.abs(r),ex=d*(s-e)*.5+u*(c-t)*.5,tx=d*(c-t)*.5-u*(s-e)*.5;var f=ex*ex/(n*n)+tx*tx/(r*r);f>1&&(f=Math.sqrt(f),n*=f,r*=f);var p=d/n,m=u/n,h=-u/r,g=d/r,_=p*s+m*c,v=h*s+g*c,y=p*e+m*t,b=h*e+g*t,x=1/((y-_)*(y-_)+(b-v)*(b-v))-.25;x<0&&(x=0);var S=Math.sqrt(x);a===i&&(S=-S);var C=.5*(_+y)-S*(b-v),w=.5*(v+b)+S*(y-_),T=Math.atan2(v-w,_-C),E=Math.atan2(b-w,y-C)-T;E<0&&a===1?E+=2*Math.PI:E>0&&a===0&&(E-=2*Math.PI);for(var D=Math.ceil(Math.abs(E/(Math.PI*.5+.001))),O=[],k=0;k<D;k++)O[k]=[C,w,T+k*E/D,T+(k+1)*E/D,n,r,u,d];return O},ux=function(e,t,n,r,i,a,o,s){var c=s*i,l=-o*a,u=o*i,d=s*a,f=.5*(r-n),p=8/3*Math.sin(f*.5)*Math.sin(f*.5)/Math.sin(f),m=e+Math.cos(n)-p*Math.sin(n),h=t+Math.sin(n)+p*Math.cos(n),g=e+Math.cos(r),_=t+Math.sin(r),v=g+p*Math.sin(r),y=_-p*Math.cos(r);return[c*m+l*h,u*m+d*h,c*v+l*y,u*v+d*y,c*g+l*_,u*g+d*_]},dx=function(e){return ox(ax(e))},fx=function(e,t){for(var n=[db(),t.graphicsState&&ub(t.graphicsState),Tb(),Jb(t.color),Db(t.font,t.size),Ob(t.lineHeight),jb(Gy(t.rotate),Gy(t.xSkew),Gy(t.ySkew),t.x,t.y)].filter(Boolean),r=0,i=e.length;r<i;r++)n.push(wb(e[r]),Cb());return n.push(Eb(),fb()),n},px=function(e,t){return[db(),t.graphicsState&&ub(t.graphicsState),tb(t.x,t.y),rb(Gy(t.rotate)),nb(t.width,t.height),ab(Gy(t.xSkew),Gy(t.ySkew)),Mb(e),fb()].filter(Boolean)},mx=function(e,t){return[db(),t.graphicsState&&ub(t.graphicsState),tb(t.x,t.y),rb(Gy(t.rotate)),nb(t.xScale,t.yScale),ab(Gy(t.xSkew),Gy(t.ySkew)),Mb(e),fb()].filter(Boolean)},hx=function(e){return[db(),e.graphicsState&&ub(e.graphicsState),e.color&&Yb(e.color),pb(e.thickness),ob(e.dashArray??[],e.dashPhase??0),_b(e.start.x,e.start.y),e.lineCap&&cb(e.lineCap),_b(e.start.x,e.start.y),vb(e.end.x,e.end.y),yb(),fb()].filter(Boolean)},gx=function(e){return[db(),e.graphicsState&&ub(e.graphicsState),e.color&&Jb(e.color),e.borderColor&&Yb(e.borderColor),pb(e.borderWidth),e.borderLineCap&&cb(e.borderLineCap),ob(e.borderDashArray??[],e.borderDashPhase??0),tb(e.x,e.y),rb(Gy(e.rotate)),ab(Gy(e.xSkew),Gy(e.ySkew)),_b(0,0),vb(0,e.height),vb(e.width,e.height),vb(e.width,0),gb(),e.color&&e.borderWidth?xb():e.color?bb():e.borderColor?yb():gb(),fb()].filter(Boolean)},_x=4*((Math.sqrt(2)-1)/3),vx=function(e){var t=Ry(e.x),n=Ry(e.y),r=Ry(e.xScale),i=Ry(e.yScale);t-=r,n-=i;var a=r*_x,o=i*_x,s=t+r*2,c=n+i*2,l=t+r,u=n+i;return[db(),_b(t,u),mb(t,u-o,l-a,n,l,n),mb(l+a,n,s,u-o,s,u),mb(s,u+o,l+a,c,l,c),mb(l-a,c,t,u+o,t,u),fb()]},yx=function(e){var t=Ry(e.x),n=Ry(e.y),r=Ry(e.xScale),i=Ry(e.yScale),a=-r,o=-i,s=r*_x,c=i*_x,l=a+r*2,u=o+i*2,d=a+r,f=o+i;return[tb(t,n),rb(Gy(e.rotate)),_b(a,f),mb(a,f-c,d-s,o,d,o),mb(d+s,o,l,f-c,l,f),mb(l,f+c,d+s,u,d,u),mb(d-s,u,a,f+c,a,f)]},bx=function(e){return _m([db(),e.graphicsState&&ub(e.graphicsState),e.color&&Jb(e.color),e.borderColor&&Yb(e.borderColor),pb(e.borderWidth),e.borderLineCap&&cb(e.borderLineCap),ob(e.borderDashArray??[],e.borderDashPhase??0)],e.rotate===void 0?vx({x:e.x,y:e.y,xScale:e.xScale,yScale:e.yScale}):yx({x:e.x,y:e.y,xScale:e.xScale,yScale:e.yScale,rotate:e.rotate??By(0)}),[e.color&&e.borderWidth?xb():e.color?bb():e.borderColor?yb():gb(),fb()]).filter(Boolean)},xx=function(e,t){return _m([db(),t.graphicsState&&ub(t.graphicsState),tb(t.x,t.y),rb(Gy(t.rotate??By(0))),t.scale?nb(t.scale,-t.scale):nb(1,-1),t.color&&Jb(t.color),t.borderColor&&Yb(t.borderColor),t.borderWidth&&pb(t.borderWidth),t.borderLineCap&&cb(t.borderLineCap),ob(t.borderDashArray??[],t.borderDashPhase??0)],dx(e),[t.color&&t.borderWidth?xb():t.color?bb():t.borderColor?yb():gb(),fb()]).filter(Boolean)},Sx=function(e){var t=Ry(e.size),n=-.25,r=-.49,i=.475,a=.69,o=-.675,s=-((o-n)*(a-n))/(i-r)+r;return[db(),e.color&&Yb(e.color),pb(e.thickness),tb(e.x,e.y),_b(o*t,s*t),vb(n*t,r*t),vb(a*t,i*t),yb(),fb()].filter(Boolean)},Cx=function(e){return e.rotation===0?[tb(0,0),ib(0)]:e.rotation===90?[tb(e.width,0),ib(90)]:e.rotation===180?[tb(e.width,e.height),ib(180)]:e.rotation===270?[tb(0,e.height),ib(270)]:[]},wx=function(e){var t=gx({x:e.x,y:e.y,width:e.width,height:e.height,borderWidth:e.borderWidth,color:e.color,borderColor:e.borderColor,rotate:By(0),xSkew:By(0),ySkew:By(0)});if(!e.filled)return t;var n=Ry(e.width),r=Ry(e.height),i=Math.min(n,r)/2,a=Sx({x:n/2,y:r/2,size:i,thickness:e.thickness,color:e.markColor});return _m([db()],t,a,[fb()])},Tx=function(e){var t=Ry(e.width),n=Ry(e.height),r=Math.min(t,n)/2,i=bx({x:e.x,y:e.y,xScale:r,yScale:r,color:e.color,borderColor:e.borderColor,borderWidth:e.borderWidth});if(!e.filled)return i;var a=bx({x:e.x,y:e.y,xScale:r*.45,yScale:r*.45,color:e.dotColor,borderColor:void 0,borderWidth:0});return _m([db()],i,a,[fb()])},Ex=function(e){var t=gx({x:Ry(e.x),y:Ry(e.y),width:Ry(e.width),height:Ry(e.height),borderWidth:e.borderWidth,color:e.color,borderColor:e.borderColor,rotate:By(0),xSkew:By(0),ySkew:By(0)}),n=Dx(e.textLines,{color:e.textColor,font:e.font,size:e.fontSize,rotate:By(0),xSkew:By(0),ySkew:By(0)});return _m([db()],t,n,[fb()])},Dx=function(e,t){for(var n=[Tb(),Jb(t.color),Db(t.font,t.size)],r=0,i=e.length;r<i;r++){var a=e[r],o=a.encoded,s=a.x,c=a.y;n.push(jb(Gy(t.rotate),Gy(t.xSkew),Gy(t.ySkew),s,c),wb(o))}return n.push(Eb()),n},Ox=function(e){var t=Ry(e.x),n=Ry(e.y),r=Ry(e.width),i=Ry(e.height),a=Ry(e.borderWidth),o=Ry(e.padding),s=t+a/2+o,c=n+a/2+o,l=r-(a/2+o)*2,u=i-(a/2+o)*2,d=[_b(s,c),vb(s,c+u),vb(s+l,c+u),vb(s+l,c),gb(),Xy(),Sb()],f=gx({x:t,y:n,width:r,height:i,borderWidth:e.borderWidth,color:e.color,borderColor:e.borderColor,rotate:By(0),xSkew:By(0),ySkew:By(0)}),p=Dx(e.textLines,{color:e.textColor,font:e.font,size:e.fontSize,rotate:By(0),xSkew:By(0),ySkew:By(0)}),m=_m([zb(`Tx`),db()],p,[fb(),Bb()]);return _m([db()],f,d,m,[fb()])},kx=function(e){for(var t=Ry(e.x),n=Ry(e.y),r=Ry(e.width),i=Ry(e.height),a=Ry(e.lineHeight),o=Ry(e.borderWidth),s=Ry(e.padding),c=t+o/2+s,l=n+o/2+s,u=r-(o/2+s)*2,d=i-(o/2+s)*2,f=[_b(c,l),vb(c,l+d),vb(c+u,l+d),vb(c+u,l),gb(),Xy(),Sb()],p=gx({x:t,y:n,width:r,height:i,borderWidth:e.borderWidth,color:e.color,borderColor:e.borderColor,rotate:By(0),xSkew:By(0),ySkew:By(0)}),m=[],h=0,g=e.selectedLines.length;h<g;h++){var _=e.textLines[e.selectedLines[h]];m.push.apply(m,gx({x:_.x-s,y:_.y-(a-_.height)/2,width:r-o,height:_.height+(a-_.height)/2,borderWidth:0,color:e.selectedColor,borderColor:void 0,rotate:By(0),xSkew:By(0),ySkew:By(0)}))}var v=Dx(e.textLines,{color:e.textColor,font:e.font,size:e.fontSize,rotate:By(0),xSkew:By(0),ySkew:By(0)}),y=_m([zb(`Tx`),db()],v,[fb(),Bb()]);return _m([db()],p,m,f,y,[fb()])},Ax=function(e){J(t,e);function t(){var t=this;return t=e.call(this,"Input document to `PDFDocument.load` is encrypted. You can use `PDFDocument.load(..., { ignoreEncryption: true })` if you wish to load the document anyways.")||this,t}return t}(Error),jx=function(e){J(t,e);function t(){var t=this;return t=e.call(this,"Input to `PDFDocument.embedFont` was a custom font, but no `fontkit` instance was found. You must register a `fontkit` instance with `PDFDocument.registerFontkit(...)` before embedding custom fonts.")||this,t}return t}(Error),Mx=function(e){J(t,e);function t(){var t=this;return t=e.call(this,"A `page` passed to `PDFDocument.addPage` or `PDFDocument.insertPage` was from a different (foreign) PDF document. If you want to copy pages from one PDFDocument to another, you must use `PDFDocument.copyPages(...)` to copy the pages before adding or inserting them.")||this,t}return t}(Error),Nx=function(e){J(t,e);function t(){var t=this;return t=e.call(this,"PDFDocument has no pages so `PDFDocument.removePage` cannot be called")||this,t}return t}(Error),Px=function(e){J(t,e);function t(t){var n=this,r=`PDFDocument has no form field with the name "`+t+`"`;return n=e.call(this,r)||this,n}return t}(Error),Fx=function(e){J(t,e);function t(t,n,r){var i=this,a=n?.name,o=r?.constructor?.name??r,s=`Expected field "`+t+`" to be of type `+a+`, `+(`but it is actually of type `+o);return i=e.call(this,s)||this,i}return t}(Error);(function(e){J(t,e);function t(t){var n=this,r=`Failed to select check box due to missing onValue: "`+t+`"`;return n=e.call(this,r)||this,n}return t})(Error);var Ix=function(e){J(t,e);function t(t){var n=this,r=`A field already exists with the specified name: "`+t+`"`;return n=e.call(this,r)||this,n}return t}(Error),Lx=function(e){J(t,e);function t(t){var n=this,r=`Field name contains invalid component: "`+t+`"`;return n=e.call(this,r)||this,n}return t}(Error);(function(e){J(t,e);function t(t){var n=this,r=`A non-terminal field already exists with the specified name: "`+t+`"`;return n=e.call(this,r)||this,n}return t})(Error);var Rx=function(e){J(t,e);function t(t){var n=this,r=`Reading rich text fields is not supported: Attempted to read rich text field: `+t;return n=e.call(this,r)||this,n}return t}(Error),zx=function(e){J(t,e);function t(t,n){var r=this,i=`Failed to layout combed text as lineLength=`+t+` is greater than cellCount=`+n;return r=e.call(this,i)||this,r}return t}(Error),Bx=function(e){J(t,e);function t(t,n,r){var i=this,a=`Attempted to set text with length=`+t+` for TextField with maxLength=`+n+` and name=`+r;return i=e.call(this,a)||this,i}return t}(Error),Vx=function(e){J(t,e);function t(t,n,r){var i=this,a=`Attempted to set maxLength=`+n+`, which is less than `+t+`, the length of this field's current value (name=`+r+`)`;return i=e.call(this,a)||this,i}return t}(Error),Hx;(function(e){e[e.Left=0]=`Left`,e[e.Center=1]=`Center`,e[e.Right=2]=`Right`})(Hx||={});var Ux=4,Wx=500,Gx=function(e,t,n,r){r===void 0&&(r=!1);for(var i=Ux;i<Wx;){for(var a=0,o=0,s=e.length;o<s;o++){a+=1;for(var c=e[o].split(` `),l=n.width,u=0,d=c.length;u<d;u++){var f=u===d-1?c[u]:c[u]+` `,p=t.widthOfTextAtSize(f,i);l-=p,l<=0&&(a+=1,l=n.width-p)}}if(!r&&a>e.length)return i-1;var m=t.heightAtSize(i);if((m+m*.2)*a>Math.abs(n.height))return i-1;i+=1}return i},Kx=function(e,t,n,r){for(var i=n.width/r,a=n.height,o=Ux,s=Bm(e);o<Wx;){for(var c=0,l=s.length;c<l;c++){var u=s[c];if(t.widthOfTextAtSize(u,o)>i*.75)return o-1}if(t.heightAtSize(o,{descender:!1})>a)return o-1;o+=1}return o},qx=function(e){for(var t=e.length;t>0;t--)if(/\s/.test(e[t]))return t},Jx=function(e,t,n,r){for(var i=e.length;i>0;){var a=e.substring(0,i),o=n.encodeText(a),s=n.widthOfTextAtSize(a,r);if(s<t)return{line:a,encoded:o,width:s,remainder:e.substring(i)||void 0};i=qx(a)??0}return{line:e,encoded:n.encodeText(e),width:n.widthOfTextAtSize(e,r),remainder:void 0}},Yx=function(e,t){var n=t.alignment,r=t.fontSize,i=t.font,a=t.bounds,o=Lm(Pm(e));(r===void 0||r===0)&&(r=Gx(o,i,a,!0));for(var s=i.heightAtSize(r),c=s+s*.2,l=[],u=a.x,d=a.y,f=a.x+a.width,p=a.y+a.height,m=a.y+a.height,h=0,g=o.length;h<g;h++)for(var _=o[h];_!==void 0;){var v=Jx(_,a.width,i,r),y=v.line,b=v.encoded,x=v.width,S=v.remainder,C=n===Hx.Left?a.x:n===Hx.Center?a.x+a.width/2-x/2:n===Hx.Right?a.x+a.width-x:a.x;m-=c,C<u&&(u=C),m<d&&(d=m),C+x>f&&(f=C+x),m+s>p&&(p=m+s),l.push({text:y,encoded:b,width:x,height:s,x:C,y:m}),_=S?.trim()}return{fontSize:r,lineHeight:c,lines:l,bounds:{x:u,y:d,width:f-u,height:p-d}}},Xx=function(e,t){var n=t.fontSize,r=t.font,i=t.bounds,a=t.cellCount,o=Rm(Pm(e));if(o.length>a)throw new zx(o.length,a);(n===void 0||n===0)&&(n=Kx(o,r,i,a));for(var s=i.width/a,c=r.heightAtSize(n,{descender:!1}),l=i.y+(i.height/2-c/2),u=[],d=i.x,f=i.y,p=i.x+i.width,m=i.y+i.height,h=0,g=0;h<a;){var _=zm(o,g),v=_[0],y=_[1],b=r.encodeText(v),x=r.widthOfTextAtSize(v,n),S=i.x+(s*h+s/2)-x/2;S<d&&(d=S),l<f&&(f=l),S+x>p&&(p=S+x),l+c>m&&(m=l+c),u.push({text:o,encoded:b,width:x,height:c,x:S,y:l}),h+=1,g+=y}return{fontSize:n,cells:u,bounds:{x:d,y:f,width:p-d,height:m-f}}},Zx=function(e,t){var n=t.alignment,r=t.fontSize,i=t.font,a=t.bounds,o=Rm(Pm(e));(r===void 0||r===0)&&(r=Gx([o],i,a));var s=i.encodeText(o),c=i.widthOfTextAtSize(o,r),l=i.heightAtSize(r,{descender:!1}),u=n===Hx.Left?a.x:n===Hx.Center?a.x+a.width/2-c/2:n===Hx.Right?a.x+a.width-c:a.x,d=a.y+(a.height/2-l/2);return{fontSize:r,line:{text:o,encoded:s,width:c,height:l,x:u,y:d},bounds:{x:u,y:d,width:c,height:l}}},Qx=function(e){return`normal`in e?e:{normal:e}},$x=/\/([^\0\t\n\f\r\ ]+)[\0\t\n\f\r\ ]+(\d*\.\d+|\d+)[\0\t\n\f\r\ ]+Tf/,eS=function(e){var t=Gm(e.getDefaultAppearance()??``,$x).match??[],n=Number(t[2]);return isFinite(n)?n:void 0},tS=/(\d*\.\d+|\d+)[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]*(\d*\.\d+|\d+)?[\0\t\n\f\r\ ]+(g|rg|k)/,nS=function(e){var t=Gm(e.getDefaultAppearance()??``,tS).match??[],n=t[1],r=t[2],i=t[3],a=t[4],o=t[5];if(o===`g`&&n)return Hb(Number(n));if(o===`rg`&&n&&r&&i)return Ub(Number(n),Number(r),Number(i));if(o===`k`&&n&&r&&i&&a)return Wb(Number(n),Number(r),Number(i),Number(a))},rS=function(e,t,n,r){r===void 0&&(r=0);var i=[Jb(t).toString(),Db(n?.name??`dummy__noop`,r).toString()].join(`
|
|
77
|
+
`);e.setDefaultAppearance(i)},iS=function(e,t){var n=nS(t),r=nS(e.acroField),i=t.getRectangle(),a=t.getAppearanceCharacteristics(),o=t.getBorderStyle()?.getWidth()??0,s=qy(a?.getRotation()),c=Jy(i,s),l=c.width,u=c.height,d=Cx(pm(pm({},i),{rotation:s})),f=Ub(0,0,0),p=Xb(a?.getBorderColor())??f,m=Xb(a?.getBackgroundColor()),h=Xb(a?.getBackgroundColor(),.8),g=n??r??f;rS(n?t:e.acroField,g);var _={x:0+o/2,y:0+o/2,width:l-o,height:u-o,thickness:1.5,borderWidth:o,borderColor:p,markColor:g};return{normal:{on:_m(d,wx(pm(pm({},_),{color:m,filled:!0}))),off:_m(d,wx(pm(pm({},_),{color:m,filled:!1})))},down:{on:_m(d,wx(pm(pm({},_),{color:h,filled:!0}))),off:_m(d,wx(pm(pm({},_),{color:h,filled:!1})))}}},aS=function(e,t){var n=nS(t),r=nS(e.acroField),i=t.getRectangle(),a=t.getAppearanceCharacteristics(),o=t.getBorderStyle()?.getWidth()??0,s=qy(a?.getRotation()),c=Jy(i,s),l=c.width,u=c.height,d=Cx(pm(pm({},i),{rotation:s})),f=Ub(0,0,0),p=Xb(a?.getBorderColor())??f,m=Xb(a?.getBackgroundColor()),h=Xb(a?.getBackgroundColor(),.8),g=n??r??f;rS(n?t:e.acroField,g);var _={x:l/2,y:u/2,width:l-o,height:u-o,borderWidth:o,borderColor:p,dotColor:g};return{normal:{on:_m(d,Tx(pm(pm({},_),{color:m,filled:!0}))),off:_m(d,Tx(pm(pm({},_),{color:m,filled:!1})))},down:{on:_m(d,Tx(pm(pm({},_),{color:h,filled:!0}))),off:_m(d,Tx(pm(pm({},_),{color:h,filled:!1})))}}},oS=function(e,t,n){var r=nS(t),i=nS(e.acroField),a=eS(t),o=eS(e.acroField),s=t.getRectangle(),c=t.getAppearanceCharacteristics(),l=t.getBorderStyle(),u=c?.getCaptions(),d=u?.normal??``,f=u?.down??d??``,p=l?.getWidth()??0,m=qy(c?.getRotation()),h=Jy(s,m),g=h.width,_=h.height,v=Cx(pm(pm({},s),{rotation:m})),y=Ub(0,0,0),b=Xb(c?.getBorderColor()),x=Xb(c?.getBackgroundColor()),S=Xb(c?.getBackgroundColor(),.8),C={x:p,y:p,width:g-p*2,height:_-p*2},w=Zx(d,{alignment:Hx.Center,fontSize:a??o,font:n,bounds:C}),T=Zx(f,{alignment:Hx.Center,fontSize:a??o,font:n,bounds:C}),E=Math.min(w.fontSize,T.fontSize),D=r??i??y;rS(r||a!==void 0?t:e.acroField,D,n,E);var O={x:0+p/2,y:0+p/2,width:g-p,height:_-p,borderWidth:p,borderColor:b,textColor:D,font:n.name,fontSize:E};return{normal:_m(v,Ex(pm(pm({},O),{color:x,textLines:[w.line]}))),down:_m(v,Ex(pm(pm({},O),{color:S,textLines:[T.line]})))}},sS=function(e,t,n){var r=nS(t),i=nS(e.acroField),a=eS(t),o=eS(e.acroField),s=t.getRectangle(),c=t.getAppearanceCharacteristics(),l=t.getBorderStyle(),u=e.getText()??``,d=l?.getWidth()??0,f=qy(c?.getRotation()),p=Jy(s,f),m=p.width,h=p.height,g=Cx(pm(pm({},s),{rotation:f})),_=Ub(0,0,0),v=Xb(c?.getBorderColor()),y=Xb(c?.getBackgroundColor()),b,x,S=+!e.isCombed(),C={x:d+S,y:d+S,width:m-(d+S)*2,height:h-(d+S)*2};if(e.isMultiline()){var w=Yx(u,{alignment:e.getAlignment(),fontSize:a??o,font:n,bounds:C});b=w.lines,x=w.fontSize}else if(e.isCombed()){var w=Xx(u,{fontSize:a??o,font:n,bounds:C,cellCount:e.getMaxLength()??0});b=w.cells,x=w.fontSize}else{var w=Zx(u,{alignment:e.getAlignment(),fontSize:a??o,font:n,bounds:C});b=[w.line],x=w.fontSize}var T=r??i??_;return rS(r||a!==void 0?t:e.acroField,T,n,x),_m(g,Ox({x:0+d/2,y:0+d/2,width:m-d,height:h-d,borderWidth:d??0,borderColor:v,textColor:T,font:n.name,fontSize:x,color:y,textLines:b,padding:S}))},cS=function(e,t,n){var r=nS(t),i=nS(e.acroField),a=eS(t),o=eS(e.acroField),s=t.getRectangle(),c=t.getAppearanceCharacteristics(),l=t.getBorderStyle(),u=e.getSelected()[0]??``,d=l?.getWidth()??0,f=qy(c?.getRotation()),p=Jy(s,f),m=p.width,h=p.height,g=Cx(pm(pm({},s),{rotation:f})),_=Ub(0,0,0),v=Xb(c?.getBorderColor()),y=Xb(c?.getBackgroundColor()),b=1,x={x:d+b,y:d+b,width:m-(d+b)*2,height:h-(d+b)*2},S=Zx(u,{alignment:Hx.Left,fontSize:a??o,font:n,bounds:x}),C=S.line,w=S.fontSize,T=r??i??_;return rS(r||a!==void 0?t:e.acroField,T,n,w),_m(g,Ox({x:0+d/2,y:0+d/2,width:m-d,height:h-d,borderWidth:d??0,borderColor:v,textColor:T,font:n.name,fontSize:w,color:y,textLines:[C],padding:b}))},lS=function(e,t,n){var r=nS(t),i=nS(e.acroField),a=eS(t),o=eS(e.acroField),s=t.getRectangle(),c=t.getAppearanceCharacteristics(),l=t.getBorderStyle()?.getWidth()??0,u=qy(c?.getRotation()),d=Jy(s,u),f=d.width,p=d.height,m=Cx(pm(pm({},s),{rotation:u})),h=Ub(0,0,0),g=Xb(c?.getBorderColor()),_=Xb(c?.getBackgroundColor()),v=e.getOptions(),y=e.getSelected();e.isSorted()&&v.sort();for(var b=``,x=0,S=v.length;x<S;x++)b+=v[x],x<S-1&&(b+=`
|
|
78
|
+
`);for(var C=1,w={x:l+C,y:l+C,width:f-(l+C)*2,height:p-(l+C)*2},T=Yx(b,{alignment:Hx.Left,fontSize:a??o,font:n,bounds:w}),E=T.lines,D=T.fontSize,O=T.lineHeight,k=[],x=0,S=E.length;x<S;x++){var A=E[x];y.includes(A.text)&&k.push(x)}var j=Ub(153/255,193/255,218/255),M=r??i??h;return rS(r||a!==void 0?t:e.acroField,M,n,D),_m(m,kx({x:0+l/2,y:0+l/2,width:f-l,height:p-l,borderWidth:l??0,borderColor:g,textColor:M,font:n.name,fontSize:D,color:_,textLines:E,lineHeight:O,selectedColor:j,selectedLines:k,padding:C}))},uS=function(){function e(e,t,n){this.alreadyEmbedded=!1,Y(e,`ref`,[[x_,`PDFRef`]]),Y(t,`doc`,[[MS,`PDFDocument`]]),Y(n,`embedder`,[[Ov,`PDFPageEmbedder`]]),this.ref=e,this.doc=t,this.width=n.width,this.height=n.height,this.embedder=n}return e.prototype.scale=function(e){return Y(e,`factor`,[`number`]),{width:this.width*e,height:this.height*e}},e.prototype.size=function(){return this.scale(1)},e.prototype.embed=function(){return hm(this,void 0,void 0,function(){return gm(this,function(e){switch(e.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:e.sent(),this.alreadyEmbedded=!0,e.label=2;case 2:return[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}(),dS=function(){function e(e,t,n){this.modified=!0,Y(e,`ref`,[[x_,`PDFRef`]]),Y(t,`doc`,[[MS,`PDFDocument`]]),Y(n,`embedder`,[[Z_,`CustomFontEmbedder`],[H_,`StandardFontEmbedder`]]),this.ref=e,this.doc=t,this.name=n.fontName,this.embedder=n}return e.prototype.encodeText=function(e){return Y(e,`text`,[`string`]),this.modified=!0,this.embedder.encodeText(e)},e.prototype.widthOfTextAtSize=function(e,t){return Y(e,`text`,[`string`]),Y(t,`size`,[`number`]),this.embedder.widthOfTextAtSize(e,t)},e.prototype.heightAtSize=function(e,t){return Y(e,`size`,[`number`]),X(t?.descender,`options.descender`,[`boolean`]),this.embedder.heightOfFontAtSize(e,{descender:t?.descender??!0})},e.prototype.sizeAtHeight=function(e){return Y(e,`height`,[`number`]),this.embedder.sizeOfFontAtHeight(e)},e.prototype.getCharacterSet=function(){return this.embedder instanceof H_?this.embedder.encoding.supportedCodePoints:this.embedder.font.characterSet},e.prototype.embed=function(){return hm(this,void 0,void 0,function(){return gm(this,function(e){switch(e.label){case 0:return this.modified?[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]:[3,2];case 1:e.sent(),this.modified=!1,e.label=2;case 2:return[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}(),fS=function(){function e(e,t,n){Y(e,`ref`,[[x_,`PDFRef`]]),Y(t,`doc`,[[MS,`PDFDocument`]]),Y(n,`embedder`,[[iv,`JpegEmbedder`],[lv,`PngEmbedder`]]),this.ref=e,this.doc=t,this.width=n.width,this.height=n.height,this.embedder=n}return e.prototype.scale=function(e){return Y(e,`factor`,[`number`]),{width:this.width*e,height:this.height*e}},e.prototype.scaleToFit=function(e,t){Y(e,`width`,[`number`]),Y(t,`height`,[`number`]);var n=e/this.width,r=t/this.height,i=Math.min(n,r);return this.scale(i)},e.prototype.size=function(){return this.scale(1)},e.prototype.embed=function(){return hm(this,void 0,void 0,function(){var e,t,n;return gm(this,function(r){switch(r.label){case 0:return this.embedder?(this.embedTask||=(e=this,t=e.doc,n=e.ref,this.embedder.embedIntoContext(t.context,n)),[4,this.embedTask]):[2];case 1:return r.sent(),this.embedder=void 0,[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}(),pS;(function(e){e[e.Left=0]=`Left`,e[e.Center=1]=`Center`,e[e.Right=2]=`Right`})(pS||={});var mS=function(e){X(e?.x,`options.x`,[`number`]),X(e?.y,`options.y`,[`number`]),X(e?.width,`options.width`,[`number`]),X(e?.height,`options.height`,[`number`]),X(e?.textColor,`options.textColor`,[[Object,`Color`]]),X(e?.backgroundColor,`options.backgroundColor`,[[Object,`Color`]]),X(e?.borderColor,`options.borderColor`,[[Object,`Color`]]),X(e?.borderWidth,`options.borderWidth`,[`number`]),X(e?.rotate,`options.rotate`,[[Object,`Rotation`]])},hS=function(){function e(e,t,n){Y(e,`acroField`,[[Vv,`PDFAcroTerminal`]]),Y(t,`ref`,[[x_,`PDFRef`]]),Y(n,`doc`,[[MS,`PDFDocument`]]),this.acroField=e,this.ref=t,this.doc=n}return e.prototype.getName=function(){return this.acroField.getFullyQualifiedName()??``},e.prototype.isReadOnly=function(){return this.acroField.hasFlag(Gv.ReadOnly)},e.prototype.enableReadOnly=function(){this.acroField.setFlagTo(Gv.ReadOnly,!0)},e.prototype.disableReadOnly=function(){this.acroField.setFlagTo(Gv.ReadOnly,!1)},e.prototype.isRequired=function(){return this.acroField.hasFlag(Gv.Required)},e.prototype.enableRequired=function(){this.acroField.setFlagTo(Gv.Required,!0)},e.prototype.disableRequired=function(){this.acroField.setFlagTo(Gv.Required,!1)},e.prototype.isExported=function(){return!this.acroField.hasFlag(Gv.NoExport)},e.prototype.enableExporting=function(){this.acroField.setFlagTo(Gv.NoExport,!1)},e.prototype.disableExporting=function(){this.acroField.setFlagTo(Gv.NoExport,!0)},e.prototype.needsAppearancesUpdate=function(){throw new Eg(this.constructor.name,`needsAppearancesUpdate`)},e.prototype.defaultUpdateAppearances=function(e){throw new Eg(this.constructor.name,`defaultUpdateAppearances`)},e.prototype.markAsDirty=function(){this.doc.getForm().markFieldAsDirty(this.ref)},e.prototype.markAsClean=function(){this.doc.getForm().markFieldAsClean(this.ref)},e.prototype.isDirty=function(){return this.doc.getForm().fieldIsDirty(this.ref)},e.prototype.createWidget=function(e){var t=e.textColor,n=e.backgroundColor,r=e.borderColor,i=e.borderWidth,a=Ky(e.rotate),o=e.caption,s=e.x,c=e.y,l=e.width+i,u=e.height+i,d=!!e.hidden,f=e.page;yg(a,`degreesAngle`,90);var p=Bv.create(this.doc.context,this.ref),m=Yy({x:s,y:c,width:l,height:u},i,a);p.setRectangle(m),f&&p.setP(f);var h=p.getOrCreateAppearanceCharacteristics();n&&h.setBackgroundColor(Zb(n)),h.setRotation(a),o&&h.setCaptions({normal:o}),r&&h.setBorderColor(Zb(r));var g=p.getOrCreateBorderStyle();if(i!==void 0&&g.setWidth(i),p.setFlagTo(Fy.Print,!0),p.setFlagTo(Fy.Hidden,d),p.setFlagTo(Fy.Invisible,!1),t){var _=(this.acroField.getDefaultAppearance()??``)+`
|
|
79
|
+
`+Jb(t).toString();this.acroField.setDefaultAppearance(_)}return p},e.prototype.updateWidgetAppearanceWithFont=function(e,t,n){var r=n.normal,i=n.rollover,a=n.down;this.updateWidgetAppearances(e,{normal:this.createAppearanceStream(e,r,t),rollover:i&&this.createAppearanceStream(e,i,t),down:a&&this.createAppearanceStream(e,a,t)})},e.prototype.updateOnOffWidgetAppearance=function(e,t,n){var r=n.normal,i=n.rollover,a=n.down;this.updateWidgetAppearances(e,{normal:this.createAppearanceDict(e,r,t),rollover:i&&this.createAppearanceDict(e,i,t),down:a&&this.createAppearanceDict(e,a,t)})},e.prototype.updateWidgetAppearances=function(e,t){var n=t.normal,r=t.rollover,i=t.down;e.setNormalAppearance(n),r?e.setRolloverAppearance(r):e.removeRolloverAppearance(),i?e.setDownAppearance(i):e.removeDownAppearance()},e.prototype.createAppearanceStream=function(e,t,n){var r,i=this.acroField.dict.context,a=e.getRectangle(),o=a.width,s=a.height,c=n&&{Font:(r={},r[n.name]=n.ref,r)},l=i.formXObject(t,{Resources:c,BBox:i.obj([0,0,o,s]),Matrix:i.obj([1,0,0,1,0,0])});return i.register(l)},e.prototype.createImageAppearanceStream=function(e,t,n){var r,i=this.acroField.dict.context,a=e.getRectangle(),o=e.getAppearanceCharacteristics(),s=e.getBorderStyle()?.getWidth()??0,c=qy(o?.getRotation()),l=Cx(pm(pm({},a),{rotation:c})),u=Jy(a,c),d=t.scaleToFit(u.width-s*2,u.height-s*2),f={x:s,y:s,width:d.width,height:d.height,rotate:By(0),xSkew:By(0),ySkew:By(0)};n===pS.Center?(f.x+=(u.width-s*2)/2-d.width/2,f.y+=(u.height-s*2)/2-d.height/2):n===pS.Right&&(f.x=u.width-s-d.width,f.y=u.height-s-d.height);var p=this.doc.context.addRandomSuffix(`Image`,10),m=_m(l,px(p,f)),h={XObject:(r={},r[p]=t.ref,r)},g=i.formXObject(m,{Resources:h,BBox:i.obj([0,0,a.width,a.height]),Matrix:i.obj([1,0,0,1,0,0])});return i.register(g)},e.prototype.createAppearanceDict=function(e,t,n){var r=this.acroField.dict.context,i=this.createAppearanceStream(e,t.on),a=this.createAppearanceStream(e,t.off),o=r.obj({});return o.set(n,i),o.set(Q.of(`Off`),a),o},e}(),gS=function(e){J(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return Y(t,`acroCheckBox`,[[Uv,`PDFAcroCheckBox`]]),i.acroField=t,i}return t.prototype.check=function(){var e=this.acroField.getOnValue()??Q.of(`Yes`);this.markAsDirty(),this.acroField.setValue(e)},t.prototype.uncheck=function(){this.markAsDirty(),this.acroField.setValue(Q.of(`Off`))},t.prototype.isChecked=function(){var e=this.acroField.getOnValue();return!!e&&e===this.acroField.getValue()},t.prototype.addToPage=function(e,t){Y(e,`page`,[[FS,`PDFPage`]]),mS(t),t||={},`textColor`in t||(t.textColor=Ub(0,0,0)),`backgroundColor`in t||(t.backgroundColor=Ub(1,1,1)),`borderColor`in t||(t.borderColor=Ub(0,0,0)),`borderWidth`in t||(t.borderWidth=1);var n=this.createWidget({x:t.x??0,y:t.y??0,width:t.width??50,height:t.height??50,textColor:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth??0,rotate:t.rotate??By(0),hidden:t.hidden,page:e.ref}),r=this.doc.context.register(n.dict);this.acroField.addWidget(r),n.setAppearanceState(Q.of(`Off`)),this.updateWidgetAppearance(n,Q.of(`Yes`)),e.node.addAnnot(r)},t.prototype.needsAppearancesUpdate=function(){for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++){var r=e[t],i=r.getAppearanceState(),a=r.getAppearances()?.normal;if(!(a instanceof g_)||i&&!a.has(i))return!0}return!1},t.prototype.defaultUpdateAppearances=function(){this.updateAppearances()},t.prototype.updateAppearances=function(e){X(e,`provider`,[Function]);for(var t=this.acroField.getWidgets(),n=0,r=t.length;n<r;n++){var i=t[n],a=i.getOnValue()??Q.of(`Yes`);a&&this.updateWidgetAppearance(i,a,e)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Qx((n??iS)(this,e));this.updateOnOffWidgetAppearance(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(hS),_S=function(e){J(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return Y(t,`acroComboBox`,[[Xv,`PDFAcroComboBox`]]),i.acroField=t,i}return t.prototype.getOptions=function(){for(var e=this.acroField.getOptions(),t=Array(e.length),n=0,r=t.length;n<r;n++){var i=e[n],a=i.display,o=i.value;t[n]=(a??o).decodeText()}return t},t.prototype.getSelected=function(){for(var e=this.acroField.getValues(),t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]=e[n].decodeText();return t},t.prototype.setOptions=function(e){Y(e,`options`,[Array]);for(var t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]={value:V_.fromText(e[n])};this.acroField.setOptions(t)},t.prototype.addOptions=function(e){Y(e,`options`,[`string`,Array]);for(var t=Array.isArray(e)?e:[e],n=this.acroField.getOptions(),r=Array(t.length),i=0,a=t.length;i<a;i++)r[i]={value:V_.fromText(t[i])};this.acroField.setOptions(n.concat(r))},t.prototype.select=function(e,t){t===void 0&&(t=!1),Y(e,`options`,[`string`,Array]),Y(t,`merge`,[`boolean`]);var n=Array.isArray(e)?e:[e],r=this.getOptions();n.find(function(e){return!r.includes(e)})&&this.enableEditing(),this.markAsDirty(),(n.length>1||n.length===1&&t)&&this.enableMultiselect();for(var i=Array(n.length),a=0,o=n.length;a<o;a++)i[a]=V_.fromText(n[a]);if(t){var s=this.acroField.getValues();this.acroField.setValues(s.concat(i))}else this.acroField.setValues(i)},t.prototype.clear=function(){this.markAsDirty(),this.acroField.setValues([])},t.prototype.setFontSize=function(e){xg(e,`fontSize`),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.isEditable=function(){return this.acroField.hasFlag(Jv.Edit)},t.prototype.enableEditing=function(){this.acroField.setFlagTo(Jv.Edit,!0)},t.prototype.disableEditing=function(){this.acroField.setFlagTo(Jv.Edit,!1)},t.prototype.isSorted=function(){return this.acroField.hasFlag(Jv.Sort)},t.prototype.enableSorting=function(){this.acroField.setFlagTo(Jv.Sort,!0)},t.prototype.disableSorting=function(){this.acroField.setFlagTo(Jv.Sort,!1)},t.prototype.isMultiselect=function(){return this.acroField.hasFlag(Jv.MultiSelect)},t.prototype.enableMultiselect=function(){this.acroField.setFlagTo(Jv.MultiSelect,!0)},t.prototype.disableMultiselect=function(){this.acroField.setFlagTo(Jv.MultiSelect,!1)},t.prototype.isSpellChecked=function(){return!this.acroField.hasFlag(Jv.DoNotSpellCheck)},t.prototype.enableSpellChecking=function(){this.acroField.setFlagTo(Jv.DoNotSpellCheck,!1)},t.prototype.disableSpellChecking=function(){this.acroField.setFlagTo(Jv.DoNotSpellCheck,!0)},t.prototype.isSelectOnClick=function(){return this.acroField.hasFlag(Jv.CommitOnSelChange)},t.prototype.enableSelectOnClick=function(){this.acroField.setFlagTo(Jv.CommitOnSelChange,!0)},t.prototype.disableSelectOnClick=function(){this.acroField.setFlagTo(Jv.CommitOnSelChange,!1)},t.prototype.addToPage=function(e,t){Y(e,`page`,[[FS,`PDFPage`]]),mS(t),t||={},`textColor`in t||(t.textColor=Ub(0,0,0)),`backgroundColor`in t||(t.backgroundColor=Ub(1,1,1)),`borderColor`in t||(t.borderColor=Ub(0,0,0)),`borderWidth`in t||(t.borderWidth=1);var n=this.createWidget({x:t.x??0,y:t.y??0,width:t.width??200,height:t.height??50,textColor:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth??0,rotate:t.rotate??By(0),hidden:t.hidden,page:e.ref}),r=this.doc.context.register(n.dict);this.acroField.addWidget(r);var i=t.font??this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(n,i),e.node.addAnnot(r)},t.prototype.needsAppearancesUpdate=function(){if(this.isDirty())return!0;for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++)if(!(e[t].getAppearances()?.normal instanceof __))return!0;return!1},t.prototype.defaultUpdateAppearances=function(e){Y(e,`font`,[[dS,`PDFFont`]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,t){Y(e,`font`,[[dS,`PDFFont`]]),X(t,`provider`,[Function]);for(var n=this.acroField.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r];this.updateWidgetAppearance(a,e,t)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Qx((n??cS)(this,e,t));this.updateWidgetAppearanceWithFont(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(hS),vS=function(e){J(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return Y(t,`acroListBox`,[[ny,`PDFAcroListBox`]]),i.acroField=t,i}return t.prototype.getOptions=function(){for(var e=this.acroField.getOptions(),t=Array(e.length),n=0,r=t.length;n<r;n++){var i=e[n],a=i.display,o=i.value;t[n]=(a??o).decodeText()}return t},t.prototype.getSelected=function(){for(var e=this.acroField.getValues(),t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]=e[n].decodeText();return t},t.prototype.setOptions=function(e){Y(e,`options`,[Array]),this.markAsDirty();for(var t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]={value:V_.fromText(e[n])};this.acroField.setOptions(t)},t.prototype.addOptions=function(e){Y(e,`options`,[`string`,Array]),this.markAsDirty();for(var t=Array.isArray(e)?e:[e],n=this.acroField.getOptions(),r=Array(t.length),i=0,a=t.length;i<a;i++)r[i]={value:V_.fromText(t[i])};this.acroField.setOptions(n.concat(r))},t.prototype.select=function(e,t){t===void 0&&(t=!1),Y(e,`options`,[`string`,Array]),Y(t,`merge`,[`boolean`]);var n=Array.isArray(e)?e:[e];fg(n,`option`,this.getOptions()),this.markAsDirty(),(n.length>1||n.length===1&&t)&&this.enableMultiselect();for(var r=Array(n.length),i=0,a=n.length;i<a;i++)r[i]=V_.fromText(n[i]);if(t){var o=this.acroField.getValues();this.acroField.setValues(o.concat(r))}else this.acroField.setValues(r)},t.prototype.clear=function(){this.markAsDirty(),this.acroField.setValues([])},t.prototype.setFontSize=function(e){xg(e,`fontSize`),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.isSorted=function(){return this.acroField.hasFlag(Jv.Sort)},t.prototype.enableSorting=function(){this.acroField.setFlagTo(Jv.Sort,!0)},t.prototype.disableSorting=function(){this.acroField.setFlagTo(Jv.Sort,!1)},t.prototype.isMultiselect=function(){return this.acroField.hasFlag(Jv.MultiSelect)},t.prototype.enableMultiselect=function(){this.acroField.setFlagTo(Jv.MultiSelect,!0)},t.prototype.disableMultiselect=function(){this.acroField.setFlagTo(Jv.MultiSelect,!1)},t.prototype.isSelectOnClick=function(){return this.acroField.hasFlag(Jv.CommitOnSelChange)},t.prototype.enableSelectOnClick=function(){this.acroField.setFlagTo(Jv.CommitOnSelChange,!0)},t.prototype.disableSelectOnClick=function(){this.acroField.setFlagTo(Jv.CommitOnSelChange,!1)},t.prototype.addToPage=function(e,t){Y(e,`page`,[[FS,`PDFPage`]]),mS(t),t||={},`textColor`in t||(t.textColor=Ub(0,0,0)),`backgroundColor`in t||(t.backgroundColor=Ub(1,1,1)),`borderColor`in t||(t.borderColor=Ub(0,0,0)),`borderWidth`in t||(t.borderWidth=1);var n=this.createWidget({x:t.x??0,y:t.y??0,width:t.width??200,height:t.height??100,textColor:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth??0,rotate:t.rotate??By(0),hidden:t.hidden,page:e.ref}),r=this.doc.context.register(n.dict);this.acroField.addWidget(r);var i=t.font??this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(n,i),e.node.addAnnot(r)},t.prototype.needsAppearancesUpdate=function(){if(this.isDirty())return!0;for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++)if(!(e[t].getAppearances()?.normal instanceof __))return!0;return!1},t.prototype.defaultUpdateAppearances=function(e){Y(e,`font`,[[dS,`PDFFont`]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,t){Y(e,`font`,[[dS,`PDFFont`]]),X(t,`provider`,[Function]);for(var n=this.acroField.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r];this.updateWidgetAppearance(a,e,t)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Qx((n??lS)(this,e,t));this.updateWidgetAppearanceWithFont(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(hS),yS=function(e){J(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return Y(t,`acroRadioButton`,[[ty,`PDFAcroRadioButton`]]),i.acroField=t,i}return t.prototype.getOptions=function(){var e=this.acroField.getExportValues();if(e){for(var t=Array(e.length),n=0,r=e.length;n<r;n++)t[n]=e[n].decodeText();return t}for(var i=this.acroField.getOnValues(),a=Array(i.length),n=0,r=a.length;n<r;n++)a[n]=i[n].decodeText();return a},t.prototype.getSelected=function(){var e=this.acroField.getValue();if(e!==Q.of(`Off`)){var t=this.acroField.getExportValues();if(t){for(var n=this.acroField.getOnValues(),r=0,i=n.length;r<i;r++)if(n[r]===e)return t[r].decodeText()}return e.decodeText()}},t.prototype.select=function(e){Y(e,`option`,[`string`]),ug(e,`option`,this.getOptions()),this.markAsDirty();var t=this.acroField.getOnValues(),n=this.acroField.getExportValues();if(n)for(var r=0,i=n.length;r<i;r++)n[r].decodeText()===e&&this.acroField.setValue(t[r]);else for(var r=0,i=t.length;r<i;r++){var a=t[r];a.decodeText()===e&&this.acroField.setValue(a)}},t.prototype.clear=function(){this.markAsDirty(),this.acroField.setValue(Q.of(`Off`))},t.prototype.isOffToggleable=function(){return!this.acroField.hasFlag(Kv.NoToggleToOff)},t.prototype.enableOffToggling=function(){this.acroField.setFlagTo(Kv.NoToggleToOff,!1)},t.prototype.disableOffToggling=function(){this.acroField.setFlagTo(Kv.NoToggleToOff,!0)},t.prototype.isMutuallyExclusive=function(){return!this.acroField.hasFlag(Kv.RadiosInUnison)},t.prototype.enableMutualExclusion=function(){this.acroField.setFlagTo(Kv.RadiosInUnison,!1)},t.prototype.disableMutualExclusion=function(){this.acroField.setFlagTo(Kv.RadiosInUnison,!0)},t.prototype.addOptionToPage=function(e,t,n){Y(e,`option`,[`string`]),Y(t,`page`,[[FS,`PDFPage`]]),mS(n);var r=this.createWidget({x:n?.x??0,y:n?.y??0,width:n?.width??50,height:n?.height??50,textColor:n?.textColor??Ub(0,0,0),backgroundColor:n?.backgroundColor??Ub(1,1,1),borderColor:n?.borderColor??Ub(0,0,0),borderWidth:n?.borderWidth??1,rotate:n?.rotate??By(0),hidden:n?.hidden,page:t.ref}),i=this.doc.context.register(r.dict),a=this.acroField.addWidgetWithOpt(i,V_.fromText(e),!this.isMutuallyExclusive());r.setAppearanceState(Q.of(`Off`)),this.updateWidgetAppearance(r,a),t.node.addAnnot(i)},t.prototype.needsAppearancesUpdate=function(){for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++){var r=e[t],i=r.getAppearanceState(),a=r.getAppearances()?.normal;if(!(a instanceof g_)||i&&!a.has(i))return!0}return!1},t.prototype.defaultUpdateAppearances=function(){this.updateAppearances()},t.prototype.updateAppearances=function(e){X(e,`provider`,[Function]);for(var t=this.acroField.getWidgets(),n=0,r=t.length;n<r;n++){var i=t[n],a=i.getOnValue();a&&this.updateWidgetAppearance(i,a,e)}},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Qx((n??aS)(this,e));this.updateOnOffWidgetAppearance(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(hS),bS=function(e){J(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return Y(t,`acroSignature`,[[Qv,`PDFAcroSignature`]]),i.acroField=t,i}return t.prototype.needsAppearancesUpdate=function(){return!1},t.of=function(e,n,r){return new t(e,n,r)},t}(hS),xS=function(e){J(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return Y(t,`acroText`,[[$v,`PDFAcroText`]]),i.acroField=t,i}return t.prototype.getText=function(){var e=this.acroField.getValue();if(!e&&this.isRichFormatted())throw new Rx(this.getName());return e?.decodeText()},t.prototype.setText=function(e){X(e,`text`,[`string`]);var t=this.getMaxLength();if(t!==void 0&&e&&e.length>t)throw new Bx(e.length,t,this.getName());this.markAsDirty(),this.disableRichFormatting(),e?this.acroField.setValue(V_.fromText(e)):this.acroField.removeValue()},t.prototype.getAlignment=function(){var e=this.acroField.getQuadding();return e===0?Hx.Left:e===1?Hx.Center:e===2?Hx.Right:Hx.Left},t.prototype.setAlignment=function(e){ug(e,`alignment`,Hx),this.markAsDirty(),this.acroField.setQuadding(e)},t.prototype.getMaxLength=function(){return this.acroField.getMaxLength()},t.prototype.setMaxLength=function(e){if(vg(e,`maxLength`,0,2**53-1),this.markAsDirty(),e===void 0)this.acroField.removeMaxLength();else{var t=this.getText();if(t&&t.length>e)throw new Vx(t.length,e,this.getName());this.acroField.setMaxLength(e)}},t.prototype.removeMaxLength=function(){this.markAsDirty(),this.acroField.removeMaxLength()},t.prototype.setImage=function(e){for(var t=this.getAlignment(),n=t===Hx.Center?pS.Center:t===Hx.Right?pS.Right:pS.Left,r=this.acroField.getWidgets(),i=0,a=r.length;i<a;i++){var o=r[i],s=this.createImageAppearanceStream(o,e,n);this.updateWidgetAppearances(o,{normal:s})}this.markAsClean()},t.prototype.setFontSize=function(e){xg(e,`fontSize`),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.isMultiline=function(){return this.acroField.hasFlag(qv.Multiline)},t.prototype.enableMultiline=function(){this.markAsDirty(),this.acroField.setFlagTo(qv.Multiline,!0)},t.prototype.disableMultiline=function(){this.markAsDirty(),this.acroField.setFlagTo(qv.Multiline,!1)},t.prototype.isPassword=function(){return this.acroField.hasFlag(qv.Password)},t.prototype.enablePassword=function(){this.acroField.setFlagTo(qv.Password,!0)},t.prototype.disablePassword=function(){this.acroField.setFlagTo(qv.Password,!1)},t.prototype.isFileSelector=function(){return this.acroField.hasFlag(qv.FileSelect)},t.prototype.enableFileSelection=function(){this.acroField.setFlagTo(qv.FileSelect,!0)},t.prototype.disableFileSelection=function(){this.acroField.setFlagTo(qv.FileSelect,!1)},t.prototype.isSpellChecked=function(){return!this.acroField.hasFlag(qv.DoNotSpellCheck)},t.prototype.enableSpellChecking=function(){this.acroField.setFlagTo(qv.DoNotSpellCheck,!1)},t.prototype.disableSpellChecking=function(){this.acroField.setFlagTo(qv.DoNotSpellCheck,!0)},t.prototype.isScrollable=function(){return!this.acroField.hasFlag(qv.DoNotScroll)},t.prototype.enableScrolling=function(){this.acroField.setFlagTo(qv.DoNotScroll,!1)},t.prototype.disableScrolling=function(){this.acroField.setFlagTo(qv.DoNotScroll,!0)},t.prototype.isCombed=function(){return this.acroField.hasFlag(qv.Comb)&&!this.isMultiline()&&!this.isPassword()&&!this.isFileSelector()&&this.getMaxLength()!==void 0},t.prototype.enableCombing=function(){this.getMaxLength()===void 0&&console.warn(`PDFTextFields must have a max length in order to be combed`),this.markAsDirty(),this.disableMultiline(),this.disablePassword(),this.disableFileSelection(),this.acroField.setFlagTo(qv.Comb,!0)},t.prototype.disableCombing=function(){this.markAsDirty(),this.acroField.setFlagTo(qv.Comb,!1)},t.prototype.isRichFormatted=function(){return this.acroField.hasFlag(qv.RichText)},t.prototype.enableRichFormatting=function(){this.acroField.setFlagTo(qv.RichText,!0)},t.prototype.disableRichFormatting=function(){this.acroField.setFlagTo(qv.RichText,!1)},t.prototype.addToPage=function(e,t){Y(e,`page`,[[FS,`PDFPage`]]),mS(t),t||={},`textColor`in t||(t.textColor=Ub(0,0,0)),`backgroundColor`in t||(t.backgroundColor=Ub(1,1,1)),`borderColor`in t||(t.borderColor=Ub(0,0,0)),`borderWidth`in t||(t.borderWidth=1);var n=this.createWidget({x:t.x??0,y:t.y??0,width:t.width??200,height:t.height??50,textColor:t.textColor,backgroundColor:t.backgroundColor,borderColor:t.borderColor,borderWidth:t.borderWidth??0,rotate:t.rotate??By(0),hidden:t.hidden,page:e.ref}),r=this.doc.context.register(n.dict);this.acroField.addWidget(r);var i=t.font??this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(n,i),e.node.addAnnot(r)},t.prototype.needsAppearancesUpdate=function(){if(this.isDirty())return!0;for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++)if(!(e[t].getAppearances()?.normal instanceof __))return!0;return!1},t.prototype.defaultUpdateAppearances=function(e){Y(e,`font`,[[dS,`PDFFont`]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,t){Y(e,`font`,[[dS,`PDFFont`]]),X(t,`provider`,[Function]);for(var n=this.acroField.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r];this.updateWidgetAppearance(a,e,t)}this.markAsClean()},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Qx((n??sS)(this,e,t));this.updateWidgetAppearanceWithFont(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(hS),SS;(function(e){e.Courier=`Courier`,e.CourierBold=`Courier-Bold`,e.CourierOblique=`Courier-Oblique`,e.CourierBoldOblique=`Courier-BoldOblique`,e.Helvetica=`Helvetica`,e.HelveticaBold=`Helvetica-Bold`,e.HelveticaOblique=`Helvetica-Oblique`,e.HelveticaBoldOblique=`Helvetica-BoldOblique`,e.TimesRoman=`Times-Roman`,e.TimesRomanBold=`Times-Bold`,e.TimesRomanItalic=`Times-Italic`,e.TimesRomanBoldItalic=`Times-BoldItalic`,e.Symbol=`Symbol`,e.ZapfDingbats=`ZapfDingbats`})(SS||={});var CS=function(){function e(e,t){var n=this;this.embedDefaultFont=function(){return n.doc.embedStandardFont(SS.Helvetica)},Y(e,`acroForm`,[[fy,`PDFAcroForm`]]),Y(t,`doc`,[[MS,`PDFDocument`]]),this.acroForm=e,this.doc=t,this.dirtyFields=new Set,this.defaultFontCache=Tg.populatedBy(this.embedDefaultFont)}return e.prototype.hasXFA=function(){return this.acroForm.dict.has(Q.of(`XFA`))},e.prototype.deleteXFA=function(){this.acroForm.dict.delete(Q.of(`XFA`))},e.prototype.getFields=function(){for(var e=this.acroForm.getAllFields(),t=[],n=0,r=e.length;n<r;n++){var i=e[n],a=i[0],o=i[1],s=wS(a,o,this.doc);s&&t.push(s)}return t},e.prototype.getFieldMaybe=function(e){Y(e,`name`,[`string`]);for(var t=this.getFields(),n=0,r=t.length;n<r;n++){var i=t[n];if(i.getName()===e)return i}},e.prototype.getField=function(e){Y(e,`name`,[`string`]);var t=this.getFieldMaybe(e);if(t)return t;throw new Px(e)},e.prototype.getButton=function(e){Y(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof IS)return t;throw new Fx(e,IS,t)},e.prototype.getCheckBox=function(e){Y(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof gS)return t;throw new Fx(e,gS,t)},e.prototype.getDropdown=function(e){Y(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof _S)return t;throw new Fx(e,_S,t)},e.prototype.getOptionList=function(e){Y(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof vS)return t;throw new Fx(e,vS,t)},e.prototype.getRadioGroup=function(e){Y(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof yS)return t;throw new Fx(e,yS,t)},e.prototype.getSignature=function(e){Y(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof bS)return t;throw new Fx(e,bS,t)},e.prototype.getTextField=function(e){Y(e,`name`,[`string`]);var t=this.getField(e);if(t instanceof xS)return t;throw new Fx(e,xS,t)},e.prototype.createButton=function(e){Y(e,`name`,[`string`]);var t=TS(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=ey.create(this.doc.context);return r.setPartialName(t.terminal),ES(n,[r,r.ref],t.terminal),IS.of(r,r.ref,this.doc)},e.prototype.createCheckBox=function(e){Y(e,`name`,[`string`]);var t=TS(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=Uv.create(this.doc.context);return r.setPartialName(t.terminal),ES(n,[r,r.ref],t.terminal),gS.of(r,r.ref,this.doc)},e.prototype.createDropdown=function(e){Y(e,`name`,[`string`]);var t=TS(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=Xv.create(this.doc.context);return r.setPartialName(t.terminal),ES(n,[r,r.ref],t.terminal),_S.of(r,r.ref,this.doc)},e.prototype.createOptionList=function(e){Y(e,`name`,[`string`]);var t=TS(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=ny.create(this.doc.context);return r.setPartialName(t.terminal),ES(n,[r,r.ref],t.terminal),vS.of(r,r.ref,this.doc)},e.prototype.createRadioGroup=function(e){Y(e,`name`,[`string`]);var t=TS(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=ty.create(this.doc.context);return r.setPartialName(t.terminal),ES(n,[r,r.ref],t.terminal),yS.of(r,r.ref,this.doc)},e.prototype.createTextField=function(e){Y(e,`name`,[`string`]);var t=TS(e),n=this.findOrCreateNonTerminals(t.nonTerminal),r=$v.create(this.doc.context);return r.setPartialName(t.terminal),ES(n,[r,r.ref],t.terminal),xS.of(r,r.ref,this.doc)},e.prototype.flatten=function(e){e===void 0&&(e={updateFieldAppearances:!0}),e.updateFieldAppearances&&this.updateFieldAppearances();for(var t=this.getFields(),n=0,r=t.length;n<r;n++){for(var i=t[n],a=i.acroField.getWidgets(),o=0,s=a.length;o<s;o++){var c=a[o],l=this.findWidgetPage(c),u=this.findWidgetAppearanceRef(i,c),d=l.node.newXObject(`FlatWidget`,u),f=c.getRectangle(),p=_m([db(),tb(f.x,f.y)],Cx(pm(pm({},f),{rotation:0})),[Mb(d),fb()]).filter(Boolean);l.pushOperators.apply(l,p)}this.removeField(i)}},e.prototype.removeField=function(e){for(var t=e.acroField.getWidgets(),n=new Set,r=0,i=t.length;r<i;r++){var a=t[r],o=this.findWidgetAppearanceRef(e,a),s=this.findWidgetPage(a);n.add(s),s.node.removeAnnot(o)}n.forEach(function(t){return t.node.removeAnnot(e.ref)}),this.acroForm.removeField(e.acroField);for(var c=e.acroField.normalizedEntries().Kids,l=c.size(),u=0;u<l;u++){var d=c.get(u);d instanceof x_&&this.doc.context.delete(d)}this.doc.context.delete(e.ref)},e.prototype.updateFieldAppearances=function(e){X(e,`font`,[[dS,`PDFFont`]]),e??=this.getDefaultFont();for(var t=this.getFields(),n=0,r=t.length;n<r;n++){var i=t[n];i.needsAppearancesUpdate()&&i.defaultUpdateAppearances(e)}},e.prototype.markFieldAsDirty=function(e){X(e,`fieldRef`,[[x_,`PDFRef`]]),this.dirtyFields.add(e)},e.prototype.markFieldAsClean=function(e){X(e,`fieldRef`,[[x_,`PDFRef`]]),this.dirtyFields.delete(e)},e.prototype.fieldIsDirty=function(e){return X(e,`fieldRef`,[[x_,`PDFRef`]]),this.dirtyFields.has(e)},e.prototype.getDefaultFont=function(){return this.defaultFontCache.access()},e.prototype.findWidgetPage=function(e){var t=e.P(),n=this.doc.getPages().find(function(e){return e.ref===t});if(n===void 0){var r=this.doc.context.getObjectRef(e.dict);if(r===void 0)throw Error(`Could not find PDFRef for PDFObject`);if(n=this.doc.findPageForAnnotationRef(r),n===void 0)throw Error(`Could not find page for PDFRef `+r)}return n},e.prototype.findWidgetAppearanceRef=function(e,t){var n=t.getNormalAppearance();if(n instanceof g_&&(e instanceof gS||e instanceof yS)){var r=e.acroField.getValue(),i=n.get(r)??n.get(Q.of(`Off`));i instanceof x_&&(n=i)}if(!(n instanceof x_)){var a=e.getName();throw Error(`Failed to extract appearance ref for: `+a)}return n},e.prototype.findOrCreateNonTerminals=function(e){for(var t=[this.acroForm],n=0,r=e.length;n<r;n++){var i=e[n];if(!i)throw new Lx(i);var a=t[0],o=t[1],s=this.findNonTerminal(i,a);if(s)t=s;else{var c=Zv.create(this.doc.context);c.setPartialName(i),c.setParent(o);var l=this.doc.context.register(c.dict);a.addField(l),t=[c,l]}}return t},e.prototype.findNonTerminal=function(e,t){for(var n=t instanceof fy?this.acroForm.getFields():ry(t.Kids()),r=0,i=n.length;r<i;r++){var a=n[r],o=a[0],s=a[1];if(o.getPartialName()===e){if(o instanceof Zv)return[o,s];throw new Ix(e)}}},e.of=function(t,n){return new e(t,n)},e}(),wS=function(e,t,n){if(e instanceof ey)return IS.of(e,t,n);if(e instanceof Uv)return gS.of(e,t,n);if(e instanceof Xv)return _S.of(e,t,n);if(e instanceof ny)return vS.of(e,t,n);if(e instanceof $v)return xS.of(e,t,n);if(e instanceof ty)return yS.of(e,t,n);if(e instanceof Qv)return bS.of(e,t,n)},TS=function(e){if(e.length===0)throw Error(`PDF field names must not be empty strings`);for(var t=e.split(`.`),n=0,r=t.length;n<r;n++)if(t[n]===``)throw Error(`Periods in PDF field names must be separated by at least one character: "`+e+`"`);return t.length===1?{nonTerminal:[],terminal:t[0]}:{nonTerminal:t.slice(0,t.length-1),terminal:t[t.length-1]}},ES=function(e,t,n){for(var r=e[0],i=e[1],a=t[0],o=t[1],s=r.normalizedEntries(),c=ry(`Kids`in s?s.Kids:s.Fields),l=0,u=c.length;l<u;l++)if(c[l][0].getPartialName()===n)throw new Ix(n);r.addField(o),a.setParent(i)},DS={"4A0":[4767.87,6740.79],"2A0":[3370.39,4767.87],A0:[2383.94,3370.39],A1:[1683.78,2383.94],A2:[1190.55,1683.78],A3:[841.89,1190.55],A4:[595.28,841.89],A5:[419.53,595.28],A6:[297.64,419.53],A7:[209.76,297.64],A8:[147.4,209.76],A9:[104.88,147.4],A10:[73.7,104.88],B0:[2834.65,4008.19],B1:[2004.09,2834.65],B2:[1417.32,2004.09],B3:[1000.63,1417.32],B4:[708.66,1000.63],B5:[498.9,708.66],B6:[354.33,498.9],B7:[249.45,354.33],B8:[175.75,249.45],B9:[124.72,175.75],B10:[87.87,124.72],C0:[2599.37,3676.54],C1:[1836.85,2599.37],C2:[1298.27,1836.85],C3:[918.43,1298.27],C4:[649.13,918.43],C5:[459.21,649.13],C6:[323.15,459.21],C7:[229.61,323.15],C8:[161.57,229.61],C9:[113.39,161.57],C10:[79.37,113.39],RA0:[2437.8,3458.27],RA1:[1729.13,2437.8],RA2:[1218.9,1729.13],RA3:[864.57,1218.9],RA4:[609.45,864.57],SRA0:[2551.18,3628.35],SRA1:[1814.17,2551.18],SRA2:[1275.59,1814.17],SRA3:[907.09,1275.59],SRA4:[637.8,907.09],Executive:[521.86,756],Folio:[612,936],Legal:[612,1008],Letter:[612,792],Tabloid:[792,1224]},OS;(function(e){e[e.Fastest=1/0]=`Fastest`,e[e.Fast=1500]=`Fast`,e[e.Medium=500]=`Medium`,e[e.Slow=100]=`Slow`})(OS||={});var kS=function(){function e(e,t,n){this.alreadyEmbedded=!1,this.ref=e,this.doc=t,this.embedder=n}return e.prototype.embed=function(){return hm(this,void 0,void 0,function(){var e,t,n,r,i;return gm(this,function(a){switch(a.label){case 0:return this.alreadyEmbedded?[3,2]:[4,this.embedder.embedIntoContext(this.doc.context,this.ref)];case 1:e=a.sent(),this.doc.catalog.has(Q.of(`Names`))||this.doc.catalog.set(Q.of(`Names`),this.doc.context.obj({})),t=this.doc.catalog.lookup(Q.of(`Names`),g_),t.has(Q.of(`EmbeddedFiles`))||t.set(Q.of(`EmbeddedFiles`),this.doc.context.obj({})),n=t.lookup(Q.of(`EmbeddedFiles`),g_),n.has(Q.of(`Names`))||n.set(Q.of(`Names`),this.doc.context.obj([])),r=n.lookup(Q.of(`Names`),r_),r.push(V_.fromText(this.embedder.fileName)),r.push(e),this.doc.catalog.has(Q.of(`AF`))||this.doc.catalog.set(Q.of(`AF`),this.doc.context.obj([])),i=this.doc.catalog.lookup(Q.of(`AF`),r_),i.push(e),this.alreadyEmbedded=!0,a.label=2;case 2:return[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}(),AS=function(){function e(e,t,n){this.alreadyEmbedded=!1,this.ref=e,this.doc=t,this.embedder=n}return e.prototype.embed=function(){return hm(this,void 0,void 0,function(){var e,t,n,r,i,a,o;return gm(this,function(s){switch(s.label){case 0:return this.alreadyEmbedded?[3,2]:(e=this.doc,t=e.catalog,n=e.context,[4,this.embedder.embedIntoContext(this.doc.context,this.ref)]);case 1:r=s.sent(),t.has(Q.of(`Names`))||t.set(Q.of(`Names`),n.obj({})),i=t.lookup(Q.of(`Names`),g_),i.has(Q.of(`JavaScript`))||i.set(Q.of(`JavaScript`),n.obj({})),a=i.lookup(Q.of(`JavaScript`),g_),a.has(Q.of(`Names`))||a.set(Q.of(`Names`),n.obj([])),o=a.lookup(Q.of(`Names`),r_),o.push(V_.fromText(this.embedder.scriptName)),o.push(r),this.alreadyEmbedded=!0,s.label=2;case 2:return[2]}})})},e.of=function(t,n,r){return new e(t,n,r)},e}(),jS=function(){function e(e,t){this.script=e,this.scriptName=t}return e.for=function(t,n){return new e(t,n)},e.prototype.embedIntoContext=function(e,t){return hm(this,void 0,void 0,function(){var n;return gm(this,function(r){return n=e.obj({Type:`Action`,S:`JavaScript`,JS:V_.fromText(this.script)}),t?(e.assign(t,n),[2,t]):[2,e.register(n)]})})},e}(),MS=function(){function e(e,t,n){var r=this;if(this.defaultWordBreaks=[` `],this.computePages=function(){var e=[];return r.catalog.Pages().traverse(function(t,n){if(t instanceof A_){var i=r.pageMap.get(t);i||(i=FS.of(t,n,r),r.pageMap.set(t,i)),e.push(i)}}),e},this.getOrCreateForm=function(){var e=r.catalog.getOrCreateAcroForm();return CS.of(e,r)},Y(e,`context`,[[k_,`PDFContext`]]),Y(t,`ignoreEncryption`,[`boolean`]),this.context=e,this.catalog=e.lookup(e.trailerInfo.Root),this.isEncrypted=!!e.lookup(e.trailerInfo.Encrypt),this.pageCache=Tg.populatedBy(this.computePages),this.pageMap=new Map,this.formCache=Tg.populatedBy(this.getOrCreateForm),this.fonts=[],this.images=[],this.embeddedPages=[],this.embeddedFiles=[],this.javaScripts=[],!t&&this.isEncrypted)throw new Ax;n&&this.updateInfoDict()}return e.load=function(t,n){return n===void 0&&(n={}),hm(this,void 0,void 0,function(){var r,i,a,o,s,c,l,u,d,f,p,m;return gm(this,function(h){switch(h.label){case 0:return r=n.ignoreEncryption,i=r===void 0?!1:r,a=n.parseSpeed,o=a===void 0?OS.Slow:a,s=n.throwOnInvalidObject,c=s===void 0?!1:s,l=n.updateMetadata,u=l===void 0?!0:l,d=n.capNumbers,f=d===void 0?!1:d,Y(t,`pdf`,[`string`,Uint8Array,ArrayBuffer]),Y(i,`ignoreEncryption`,[`boolean`]),Y(o,`parseSpeed`,[`number`]),Y(c,`throwOnInvalidObject`,[`boolean`]),p=ih(t),[4,Ny.forBytesWithOptions(p,o,c,f).parseDocument()];case 1:return m=h.sent(),[2,new e(m,i,u)]}})})},e.create=function(t){return t===void 0&&(t={}),hm(this,void 0,void 0,function(){var n,r,i,a,o,s;return gm(this,function(c){return n=t.updateMetadata,r=n===void 0?!0:n,i=k_.create(),a=my.withContext(i),o=i.register(a),s=py.withContextAndPages(i,o),i.trailerInfo.Root=i.register(s),[2,new e(i,!1,r)]})})},e.prototype.registerFontkit=function(e){this.fontkit=e},e.prototype.getForm=function(){var e=this.formCache.access();return e.hasXFA()&&(console.warn(`Removing XFA form data as pdf-lib does not support reading or writing XFA`),e.deleteXFA()),e},e.prototype.getTitle=function(){var e=this.getInfoDict().lookup(Q.Title);if(e)return NS(e),e.decodeText()},e.prototype.getAuthor=function(){var e=this.getInfoDict().lookup(Q.Author);if(e)return NS(e),e.decodeText()},e.prototype.getSubject=function(){var e=this.getInfoDict().lookup(Q.Subject);if(e)return NS(e),e.decodeText()},e.prototype.getKeywords=function(){var e=this.getInfoDict().lookup(Q.Keywords);if(e)return NS(e),e.decodeText()},e.prototype.getCreator=function(){var e=this.getInfoDict().lookup(Q.Creator);if(e)return NS(e),e.decodeText()},e.prototype.getProducer=function(){var e=this.getInfoDict().lookup(Q.Producer);if(e)return NS(e),e.decodeText()},e.prototype.getCreationDate=function(){var e=this.getInfoDict().lookup(Q.CreationDate);if(e)return NS(e),e.decodeDate()},e.prototype.getModificationDate=function(){var e=this.getInfoDict().lookup(Q.ModDate);if(e)return NS(e),e.decodeDate()},e.prototype.setTitle=function(e,t){Y(e,`title`,[`string`]);var n=Q.of(`Title`);this.getInfoDict().set(n,V_.fromText(e)),t?.showInWindowTitleBar&&this.catalog.getOrCreateViewerPreferences().setDisplayDocTitle(!0)},e.prototype.setAuthor=function(e){Y(e,`author`,[`string`]);var t=Q.of(`Author`);this.getInfoDict().set(t,V_.fromText(e))},e.prototype.setSubject=function(e){Y(e,`author`,[`string`]);var t=Q.of(`Subject`);this.getInfoDict().set(t,V_.fromText(e))},e.prototype.setKeywords=function(e){Y(e,`keywords`,[Array]);var t=Q.of(`Keywords`);this.getInfoDict().set(t,V_.fromText(e.join(` `)))},e.prototype.setCreator=function(e){Y(e,`creator`,[`string`]);var t=Q.of(`Creator`);this.getInfoDict().set(t,V_.fromText(e))},e.prototype.setProducer=function(e){Y(e,`creator`,[`string`]);var t=Q.of(`Producer`);this.getInfoDict().set(t,V_.fromText(e))},e.prototype.setLanguage=function(e){Y(e,`language`,[`string`]);var t=Q.of(`Lang`);this.catalog.set(t,X_.of(e))},e.prototype.setCreationDate=function(e){Y(e,`creationDate`,[[Date,`Date`]]);var t=Q.of(`CreationDate`);this.getInfoDict().set(t,X_.fromDate(e))},e.prototype.setModificationDate=function(e){Y(e,`modificationDate`,[[Date,`Date`]]);var t=Q.of(`ModDate`);this.getInfoDict().set(t,X_.fromDate(e))},e.prototype.getPageCount=function(){return this.pageCount===void 0&&(this.pageCount=this.getPages().length),this.pageCount},e.prototype.getPages=function(){return this.pageCache.access()},e.prototype.getPage=function(e){var t=this.getPages();return _g(e,`index`,0,t.length-1),t[e]},e.prototype.getPageIndices=function(){return th(0,this.getPageCount())},e.prototype.removePage=function(e){var t=this.getPageCount();if(this.pageCount===0)throw new Nx;_g(e,`index`,0,t-1),this.catalog.removeLeafNode(e),this.pageCount=t-1},e.prototype.addPage=function(e){return Y(e,`page`,[`undefined`,[FS,`PDFPage`],Array]),this.insertPage(this.getPageCount(),e)},e.prototype.insertPage=function(e,t){var n=this.getPageCount();if(_g(e,`index`,0,n),Y(t,`page`,[`undefined`,[FS,`PDFPage`],Array]),!t||Array.isArray(t)){var r=Array.isArray(t)?t:DS.A4;t=FS.create(this),t.setSize.apply(t,r)}else if(t.doc!==this)throw new Mx;var i=this.catalog.insertLeafNode(t.ref,e);return t.node.setParent(i),this.pageMap.set(t.node,t),this.pageCache.invalidate(),this.pageCount=n+1,t},e.prototype.copyPages=function(t,n){return hm(this,void 0,void 0,function(){var r,i,a,o,s,c,l,u;return gm(this,function(d){switch(d.label){case 0:return Y(t,`srcDoc`,[[e,`PDFDocument`]]),Y(n,`indices`,[Array]),[4,t.flush()];case 1:for(d.sent(),r=j_.for(t.context,this.context),i=t.getPages(),a=Array(n.length),o=0,s=n.length;o<s;o++)c=i[n[o]],l=r.copy(c.node),u=this.context.register(l),a[o]=FS.of(l,u,this);return[2,a]}})})},e.prototype.copy=function(){return hm(this,void 0,void 0,function(){var t,n,r,i;return gm(this,function(a){switch(a.label){case 0:return[4,e.create()];case 1:return t=a.sent(),[4,t.copyPages(this,this.getPageIndices())];case 2:for(n=a.sent(),r=0,i=n.length;r<i;r++)t.addPage(n[r]);return this.getAuthor()!==void 0&&t.setAuthor(this.getAuthor()),this.getCreationDate()!==void 0&&t.setCreationDate(this.getCreationDate()),this.getCreator()!==void 0&&t.setCreator(this.getCreator()),this.getModificationDate()!==void 0&&t.setModificationDate(this.getModificationDate()),this.getProducer()!==void 0&&t.setProducer(this.getProducer()),this.getSubject()!==void 0&&t.setSubject(this.getSubject()),this.getTitle()!==void 0&&t.setTitle(this.getTitle()),t.defaultWordBreaks=this.defaultWordBreaks,[2,t]}})})},e.prototype.addJavaScript=function(e,t){Y(e,`name`,[`string`]),Y(t,`script`,[`string`]);var n=jS.for(t,e),r=this.context.nextRef(),i=AS.of(r,this,n);this.javaScripts.push(i)},e.prototype.attach=function(e,t,n){return n===void 0&&(n={}),hm(this,void 0,void 0,function(){var r,i,a,o;return gm(this,function(s){return Y(e,`attachment`,[`string`,Uint8Array,ArrayBuffer]),Y(t,`name`,[`string`]),X(n.mimeType,`mimeType`,[`string`]),X(n.description,`description`,[`string`]),X(n.creationDate,`options.creationDate`,[Date]),X(n.modificationDate,`options.modificationDate`,[Date]),dg(n.afRelationship,`options.afRelationship`,$_),r=ih(e),i=ev.for(r,t,n),a=this.context.nextRef(),o=kS.of(a,this,i),this.embeddedFiles.push(o),[2]})})},e.prototype.embedFont=function(e,t){return t===void 0&&(t={}),hm(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d;return gm(this,function(f){switch(f.label){case 0:return n=t.subset,r=n===void 0?!1:n,i=t.customName,a=t.features,Y(e,`font`,[`string`,Uint8Array,ArrayBuffer]),Y(r,`subset`,[`boolean`]),ig(e)?(o=H_.for(e,i),[3,7]):[3,1];case 1:return rh(e)?(s=ih(e),c=this.assertFontkit(),r?[4,Q_.for(c,s,i,a)]:[3,3]):[3,6];case 2:return l=f.sent(),[3,5];case 3:return[4,Z_.for(c,s,i,a)];case 4:l=f.sent(),f.label=5;case 5:return o=l,[3,7];case 6:throw TypeError("`font` must be one of `StandardFonts | string | Uint8Array | ArrayBuffer`");case 7:return u=this.context.nextRef(),d=dS.of(u,this,o),this.fonts.push(d),[2,d]}})})},e.prototype.embedStandardFont=function(e,t){if(Y(e,`font`,[`string`]),!ig(e))throw TypeError("`font` must be one of type `StandardFonts`");var n=H_.for(e,t),r=this.context.nextRef(),i=dS.of(r,this,n);return this.fonts.push(i),i},e.prototype.embedJpg=function(e){return hm(this,void 0,void 0,function(){var t,n,r,i;return gm(this,function(a){switch(a.label){case 0:return Y(e,`jpg`,[`string`,Uint8Array,ArrayBuffer]),t=ih(e),[4,iv.for(t)];case 1:return n=a.sent(),r=this.context.nextRef(),i=fS.of(r,this,n),this.images.push(i),[2,i]}})})},e.prototype.embedPng=function(e){return hm(this,void 0,void 0,function(){var t,n,r,i;return gm(this,function(a){switch(a.label){case 0:return Y(e,`png`,[`string`,Uint8Array,ArrayBuffer]),t=ih(e),[4,lv.for(t)];case 1:return n=a.sent(),r=this.context.nextRef(),i=fS.of(r,this,n),this.images.push(i),[2,i]}})})},e.prototype.embedPdf=function(t,n){return n===void 0&&(n=[0]),hm(this,void 0,void 0,function(){var r,i,a;return gm(this,function(o){switch(o.label){case 0:return Y(t,`pdf`,[`string`,Uint8Array,ArrayBuffer,[e,`PDFDocument`]]),Y(n,`indices`,[Array]),t instanceof e?(i=t,[3,3]):[3,1];case 1:return[4,e.load(t)];case 2:i=o.sent(),o.label=3;case 3:return r=i,a=nh(r.getPages(),n),[2,this.embedPages(a)]}})})},e.prototype.embedPage=function(e,t,n){return hm(this,void 0,void 0,function(){var r;return gm(this,function(i){switch(i.label){case 0:return Y(e,`page`,[[FS,`PDFPage`]]),[4,this.embedPages([e],[t],[n])];case 1:return r=i.sent()[0],[2,r]}})})},e.prototype.embedPages=function(e,t,n){return t===void 0&&(t=[]),n===void 0&&(n=[]),hm(this,void 0,void 0,function(){var r,i,a,o,s,c,l,r,i,u,d,f,p,m,h;return gm(this,function(g){switch(g.label){case 0:if(e.length===0)return[2,[]];for(r=0,i=e.length-1;r<i;r++)if(a=e[r],o=e[r+1],a.node.context!==o.node.context)throw new Ng;s=e[0].node.context,c=s===this.context?function(e){return e}:j_.for(s,this.context).copy,l=Array(e.length),r=0,i=e.length,g.label=1;case 1:return r<i?(u=c(e[r].node),d=t[r],f=n[r],[4,Ov.for(u,d,f)]):[3,4];case 2:p=g.sent(),m=this.context.nextRef(),l[r]=uS.of(m,this,p),g.label=3;case 3:return r++,[3,1];case 4:return(h=this.embeddedPages).push.apply(h,l),[2,l]}})})},e.prototype.flush=function(){return hm(this,void 0,void 0,function(){return gm(this,function(e){switch(e.label){case 0:return[4,this.embedAll(this.fonts)];case 1:return e.sent(),[4,this.embedAll(this.images)];case 2:return e.sent(),[4,this.embedAll(this.embeddedPages)];case 3:return e.sent(),[4,this.embedAll(this.embeddedFiles)];case 4:return e.sent(),[4,this.embedAll(this.javaScripts)];case 5:return e.sent(),[2]}})})},e.prototype.save=function(e){return e===void 0&&(e={}),hm(this,void 0,void 0,function(){var t,n,r,i,a,o,s,c,l,u;return gm(this,function(d){switch(d.label){case 0:return t=e.useObjectStreams,n=t===void 0?!0:t,r=e.addDefaultPage,i=r===void 0?!0:r,a=e.objectsPerTick,o=a===void 0?50:a,s=e.updateFieldAppearances,c=s===void 0?!0:s,Y(n,`useObjectStreams`,[`boolean`]),Y(i,`addDefaultPage`,[`boolean`]),Y(o,`objectsPerTick`,[`number`]),Y(c,`updateFieldAppearances`,[`boolean`]),i&&this.getPageCount()===0&&this.addPage(),c&&(l=this.formCache.getValue(),l&&l.updateFieldAppearances()),[4,this.flush()];case 1:return d.sent(),u=n?B_:I_,[2,u.forContext(this.context,o).serializeToBuffer()]}})})},e.prototype.saveAsBase64=function(e){return e===void 0&&(e={}),hm(this,void 0,void 0,function(){var t,n,r,i,a;return gm(this,function(o){switch(o.label){case 0:return t=e.dataUri,n=t===void 0?!1:t,r=mm(e,[`dataUri`]),Y(n,`dataUri`,[`boolean`]),[4,this.save(r)];case 1:return i=o.sent(),a=xm(i),[2,n?`data:application/pdf;base64,`+a:a]}})})},e.prototype.findPageForAnnotationRef=function(e){for(var t=this.getPages(),n=0,r=t.length;n<r;n++){var i=t[n];if(i.node.Annots()?.indexOf(e)!==void 0)return i}},e.prototype.embedAll=function(e){return hm(this,void 0,void 0,function(){var t,n;return gm(this,function(r){switch(r.label){case 0:t=0,n=e.length,r.label=1;case 1:return t<n?[4,e[t].embed()]:[3,4];case 2:r.sent(),r.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},e.prototype.updateInfoDict=function(){var e=`pdf-lib (https://github.com/Hopding/pdf-lib)`,t=new Date,n=this.getInfoDict();this.setProducer(e),this.setModificationDate(t),n.get(Q.of(`Creator`))||this.setCreator(e),n.get(Q.of(`CreationDate`))||this.setCreationDate(t)},e.prototype.getInfoDict=function(){var e=this.context.lookup(this.context.trailerInfo.Info);if(e instanceof g_)return e;var t=this.context.obj({});return this.context.trailerInfo.Info=this.context.register(t),t},e.prototype.assertFontkit=function(){if(!this.fontkit)throw new jx;return this.fontkit},e}();function NS(e){if(!(e instanceof V_)&&!(e instanceof X_))throw new Og([V_,X_],e)}var PS;(function(e){e.Normal=`Normal`,e.Multiply=`Multiply`,e.Screen=`Screen`,e.Overlay=`Overlay`,e.Darken=`Darken`,e.Lighten=`Lighten`,e.ColorDodge=`ColorDodge`,e.ColorBurn=`ColorBurn`,e.HardLight=`HardLight`,e.SoftLight=`SoftLight`,e.Difference=`Difference`,e.Exclusion=`Exclusion`})(PS||={});var FS=function(){function e(e,t,n){this.fontSize=24,this.fontColor=Ub(0,0,0),this.lineHeight=24,this.x=0,this.y=0,Y(e,`leafNode`,[[A_,`PDFPageLeaf`]]),Y(t,`ref`,[[x_,`PDFRef`]]),Y(n,`doc`,[[MS,`PDFDocument`]]),this.node=e,this.ref=t,this.doc=n}return e.prototype.setRotation=function(e){var t=Ky(e);yg(t,`degreesAngle`,90),this.node.set(Q.of(`Rotate`),this.doc.context.obj(t))},e.prototype.getRotation=function(){var e=this.node.Rotate();return By(e?e.asNumber():0)},e.prototype.setSize=function(e,t){Y(e,`width`,[`number`]),Y(t,`height`,[`number`]);var n=this.getMediaBox();this.setMediaBox(n.x,n.y,e,t);var r=this.getCropBox(),i=this.getBleedBox(),a=this.getTrimBox(),o=this.getArtBox(),s=this.node.CropBox(),c=this.node.BleedBox(),l=this.node.TrimBox(),u=this.node.ArtBox();s&&ag(r,n)&&this.setCropBox(n.x,n.y,e,t),c&&ag(i,n)&&this.setBleedBox(n.x,n.y,e,t),l&&ag(a,n)&&this.setTrimBox(n.x,n.y,e,t),u&&ag(o,n)&&this.setArtBox(n.x,n.y,e,t)},e.prototype.setWidth=function(e){Y(e,`width`,[`number`]),this.setSize(e,this.getSize().height)},e.prototype.setHeight=function(e){Y(e,`height`,[`number`]),this.setSize(this.getSize().width,e)},e.prototype.setMediaBox=function(e,t,n,r){Y(e,`x`,[`number`]),Y(t,`y`,[`number`]),Y(n,`width`,[`number`]),Y(r,`height`,[`number`]);var i=this.doc.context.obj([e,t,e+n,t+r]);this.node.set(Q.MediaBox,i)},e.prototype.setCropBox=function(e,t,n,r){Y(e,`x`,[`number`]),Y(t,`y`,[`number`]),Y(n,`width`,[`number`]),Y(r,`height`,[`number`]);var i=this.doc.context.obj([e,t,e+n,t+r]);this.node.set(Q.CropBox,i)},e.prototype.setBleedBox=function(e,t,n,r){Y(e,`x`,[`number`]),Y(t,`y`,[`number`]),Y(n,`width`,[`number`]),Y(r,`height`,[`number`]);var i=this.doc.context.obj([e,t,e+n,t+r]);this.node.set(Q.BleedBox,i)},e.prototype.setTrimBox=function(e,t,n,r){Y(e,`x`,[`number`]),Y(t,`y`,[`number`]),Y(n,`width`,[`number`]),Y(r,`height`,[`number`]);var i=this.doc.context.obj([e,t,e+n,t+r]);this.node.set(Q.TrimBox,i)},e.prototype.setArtBox=function(e,t,n,r){Y(e,`x`,[`number`]),Y(t,`y`,[`number`]),Y(n,`width`,[`number`]),Y(r,`height`,[`number`]);var i=this.doc.context.obj([e,t,e+n,t+r]);this.node.set(Q.ArtBox,i)},e.prototype.getSize=function(){var e=this.getMediaBox();return{width:e.width,height:e.height}},e.prototype.getWidth=function(){return this.getSize().width},e.prototype.getHeight=function(){return this.getSize().height},e.prototype.getMediaBox=function(){return this.node.MediaBox().asRectangle()},e.prototype.getCropBox=function(){return this.node.CropBox()?.asRectangle()??this.getMediaBox()},e.prototype.getBleedBox=function(){return this.node.BleedBox()?.asRectangle()??this.getCropBox()},e.prototype.getTrimBox=function(){return this.node.TrimBox()?.asRectangle()??this.getCropBox()},e.prototype.getArtBox=function(){return this.node.ArtBox()?.asRectangle()??this.getCropBox()},e.prototype.translateContent=function(e,t){Y(e,`x`,[`number`]),Y(t,`y`,[`number`]),this.node.normalize(),this.getContentStream();var n=this.createContentStream(db(),tb(e,t)),r=this.doc.context.register(n),i=this.createContentStream(fb()),a=this.doc.context.register(i);this.node.wrapContentStreams(r,a)},e.prototype.scale=function(e,t){Y(e,`x`,[`number`]),Y(t,`y`,[`number`]),this.setSize(this.getWidth()*e,this.getHeight()*t),this.scaleContent(e,t),this.scaleAnnotations(e,t)},e.prototype.scaleContent=function(e,t){Y(e,`x`,[`number`]),Y(t,`y`,[`number`]),this.node.normalize(),this.getContentStream();var n=this.createContentStream(db(),nb(e,t)),r=this.doc.context.register(n),i=this.createContentStream(fb()),a=this.doc.context.register(i);this.node.wrapContentStreams(r,a)},e.prototype.scaleAnnotations=function(e,t){Y(e,`x`,[`number`]),Y(t,`y`,[`number`]);var n=this.node.Annots();if(n)for(var r=0;r<n.size();r++){var i=n.lookup(r);i instanceof g_&&this.scaleAnnot(i,e,t)}},e.prototype.resetPosition=function(){this.getContentStream(!1),this.x=0,this.y=0},e.prototype.setFont=function(e){Y(e,`font`,[[dS,`PDFFont`]]),this.font=e,this.fontKey=this.node.newFontDictionary(this.font.name,this.font.ref)},e.prototype.setFontSize=function(e){Y(e,`fontSize`,[`number`]),this.fontSize=e},e.prototype.setFontColor=function(e){Y(e,`fontColor`,[[Object,`Color`]]),this.fontColor=e},e.prototype.setLineHeight=function(e){Y(e,`lineHeight`,[`number`]),this.lineHeight=e},e.prototype.getPosition=function(){return{x:this.x,y:this.y}},e.prototype.getX=function(){return this.x},e.prototype.getY=function(){return this.y},e.prototype.moveTo=function(e,t){Y(e,`x`,[`number`]),Y(t,`y`,[`number`]),this.x=e,this.y=t},e.prototype.moveDown=function(e){Y(e,`yDecrease`,[`number`]),this.y-=e},e.prototype.moveUp=function(e){Y(e,`yIncrease`,[`number`]),this.y+=e},e.prototype.moveLeft=function(e){Y(e,`xDecrease`,[`number`]),this.x-=e},e.prototype.moveRight=function(e){Y(e,`xIncrease`,[`number`]),this.x+=e},e.prototype.pushOperators=function(){var e=[...arguments];gg(e,`operator`,[[S_,`PDFOperator`]]);var t=this.getContentStream();t.push.apply(t,e)},e.prototype.drawText=function(e,t){t===void 0&&(t={}),Y(e,`text`,[`string`]),X(t.color,`options.color`,[[Object,`Color`]]),vg(t.opacity,`opacity.opacity`,0,1),X(t.font,`options.font`,[[dS,`PDFFont`]]),X(t.size,`options.size`,[`number`]),X(t.rotate,`options.rotate`,[[Object,`Rotation`]]),X(t.xSkew,`options.xSkew`,[[Object,`Rotation`]]),X(t.ySkew,`options.ySkew`,[[Object,`Rotation`]]),X(t.x,`options.x`,[`number`]),X(t.y,`options.y`,[`number`]),X(t.lineHeight,`options.lineHeight`,[`number`]),X(t.maxWidth,`options.maxWidth`,[`number`]),X(t.wordBreaks,`options.wordBreaks`,[Array]),dg(t.blendMode,`options.blendMode`,PS);for(var n=this.setOrEmbedFont(t.font),r=n.oldFont,i=n.newFont,a=n.newFontKey,o=t.size||this.fontSize,s=t.wordBreaks||this.doc.defaultWordBreaks,c=t.maxWidth===void 0?Lm(Pm(e)):Hm(e,s,t.maxWidth,function(e){return i.widthOfTextAtSize(e,o)}),l=Array(c.length),u=0,d=c.length;u<d;u++)l[u]=i.encodeText(c[u]);var f=this.maybeEmbedGraphicsState({opacity:t.opacity,blendMode:t.blendMode}),p=this.getContentStream();p.push.apply(p,fx(l,{color:t.color??this.fontColor,font:a,size:o,rotate:t.rotate??By(0),xSkew:t.xSkew??By(0),ySkew:t.ySkew??By(0),x:t.x??this.x,y:t.y??this.y,lineHeight:t.lineHeight??this.lineHeight,graphicsState:f})),t.font&&(r?this.setFont(r):this.resetFont())},e.prototype.drawImage=function(e,t){t===void 0&&(t={}),Y(e,`image`,[[fS,`PDFImage`]]),X(t.x,`options.x`,[`number`]),X(t.y,`options.y`,[`number`]),X(t.width,`options.width`,[`number`]),X(t.height,`options.height`,[`number`]),X(t.rotate,`options.rotate`,[[Object,`Rotation`]]),X(t.xSkew,`options.xSkew`,[[Object,`Rotation`]]),X(t.ySkew,`options.ySkew`,[[Object,`Rotation`]]),vg(t.opacity,`opacity.opacity`,0,1),dg(t.blendMode,`options.blendMode`,PS);var n=this.node.newXObject(`Image`,e.ref),r=this.maybeEmbedGraphicsState({opacity:t.opacity,blendMode:t.blendMode}),i=this.getContentStream();i.push.apply(i,px(n,{x:t.x??this.x,y:t.y??this.y,width:t.width??e.size().width,height:t.height??e.size().height,rotate:t.rotate??By(0),xSkew:t.xSkew??By(0),ySkew:t.ySkew??By(0),graphicsState:r}))},e.prototype.drawPage=function(e,t){t===void 0&&(t={}),Y(e,`embeddedPage`,[[uS,`PDFEmbeddedPage`]]),X(t.x,`options.x`,[`number`]),X(t.y,`options.y`,[`number`]),X(t.xScale,`options.xScale`,[`number`]),X(t.yScale,`options.yScale`,[`number`]),X(t.width,`options.width`,[`number`]),X(t.height,`options.height`,[`number`]),X(t.rotate,`options.rotate`,[[Object,`Rotation`]]),X(t.xSkew,`options.xSkew`,[[Object,`Rotation`]]),X(t.ySkew,`options.ySkew`,[[Object,`Rotation`]]),vg(t.opacity,`opacity.opacity`,0,1),dg(t.blendMode,`options.blendMode`,PS);var n=this.node.newXObject(`EmbeddedPdfPage`,e.ref),r=this.maybeEmbedGraphicsState({opacity:t.opacity,blendMode:t.blendMode}),i=t.width===void 0?t.xScale===void 0?1:t.xScale:t.width/e.width,a=t.height===void 0?t.yScale===void 0?1:t.yScale:t.height/e.height,o=this.getContentStream();o.push.apply(o,mx(n,{x:t.x??this.x,y:t.y??this.y,xScale:i,yScale:a,rotate:t.rotate??By(0),xSkew:t.xSkew??By(0),ySkew:t.ySkew??By(0),graphicsState:r}))},e.prototype.drawSvgPath=function(e,t){t===void 0&&(t={}),Y(e,`path`,[`string`]),X(t.x,`options.x`,[`number`]),X(t.y,`options.y`,[`number`]),X(t.scale,`options.scale`,[`number`]),X(t.rotate,`options.rotate`,[[Object,`Rotation`]]),X(t.borderWidth,`options.borderWidth`,[`number`]),X(t.color,`options.color`,[[Object,`Color`]]),vg(t.opacity,`opacity.opacity`,0,1),X(t.borderColor,`options.borderColor`,[[Object,`Color`]]),X(t.borderDashArray,`options.borderDashArray`,[Array]),X(t.borderDashPhase,`options.borderDashPhase`,[`number`]),dg(t.borderLineCap,`options.borderLineCap`,sb),vg(t.borderOpacity,`options.borderOpacity`,0,1),dg(t.blendMode,`options.blendMode`,PS);var n=this.maybeEmbedGraphicsState({opacity:t.opacity,borderOpacity:t.borderOpacity,blendMode:t.blendMode});!(`color`in t)&&!(`borderColor`in t)&&(t.borderColor=Ub(0,0,0));var r=this.getContentStream();r.push.apply(r,xx(e,{x:t.x??this.x,y:t.y??this.y,scale:t.scale,rotate:t.rotate??By(0),color:t.color??void 0,borderColor:t.borderColor??void 0,borderWidth:t.borderWidth??0,borderDashArray:t.borderDashArray??void 0,borderDashPhase:t.borderDashPhase??void 0,borderLineCap:t.borderLineCap??void 0,graphicsState:n}))},e.prototype.drawLine=function(e){Y(e.start,`options.start`,[[Object,`{ x: number, y: number }`]]),Y(e.end,`options.end`,[[Object,`{ x: number, y: number }`]]),Y(e.start.x,`options.start.x`,[`number`]),Y(e.start.y,`options.start.y`,[`number`]),Y(e.end.x,`options.end.x`,[`number`]),Y(e.end.y,`options.end.y`,[`number`]),X(e.thickness,`options.thickness`,[`number`]),X(e.color,`options.color`,[[Object,`Color`]]),X(e.dashArray,`options.dashArray`,[Array]),X(e.dashPhase,`options.dashPhase`,[`number`]),dg(e.lineCap,`options.lineCap`,sb),vg(e.opacity,`opacity.opacity`,0,1),dg(e.blendMode,`options.blendMode`,PS);var t=this.maybeEmbedGraphicsState({borderOpacity:e.opacity,blendMode:e.blendMode});`color`in e||(e.color=Ub(0,0,0));var n=this.getContentStream();n.push.apply(n,hx({start:e.start,end:e.end,thickness:e.thickness??1,color:e.color??void 0,dashArray:e.dashArray??void 0,dashPhase:e.dashPhase??void 0,lineCap:e.lineCap??void 0,graphicsState:t}))},e.prototype.drawRectangle=function(e){e===void 0&&(e={}),X(e.x,`options.x`,[`number`]),X(e.y,`options.y`,[`number`]),X(e.width,`options.width`,[`number`]),X(e.height,`options.height`,[`number`]),X(e.rotate,`options.rotate`,[[Object,`Rotation`]]),X(e.xSkew,`options.xSkew`,[[Object,`Rotation`]]),X(e.ySkew,`options.ySkew`,[[Object,`Rotation`]]),X(e.borderWidth,`options.borderWidth`,[`number`]),X(e.color,`options.color`,[[Object,`Color`]]),vg(e.opacity,`opacity.opacity`,0,1),X(e.borderColor,`options.borderColor`,[[Object,`Color`]]),X(e.borderDashArray,`options.borderDashArray`,[Array]),X(e.borderDashPhase,`options.borderDashPhase`,[`number`]),dg(e.borderLineCap,`options.borderLineCap`,sb),vg(e.borderOpacity,`options.borderOpacity`,0,1),dg(e.blendMode,`options.blendMode`,PS);var t=this.maybeEmbedGraphicsState({opacity:e.opacity,borderOpacity:e.borderOpacity,blendMode:e.blendMode});!(`color`in e)&&!(`borderColor`in e)&&(e.color=Ub(0,0,0));var n=this.getContentStream();n.push.apply(n,gx({x:e.x??this.x,y:e.y??this.y,width:e.width??150,height:e.height??100,rotate:e.rotate??By(0),xSkew:e.xSkew??By(0),ySkew:e.ySkew??By(0),borderWidth:e.borderWidth??0,color:e.color??void 0,borderColor:e.borderColor??void 0,borderDashArray:e.borderDashArray??void 0,borderDashPhase:e.borderDashPhase??void 0,graphicsState:t,borderLineCap:e.borderLineCap??void 0}))},e.prototype.drawSquare=function(e){e===void 0&&(e={});var t=e.size;X(t,`size`,[`number`]),this.drawRectangle(pm(pm({},e),{width:t,height:t}))},e.prototype.drawEllipse=function(e){e===void 0&&(e={}),X(e.x,`options.x`,[`number`]),X(e.y,`options.y`,[`number`]),X(e.xScale,`options.xScale`,[`number`]),X(e.yScale,`options.yScale`,[`number`]),X(e.rotate,`options.rotate`,[[Object,`Rotation`]]),X(e.color,`options.color`,[[Object,`Color`]]),vg(e.opacity,`opacity.opacity`,0,1),X(e.borderColor,`options.borderColor`,[[Object,`Color`]]),vg(e.borderOpacity,`options.borderOpacity`,0,1),X(e.borderWidth,`options.borderWidth`,[`number`]),X(e.borderDashArray,`options.borderDashArray`,[Array]),X(e.borderDashPhase,`options.borderDashPhase`,[`number`]),dg(e.borderLineCap,`options.borderLineCap`,sb),dg(e.blendMode,`options.blendMode`,PS);var t=this.maybeEmbedGraphicsState({opacity:e.opacity,borderOpacity:e.borderOpacity,blendMode:e.blendMode});!(`color`in e)&&!(`borderColor`in e)&&(e.color=Ub(0,0,0));var n=this.getContentStream();n.push.apply(n,bx({x:e.x??this.x,y:e.y??this.y,xScale:e.xScale??100,yScale:e.yScale??100,rotate:e.rotate??void 0,color:e.color??void 0,borderColor:e.borderColor??void 0,borderWidth:e.borderWidth??0,borderDashArray:e.borderDashArray??void 0,borderDashPhase:e.borderDashPhase??void 0,borderLineCap:e.borderLineCap??void 0,graphicsState:t}))},e.prototype.drawCircle=function(e){e===void 0&&(e={});var t=e.size,n=t===void 0?100:t;X(n,`size`,[`number`]),this.drawEllipse(pm(pm({},e),{xScale:n,yScale:n}))},e.prototype.setOrEmbedFont=function(e){var t=this.font,n=this.fontKey;return e?this.setFont(e):this.getFont(),{oldFont:t,oldFontKey:n,newFont:this.font,newFontKey:this.fontKey}},e.prototype.getFont=function(){if(!this.font||!this.fontKey){var e=this.doc.embedStandardFont(SS.Helvetica);this.setFont(e)}return[this.font,this.fontKey]},e.prototype.resetFont=function(){this.font=void 0,this.fontKey=void 0},e.prototype.getContentStream=function(e){return e===void 0&&(e=!0),e&&this.contentStream?this.contentStream:(this.contentStream=this.createContentStream(),this.contentStreamRef=this.doc.context.register(this.contentStream),this.node.addContentStream(this.contentStreamRef),this.contentStream)},e.prototype.createContentStream=function(){var e=[...arguments],t=this.doc.context.obj({});return E_.of(t,e)},e.prototype.maybeEmbedGraphicsState=function(e){var t=e.opacity,n=e.borderOpacity,r=e.blendMode;if(!(t===void 0&&n===void 0&&r===void 0)){var i=this.doc.context.obj({Type:`ExtGState`,ca:t,CA:n,BM:r});return this.node.newExtGState(`GS`,i)}},e.prototype.scaleAnnot=function(e,t,n){for(var r=[`RD`,`CL`,`Vertices`,`QuadPoints`,`L`,`Rect`],i=0,a=r.length;i<a;i++){var o=e.lookup(Q.of(r[i]));o instanceof r_&&o.scalePDFNumbers(t,n)}var s=e.lookup(Q.of(`InkList`));if(s instanceof r_)for(var i=0,a=s.size();i<a;i++){var c=s.lookup(i);c instanceof r_&&c.scalePDFNumbers(t,n)}},e.of=function(t,n,r){return new e(t,n,r)},e.create=function(t){Y(t,`doc`,[[MS,`PDFDocument`]]);var n=x_.of(-1),r=A_.withContextAndParent(t.context,n);return new e(r,t.context.register(r),t)},e}(),IS=function(e){J(t,e);function t(t,n,r){var i=e.call(this,t,n,r)||this;return Y(t,`acroButton`,[[ey,`PDFAcroPushButton`]]),i.acroField=t,i}return t.prototype.setImage=function(e,t){t===void 0&&(t=pS.Center);for(var n=this.acroField.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r],o=this.createImageAppearanceStream(a,e,t);this.updateWidgetAppearances(a,{normal:o})}this.markAsClean()},t.prototype.setFontSize=function(e){xg(e,`fontSize`),this.acroField.setFontSize(e),this.markAsDirty()},t.prototype.addToPage=function(e,t,n){X(e,`text`,[`string`]),X(t,`page`,[[FS,`PDFPage`]]),mS(n);var r=this.createWidget({x:(n?.x??0)-(n?.borderWidth??0)/2,y:(n?.y??0)-(n?.borderWidth??0)/2,width:n?.width??100,height:n?.height??50,textColor:n?.textColor??Ub(0,0,0),backgroundColor:n?.backgroundColor??Ub(.75,.75,.75),borderColor:n?.borderColor,borderWidth:n?.borderWidth??0,rotate:n?.rotate??By(0),caption:e,hidden:n?.hidden,page:t.ref}),i=this.doc.context.register(r.dict);this.acroField.addWidget(i);var a=n?.font??this.doc.getForm().getDefaultFont();this.updateWidgetAppearance(r,a),t.node.addAnnot(i)},t.prototype.needsAppearancesUpdate=function(){if(this.isDirty())return!0;for(var e=this.acroField.getWidgets(),t=0,n=e.length;t<n;t++)if(!(e[t].getAppearances()?.normal instanceof __))return!0;return!1},t.prototype.defaultUpdateAppearances=function(e){Y(e,`font`,[[dS,`PDFFont`]]),this.updateAppearances(e)},t.prototype.updateAppearances=function(e,t){Y(e,`font`,[[dS,`PDFFont`]]),X(t,`provider`,[Function]);for(var n=this.acroField.getWidgets(),r=0,i=n.length;r<i;r++){var a=n[r];this.updateWidgetAppearance(a,e,t)}},t.prototype.updateWidgetAppearance=function(e,t,n){var r=Qx((n??oS)(this,e,t));this.updateWidgetAppearanceWithFont(e,t,r)},t.of=function(e,n,r){return new t(e,n,r)},t}(hS),LS=typeof process==`object`&&process+``==`[object process]`&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!==`browser`),RS=[1/0,1/0,-1/0,-1/0],zS=new Float32Array(RS),BS=[.001,0,0,.001,0,0],VS=`http://www.w3.org/2000/svg`,HS={ANY:1,DISPLAY:2,PRINT:4,SAVE:8,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},US={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},WS=`pdfjs_internal_id_`,GS=`pdfjs_internal_editor_`,KS={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},qS={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,INK_COLOR_AND_OPACITY:24,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},JS={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},YS={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_ADD_TO_PATH:4,STROKE_ADD_TO_PATH:5,FILL_STROKE_ADD_TO_PATH:6,ADD_TO_PATH:7,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},XS={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},ZS={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26,RICHMEDIA:27},QS={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},$S={ERRORS:0,WARNINGS:1,INFOS:5},eC={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},tC={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},nC={NEED_PASSWORD:1,INCORRECT_PASSWORD:2},rC=$S.WARNINGS;function iC(e){Number.isInteger(e)&&(rC=e)}function aC(){return rC}function oC(e){rC>=$S.INFOS&&console.info(`Info: ${e}`)}function sC(e){rC>=$S.WARNINGS&&console.warn(`Warning: ${e}`)}function cC(e){throw Error(e)}function lC(e,t){e||cC(t)}function uC(e){switch(e?.protocol){case`http:`:case`https:`:case`ftp:`:case`mailto:`:case`tel:`:return!0;default:return!1}}function dC(e,t=null,n=null){if(!e)return null;if(n&&typeof e==`string`&&(n.addDefaultProtocol&&e.startsWith(`www.`)&&e.match(/\./g)?.length>=2&&(e=`http://${e}`),n.tryConvertEncoding))try{e=EC(e)}catch{}let r=t?URL.parse(e,t):URL.parse(e);return uC(r)?r:null}function fC(e,t,n=!1){let r=URL.parse(e);return r?(r.hash=t,r.href):n&&dC(e,`http://example.com`)?e.split(`#`,1)[0]+`${t?`#${t}`:``}`:``}function pC(e){return e.substring(e.lastIndexOf(`/`)+1)}function mC(e,t,n,r=!1){return Object.defineProperty(e,t,{value:n,enumerable:!r,configurable:!0,writable:!1}),n}var hC=function(){function e(e,t){this.message=e,this.name=t}return e.prototype=Error(),e.constructor=e,e}(),gC=class extends hC{constructor(e,t){super(e,`PasswordException`),this.code=t}},_C=class extends hC{constructor(e,t){super(e,`UnknownErrorException`),this.details=t}},vC=class extends hC{constructor(e){super(e,`InvalidPDFException`)}},yC=class extends hC{constructor(e,t,n){super(e,`ResponseException`),this.status=t,this.missing=n}},bC=class extends hC{constructor(e){super(e,`FormatError`)}},xC=class extends hC{constructor(e){super(e,`AbortException`)}};function SC(e){(typeof e!=`object`||e?.length===void 0)&&cC(`Invalid argument for bytesToString`);let t=e.length,n=8192;if(t<n)return String.fromCharCode.apply(null,e);let r=[];for(let i=0;i<t;i+=n){let a=Math.min(i+n,t),o=e.subarray(i,a);r.push(String.fromCharCode.apply(null,o))}return r.join(``)}function CC(e){typeof e!=`string`&&cC(`Invalid argument for stringToBytes`);let t=e.length,n=new Uint8Array(t);for(let r=0;r<t;++r)n[r]=e.charCodeAt(r)&255;return n}var wC=class{static get isLittleEndian(){let e=new Uint8Array(4);e[0]=1;let t=new Uint32Array(e.buffer,0,1);return mC(this,`isLittleEndian`,t[0]===1)}static get isOffscreenCanvasSupported(){return mC(this,`isOffscreenCanvasSupported`,typeof OffscreenCanvas<`u`)}static get isImageDecoderSupported(){return mC(this,`isImageDecoderSupported`,typeof ImageDecoder<`u`)}static get isFloat16ArraySupported(){return mC(this,`isFloat16ArraySupported`,typeof Float16Array<`u`)}static get isSanitizerSupported(){return mC(this,`isSanitizerSupported`,typeof Sanitizer<`u`)}static get platform(){let{platform:e,userAgent:t}=navigator;return mC(this,`platform`,{isAndroid:t.includes(`Android`),isLinux:e.includes(`Linux`),isMac:e.includes(`Mac`),isWindows:e.includes(`Win`),isFirefox:t.includes(`Firefox`)})}static get isCanvasFilterSupported(){let e;return this.isOffscreenCanvasSupported?e=new OffscreenCanvas(1,1).getContext(`2d`):typeof document<`u`&&(e=document.createElement(`canvas`).getContext(`2d`)),mC(this,`isCanvasFilterSupported`,e?.filter!==void 0)}static get isAlphaColorInputSupported(){if(typeof document>`u`)return mC(this,`isAlphaColorInputSupported`,!1);let e=document.createElement(`input`);return e.type=`color`,e.setAttribute(`alpha`,``),e.value=`#ff000080`,mC(this,`isAlphaColorInputSupported`,e.value!==`#ff0000`)}static get isBackdropFilterSupported(){return mC(this,`isBackdropFilterSupported`,typeof CSS<`u`&&CSS.supports(`backdrop-filter`,`blur(1px)`))}},TC=class{static get hexNums(){return mC(this,`hexNums`,Array.from({length:256},(e,t)=>t.toString(16).padStart(2,`0`)))}static makeHexColor(e,t,n){return`#${this.hexNums[e]}${this.hexNums[t]}${this.hexNums[n]}`}static transform(e,t){return[e[0]*t[0]+e[2]*t[1],e[1]*t[0]+e[3]*t[1],e[0]*t[2]+e[2]*t[3],e[1]*t[2]+e[3]*t[3],e[0]*t[4]+e[2]*t[5]+e[4],e[1]*t[4]+e[3]*t[5]+e[5]]}static multiplyByDOMMatrix(e,t){return[e[0]*t.a+e[2]*t.b,e[1]*t.a+e[3]*t.b,e[0]*t.c+e[2]*t.d,e[1]*t.c+e[3]*t.d,e[0]*t.e+e[2]*t.f+e[4],e[1]*t.e+e[3]*t.f+e[5]]}static applyTransform(e,t,n=0){let r=e[n],i=e[n+1];e[n]=r*t[0]+i*t[2]+t[4],e[n+1]=r*t[1]+i*t[3]+t[5]}static applyTransformToBezier(e,t,n=0){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];for(let t=0;t<6;t+=2){let l=e[n+t],u=e[n+t+1];e[n+t]=l*r+u*a+s,e[n+t+1]=l*i+u*o+c}}static applyInverseTransform(e,t){let n=e[0],r=e[1],i=t[0]*t[3]-t[1]*t[2];e[0]=(n*t[3]-r*t[2]+t[2]*t[5]-t[4]*t[3])/i,e[1]=(-n*t[1]+r*t[0]+t[4]*t[1]-t[5]*t[0])/i}static axialAlignedBoundingBox(e,t,n){let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5],l=e[0],u=e[1],d=e[2],f=e[3],p=r*l+s,m=p,h=r*d+s,g=h,_=o*u+c,v=_,y=o*f+c,b=y;if(i!==0||a!==0){let e=i*l,t=i*d,n=a*u,r=a*f;p+=n,g+=n,h+=r,m+=r,_+=e,b+=e,y+=t,v+=t}n[0]=Math.min(n[0],p,h,m,g),n[1]=Math.min(n[1],_,y,v,b),n[2]=Math.max(n[2],p,h,m,g),n[3]=Math.max(n[3],_,y,v,b)}static inverseTransform(e){let t=e[0]*e[3]-e[1]*e[2];return[e[3]/t,-e[1]/t,-e[2]/t,e[0]/t,(e[2]*e[5]-e[4]*e[3])/t,(e[4]*e[1]-e[5]*e[0])/t]}static singularValueDecompose2dScale(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=n**2+r**2,s=n*i+r*a,c=i**2+a**2,l=(o+c)/2,u=Math.sqrt(l**2-(o*c-s**2));t[0]=Math.sqrt(l+u||1),t[1]=Math.sqrt(l-u||1)}static normalizeRect(e){let t=e.slice(0);return e[0]>e[2]&&(t[0]=e[2],t[2]=e[0]),e[1]>e[3]&&(t[1]=e[3],t[3]=e[1]),t}static intersect(e,t){let n=Math.max(Math.min(e[0],e[2]),Math.min(t[0],t[2])),r=Math.min(Math.max(e[0],e[2]),Math.max(t[0],t[2]));if(n>r)return null;let i=Math.max(Math.min(e[1],e[3]),Math.min(t[1],t[3])),a=Math.min(Math.max(e[1],e[3]),Math.max(t[1],t[3]));return i>a?null:[n,i,r,a]}static pointBoundingBox(e,t,n){n[0]=Math.min(n[0],e),n[1]=Math.min(n[1],t),n[2]=Math.max(n[2],e),n[3]=Math.max(n[3],t)}static rectBoundingBox(e,t,n,r,i){i[0]=Math.min(i[0],e,n),i[1]=Math.min(i[1],t,r),i[2]=Math.max(i[2],e,n),i[3]=Math.max(i[3],t,r)}static#e(e,t,n,r,i,a,o,s,c,l){if(c<=0||c>=1)return;let u=1-c,d=c*c,f=d*c,p=u*(u*(u*e+3*c*t)+3*d*n)+f*r,m=u*(u*(u*i+3*c*a)+3*d*o)+f*s;l[0]=Math.min(l[0],p),l[1]=Math.min(l[1],m),l[2]=Math.max(l[2],p),l[3]=Math.max(l[3],m)}static#t(e,t,n,r,i,a,o,s,c,l,u,d){if(Math.abs(c)<1e-12){Math.abs(l)>=1e-12&&this.#e(e,t,n,r,i,a,o,s,-u/l,d);return}let f=l**2-4*u*c;if(f<0)return;let p=Math.sqrt(f),m=2*c;this.#e(e,t,n,r,i,a,o,s,(-l+p)/m,d),this.#e(e,t,n,r,i,a,o,s,(-l-p)/m,d)}static bezierBoundingBox(e,t,n,r,i,a,o,s,c){c[0]=Math.min(c[0],e,o),c[1]=Math.min(c[1],t,s),c[2]=Math.max(c[2],e,o),c[3]=Math.max(c[3],t,s),this.#t(e,n,i,o,t,r,a,s,3*(-e+3*(n-i)+o),6*(e-2*n+i),3*(n-e),c),this.#t(e,n,i,o,t,r,a,s,3*(-t+3*(r-a)+s),6*(t-2*r+a),3*(r-t),c)}};function EC(e){return decodeURIComponent(escape(e))}var DC=null,OC=null;function kC(e){return DC||(DC=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,OC=new Map([[`ſt`,`ſt`]])),e.replaceAll(DC,(e,t,n)=>t?t.normalize(`NFKC`):OC.get(n))}function AC(){if(typeof crypto.randomUUID==`function`)return crypto.randomUUID();let e=new Uint8Array(32);return crypto.getRandomValues(e),SC(e)}function jC(e,t,n){if(!Array.isArray(n)||n.length<2)return!1;let[r,i,...a]=n;if(!e(r)&&!Number.isInteger(r)||!t(i))return!1;let o=a.length,s=!0;switch(i.name){case`XYZ`:if(o<2||o>3)return!1;break;case`Fit`:case`FitB`:return o===0;case`FitH`:case`FitBH`:case`FitV`:case`FitBV`:if(o>1)return!1;break;case`FitR`:if(o!==4)return!1;s=!1;break;default:return!1}for(let e of a)if(!(typeof e==`number`||s&&e===null))return!1;return!0}var MC=()=>[],NC=()=>new Map,PC=()=>Object.create(null),FC=()=>new Set;typeof Iterator.prototype.join!=`function`&&(Iterator.prototype.join=function(e){return[...this].join(e)});function IC(e,t,n){return Math.min(Math.max(e,t),n)}var LC=class e{constructor({viewBox:e,userUnit:t,scale:n,rotation:r,offsetX:i=0,offsetY:a=0,dontFlip:o=!1}){this.viewBox=e,this.userUnit=t,this.scale=n,this.rotation=r,this.offsetX=i,this.offsetY=a,n*=t;let s=(e[2]+e[0])/2,c=(e[3]+e[1])/2,l,u,d,f;switch(r%=360,r<0&&(r+=360),r){case 180:l=-1,u=0,d=0,f=1;break;case 90:l=0,u=1,d=1,f=0;break;case 270:l=0,u=-1,d=-1,f=0;break;case 0:l=1,u=0,d=0,f=-1;break;default:throw Error(`PageViewport: Invalid rotation, must be a multiple of 90 degrees.`)}o&&(d=-d,f=-f);let p,m,h,g;l===0?(p=Math.abs(c-e[1])*n+i,m=Math.abs(s-e[0])*n+a,h=(e[3]-e[1])*n,g=(e[2]-e[0])*n):(p=Math.abs(s-e[0])*n+i,m=Math.abs(c-e[1])*n+a,h=(e[2]-e[0])*n,g=(e[3]-e[1])*n),this.transform=[l*n,u*n,d*n,f*n,p-l*n*s-d*n*c,m-u*n*s-f*n*c],this.width=h,this.height=g}get rawDims(){let e=this.viewBox;return mC(this,`rawDims`,{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:t=this.scale,rotation:n=this.rotation,offsetX:r=this.offsetX,offsetY:i=this.offsetY,dontFlip:a=!1}={}){return new e({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:t,rotation:n,offsetX:r,offsetY:i,dontFlip:a})}convertToViewportPoint(e,t){let n=[e,t];return TC.applyTransform(n,this.transform),n}convertToPdfPoint(e,t){let n=[e,t];return TC.applyInverseTransform(n,this.transform),n}},RC=class e{static textContent(t){let n=[],r={items:n,styles:Object.create(null)};function i(t){if(!t)return;let r=null,a=t.name;if(a===`#text`)r=t.value;else if(e.shouldBuildText(a))t?.attributes?.textContent?r=t.attributes.textContent:t.value&&(r=t.value);else return;if(r!==null&&n.push({str:r}),t.children)for(let e of t.children)i(e)}return i(t),r}static shouldBuildText(e){return!(e===`textarea`||e===`input`||e===`option`||e===`select`)}},zC=/url\(|image-set\(/i,BC=/^on/i,VC=class{static get _allowedHtmlElements(){return mC(this,`_allowedHtmlElements`,new Set([`a`,`b`,`br`,`button`,`div`,`i`,`img`,`input`,`label`,`li`,`ol`,`option`,`p`,`select`,`span`,`sub`,`sup`,`textarea`,`ul`]))}static get _allowedSvgElements(){return mC(this,`_allowedSvgElements`,new Set([`ellipse`,`line`,`path`,`rect`,`svg`]))}static get _allowedRichTextElements(){return mC(this,`_allowedRichTextElements`,new Set([`a`,`b`,`br`,`div`,`i`,`li`,`ol`,`p`,`span`,`sub`,`sup`,`ul`]))}static get _allowedRichTextAttributes(){return mC(this,`_allowedRichTextAttributes`,new Set([`class`,`dir`,`style`]))}static get _allowedRichTextStyles(){return mC(this,`_allowedRichTextStyles`,new Set(`color.font.fontFamily.fontSize.fontStretch.fontStyle.fontWeight.kerningMode.letterSpacing.lineHeight.margin.marginBottom.marginLeft.marginRight.marginTop.orphans.paddingLeft.paddingRight.breakAfter.breakBefore.breakInside.tabInterval.tabStop.textAlign.textDecoration.textIndent.transform.verticalAlign.widows`.split(`.`)))}static setupStorage(e,t,n,r,i){let a=r.getValue(t,{value:null});switch(n.name){case`textarea`:if(a.value!==null&&(e.textContent=a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})});break;case`input`:if(n.attributes.type===`radio`||n.attributes.type===`checkbox`){if(a.value===n.attributes.xfaOn?e.setAttribute(`checked`,!0):a.value===n.attributes.xfaOff&&e.removeAttribute(`checked`),i===`print`)break;e.addEventListener(`change`,e=>{r.setValue(t,{value:e.target.checked?e.target.getAttribute(`xfaOn`):e.target.getAttribute(`xfaOff`)})})}else{if(a.value!==null&&e.setAttribute(`value`,a.value),i===`print`)break;e.addEventListener(`input`,e=>{r.setValue(t,{value:e.target.value})})}break;case`select`:if(a.value!==null){e.setAttribute(`value`,a.value);for(let e of n.children)e.attributes.value===a.value?e.attributes.selected=!0:Object.hasOwn(e.attributes,`selected`)&&delete e.attributes.selected}e.addEventListener(`input`,e=>{let n=e.target.options,i=n.selectedIndex===-1?``:n[n.selectedIndex].value;r.setValue(t,{value:i})});break}}static setAttributes({html:e,element:t,storage:n=null,intent:r,linkService:i}){let{attributes:a}=t,o=e instanceof HTMLAnchorElement;a.type===`radio`&&(a.name=`${a.name}-${r}`);for(let[t,n]of Object.entries(a))if(n!=null&&!BC.test(t)&&!(r===`richText`&&!this._allowedRichTextAttributes.has(t)))switch(t){case`class`:n.length&&e.setAttribute(t,n.join(` `));break;case`dataId`:break;case`id`:e.setAttribute(`data-element-id`,n);break;case`style`:if(r===`richText`){let t=this._allowedRichTextStyles;for(let[r,i]of Object.entries(n))t.has(r)&&!zC.test(i)&&(e.style[r]=i)}else Object.assign(e.style,n);break;case`textContent`:e.textContent=n;break;default:(!o||t!==`href`&&t!==`newWindow`)&&e.setAttribute(t,n)}o&&i?.addLinkAttributes(e,a.href,a.newWindow),n&&a.dataId&&this.setupStorage(e,a.dataId,t,n)}static#e(e,t,n){return n===`richText`?!t&&this._allowedRichTextElements.has(e)?document.createElement(e):null:t?t===VS&&this._allowedSvgElements.has(e)?document.createElementNS(VS,e):null:this._allowedHtmlElements.has(e)?document.createElement(e):null}static render(e){let t=e.annotationStorage,n=e.linkService,r=e.xfaHtml,i=e.intent||`display`,a=this.#e(r.name,r.attributes?.xmlns,i)??document.createElement(`div`);r.attributes&&this.setAttributes({html:a,element:r,intent:i,linkService:n});let o=i!==`richText`,s=e.div;if(s.append(a),e.viewport){let t=`matrix(${e.viewport.transform.join(`,`)})`;s.style.transform=t}o&&s.setAttribute(`class`,`xfaLayer xfaFont`);let c=[];if(r.children.length===0){if(r.value){let e=document.createTextNode(r.value);a.append(e),o&&RC.shouldBuildText(r.name)&&c.push(e)}return{textDivs:c}}let l=[[r,-1,a]];for(;l.length>0;){let[e,r,a]=l.at(-1);if(r+1===e.children.length){l.pop();continue}let s=e.children[++l.at(-1)[1]];if(s===null)continue;let{name:u}=s;if(u===`#text`){let e=document.createTextNode(s.value);c.push(e),a.append(e);continue}let d=this.#e(u,s.attributes?.xmlns,i);if(d){if(a.append(d),s.attributes&&this.setAttributes({html:d,element:s,storage:t,intent:i,linkService:n}),s.children?.length>0)l.push([s,-1,d]);else if(s.value){let e=document.createTextNode(s.value);o&&RC.shouldBuildText(u)&&c.push(e),d.append(e)}}}for(let e of s.querySelectorAll(`.xfaNonInteractive input, .xfaNonInteractive textarea`))e.setAttribute(`readOnly`,!0);return{textDivs:c}}static update(e){let t=`matrix(${e.viewport.transform.join(`,`)})`;e.div.style.transform=t,e.div.hidden=!1}static getPageViewport(e,{scale:t=1,rotation:n=0}){let{width:r,height:i}=e.attributes.style;return new LC({viewBox:[0,0,parseInt(r,10),parseInt(i,10)],userUnit:1,scale:t,rotation:n})}},HC=class{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF};async function UC(e,t=`text`){if(XC(e,document.baseURI)){let n=await fetch(e);if(!n.ok)throw Error(n.statusText);switch(t){case`blob`:return n.blob();case`bytes`:return n.bytes();case`json`:return n.json()}return n.text()}return new Promise((n,r)=>{let i=new XMLHttpRequest;i.open(`GET`,e,!0),i.responseType=t===`bytes`?`arraybuffer`:t,i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE){if(i.status===200||i.status===0){switch(t){case`bytes`:n(new Uint8Array(i.response));return;case`blob`:case`json`:n(i.response);return}n(i.responseText);return}r(Error(i.statusText))}},i.send(null)})}var WC=class extends hC{constructor(e,t=0){super(e,`RenderingCancelledException`),this.extraDelay=t}};function GC(e){let t=e.length,n=0;for(;n<t&&e[n].trim()===``;)n++;return e.substring(n,n+5).toLowerCase()===`data:`}function KC(e){return typeof e==`string`&&/\.pdf$/i.test(e)}function qC(e){return[e]=e.split(/[#?]/,1),pC(e)}function JC(e,t=`document.pdf`){if(typeof e!=`string`)return t;if(GC(e))return sC(`getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.`),t;let n=(e=>{try{return new URL(e)}catch{}try{return new URL(decodeURIComponent(e))}catch{}try{return new URL(e,`https://foo.bar`)}catch{}try{return new URL(decodeURIComponent(e),`https://foo.bar`)}catch{}return null})(e);if(!n)return t;let r=e=>{try{let t=decodeURIComponent(e);return t.includes(`/`)&&(t=pC(t),t.length===4&&i.test(t))?e:t}catch{return e}},i=/\.pdf$/i,a=pC(n.pathname);if(i.test(a))return r(a);if(n.searchParams.size>0){let e=e=>[...e].findLast(e=>i.test(e)),t=e(n.searchParams.values())??e(n.searchParams.keys());if(t)return r(t)}if(n.hash){let{hash:e}=n,t=-1;for(let{index:n}of e.matchAll(/\.pdf\b/gi))t=n;if(t>0){let n=t;for(;n>0&&!`/?#=`.includes(e[n-1]);)n--;if(n<t)return r(e.slice(n,t+4))}}return t}var YC=class{#e=new Map;times=[];time(e){this.#e.has(e)&&sC(`Timer is already running for ${e}`),this.#e.set(e,Date.now())}timeEnd(e){this.#e.has(e)||sC(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.#e.get(e),end:Date.now()}),this.#e.delete(e)}toString(){let e=Math.max(...this.times.map(e=>e.name.length));return this.times.map(t=>`${t.name.padEnd(e)} ${t.end-t.start}ms\n`).join(``)}};function XC(e,t){let n=t?URL.parse(e,t):URL.parse(e);return/https?:/.test(n?.protocol??``)}function ZC(e){e.preventDefault()}function QC(e){e.preventDefault(),e.stopPropagation()}var $C=class{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!=`string`)return null;this.#e||=RegExp(`^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+\\-])?(\\d{2})?'?(\\d{2})?'?`);let t=this.#e.exec(e);if(!t)return null;let n=parseInt(t[1],10),r=parseInt(t[2],10);r=r>=1&&r<=12?r-1:0;let i=parseInt(t[3],10);i=i>=1&&i<=31?i:1;let a=parseInt(t[4],10);a=a>=0&&a<=23?a:0;let o=parseInt(t[5],10);o=o>=0&&o<=59?o:0;let s=parseInt(t[6],10);s=s>=0&&s<=59?s:0;let c=t[7]||`Z`,l=parseInt(t[8],10);l=l>=0&&l<=23?l:0;let u=parseInt(t[9],10)||0;return u=u>=0&&u<=59?u:0,c===`-`?(a+=l,o+=u):c===`+`&&(a-=l,o-=u),new Date(Date.UTC(n,r,i,a,o,s))}};function ew(e){if(e.startsWith(`#`)){let t=e.slice(1);return[parseInt(t.slice(0,2),16),parseInt(t.slice(2,4),16),parseInt(t.slice(4,6),16),t.length>=8?parseInt(t.slice(6,8),16)/255:1]}if(e.startsWith(`rgb(`)){let[t,n,r]=e.slice(4,-1).split(`,`).map(e=>parseInt(e,10));return[t,n,r,1]}if(e.startsWith(`rgba(`)){let t=e.slice(5,-1).split(`,`);return[parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3])]}let t=e.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);return t?[Math.round(parseFloat(t[1])*255),Math.round(parseFloat(t[2])*255),Math.round(parseFloat(t[3])*255),t[4]!==void 0&&t[4]!==`none`?parseFloat(t[4]):1]:null}function tw(e){let t=ew(e);return t?t.slice(0,3):(sC(`Not a valid color format: "${e}"`),[0,0,0])}function nw(e){let t=document.createElement(`span`);t.style.visibility=`hidden`,t.style.colorScheme=`only light`,document.body.append(t);for(let n of e.keys()){t.style.color=n;let r=window.getComputedStyle(t).color;e.set(n,tw(r))}t.remove()}function rw(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform();return[t,n,r,i,a,o]}function iw(e){let{a:t,b:n,c:r,d:i,e:a,f:o}=e.getTransform().invertSelf();return[t,n,r,i,a,o]}function aw(e,t,n=!1,r=!0){if(t instanceof LC){let{pageWidth:r,pageHeight:i}=t.rawDims,{style:a}=e,o=`round(down, var(--total-scale-factor) * ${r}px, var(--scale-round-x))`,s=`round(down, var(--total-scale-factor) * ${i}px, var(--scale-round-y))`;!n||t.rotation%180==0?(a.width=o,a.height=s):(a.width=s,a.height=o)}r&&e.setAttribute(`data-main-rotation`,t.rotation)}var ow=class e{constructor(){let{pixelRatio:t}=e;this.sx=t,this.sy=t}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(t,n,r,i,a=-1){let o=1/0,s=1/0,c=1/0;r=e.capPixels(r,a),r>0&&(o=Math.sqrt(r/(t*n))),i!==-1&&(s=i/t,c=i/n);let l=Math.min(o,s,c);return this.sx>l||this.sy>l?(this.sx=l,this.sy=l,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,t){if(t>=0){let n=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+t/100));return e>0?Math.min(e,n):n}return e}},sw=[`image/apng`,`image/avif`,`image/bmp`,`image/gif`,`image/jpeg`,`image/png`,`image/svg+xml`,`image/webp`,`image/x-icon`],cw=class{static get isDarkMode(){return mC(this,`isDarkMode`,!!window?.matchMedia?.(`(prefers-color-scheme: dark)`).matches)}},lw=class{static get commentForegroundColor(){let e=document.createElement(`span`);e.classList.add(`comment`,`sidebar`);let{style:t}=e;t.width=t.height=`0`,t.display=`none`,t.color=`var(--comment-fg-color)`,document.body.append(e);let{color:n}=window.getComputedStyle(e);return e.remove(),mC(this,`commentForegroundColor`,tw(n))}};function uw(e,t){t=IC(t??1,0,1);let n=255*(1-t);return e.map(e=>Math.round(e*t+n))}function dw(e,t){let n=e[0]/255,r=e[1]/255,i=e[2]/255,a=Math.max(n,r,i),o=Math.min(n,r,i),s=(a+o)/2;if(a===o)t[0]=t[1]=0;else{let e=a-o;switch(t[1]=s<.5?e/(a+o):e/(2-a-o),a){case n:t[0]=((r-i)/e+(r<i?6:0))*60;break;case r:t[0]=((i-n)/e+2)*60;break;case i:t[0]=((n-r)/e+4)*60;break}}t[2]=s}function fw(e,t){let n=e[0],r=e[1],i=e[2],a=(1-Math.abs(2*i-1))*r,o=a*(1-Math.abs(n/60%2-1)),s=i-a/2;switch(Math.floor(n/60)){case 0:t[0]=a+s,t[1]=o+s,t[2]=s;break;case 1:t[0]=o+s,t[1]=a+s,t[2]=s;break;case 2:t[0]=s,t[1]=a+s,t[2]=o+s;break;case 3:t[0]=s,t[1]=o+s,t[2]=a+s;break;case 4:t[0]=o+s,t[1]=s,t[2]=a+s;break;case 5:case 6:t[0]=a+s,t[1]=s,t[2]=o+s;break}}function pw(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function mw(e,t,n){fw(e,n),n.map(pw);let r=.2126*n[0]+.7152*n[1]+.0722*n[2];fw(t,n),n.map(pw);let i=.2126*n[0]+.7152*n[1]+.0722*n[2];return r>i?(r+.05)/(i+.05):(i+.05)/(r+.05)}var hw=new Map;function gw(e,t){let n=e[0]+e[1]*256+e[2]*65536+t[0]*16777216+t[1]*4294967296+t[2]*1099511627776,r=hw.get(n);if(r)return r;let i=new Float32Array(9),a=i.subarray(0,3),o=i.subarray(3,6);dw(e,o);let s=i.subarray(6,9);dw(t,s);let c=s[2]<.5,l=c?12:4.5;if(o[2]=c?Math.sqrt(o[2]):1-Math.sqrt(1-o[2]),mw(o,s,a)<l){let e,t;for(c?(e=o[2],t=1):(e=0,t=o[2]);t-e>.005;){let n=o[2]=(e+t)/2;c===mw(o,s,a)<l?e=n:t=n}o[2]=c?t:e}return fw(o,a),r=TC.makeHexColor(Math.round(a[0]*255),Math.round(a[1]*255),Math.round(a[2]*255)),hw.set(n,r),r}function _w({html:e,dir:t,className:n},r){let i=document.createDocumentFragment();if(typeof e==`string`){let n=document.createElement(`p`);n.dir=t||`auto`;let r=e.split(/\r\n?|\n/);for(let e=0,t=r.length;e<t;++e){let i=r[e];n.append(document.createTextNode(i)),e<t-1&&n.append(document.createElement(`br`))}i.append(n)}else VC.render({xfaHtml:e,div:i,intent:`richText`});i.firstElementChild.classList.add(`richText`,n),r.append(i)}function vw(e){let t=new Path2D;if(!e)return t;for(let n=0,r=e.length;n<r;)switch(e[n++]){case tC.moveTo:t.moveTo(e[n++],e[n++]);break;case tC.lineTo:t.lineTo(e[n++],e[n++]);break;case tC.curveTo:t.bezierCurveTo(e[n++],e[n++],e[n++],e[n++],e[n++],e[n++]);break;case tC.quadraticCurveTo:t.quadraticCurveTo(e[n++],e[n++],e[n++],e[n++]);break;case tC.closePath:t.closePath();break;default:sC(`Unrecognized drawing path operator: ${e[n-1]}`);break}return t}var yw=class e{#e=null;#t=null;#n;#r=null;#i=null;#a=null;#o=null;#s=null;static#c=null;constructor(t){this.#n=t,e.#c||=Object.freeze({freetext:`pdfjs-editor-remove-freetext-button`,highlight:`pdfjs-editor-remove-highlight-button`,ink:`pdfjs-editor-remove-ink-button`,stamp:`pdfjs-editor-remove-stamp-button`,signature:`pdfjs-editor-remove-signature-button`})}render(){let t=this.#e=document.createElement(`div`);t.classList.add(`editToolbar`,`hidden`),t.setAttribute(`role`,`toolbar`);let n=this.#n._uiManager._signal;n instanceof AbortSignal&&!n.aborted&&(t.addEventListener(`contextmenu`,ZC,{signal:n}),t.addEventListener(`pointerdown`,e.#l,{signal:n}));let r=this.#r=document.createElement(`div`);r.className=`buttons`,t.append(r);let i=this.#n.toolbarPosition;if(i){let{style:e}=t;e.insetInlineEnd=`${100*(this.#n._uiManager.direction===`ltr`?1-i[0]:i[0])}%`,e.top=`calc(${100*i[1]}% + var(--editor-toolbar-vert-offset))`}return t}get div(){return this.#e}static#l(e){e.stopPropagation()}#u(e){this.#n._focusEventsAllowed=!1,QC(e)}#d(e){this.#n._focusEventsAllowed=!0,QC(e)}#f(e){let t=this.#n._uiManager._signal;return!(t instanceof AbortSignal)||t.aborted?!1:(e.addEventListener(`focusin`,this.#u.bind(this),{capture:!0,signal:t}),e.addEventListener(`focusout`,this.#d.bind(this),{capture:!0,signal:t}),e.addEventListener(`contextmenu`,ZC,{signal:t}),!0)}hide(){this.#e.classList.add(`hidden`),this.#t?.hideDropdown()}show(){this.#e.classList.remove(`hidden`),this.#i?.shown(),this.#a?.shown()}addDeleteButton(){let{editorType:t,_uiManager:n}=this.#n,r=document.createElement(`button`);r.classList.add(`basic`,`deleteButton`),r.tabIndex=0,r.setAttribute(`data-l10n-id`,e.#c[t]),this.#f(r)&&r.addEventListener(`click`,e=>{n.delete()},{signal:n._signal}),this.#r.append(r)}get#p(){let e=document.createElement(`div`);return e.className=`divider`,e}async addAltText(e){let t=await e.render();this.#f(t),this.#r.append(t,this.#p),this.#i=e}addComment(e,t=null){if(this.#a)return;let n=e.renderForToolbar();if(!n)return;this.#f(n);let r=this.#o=this.#p;t?(this.#r.insertBefore(n,t),this.#r.insertBefore(r,t)):this.#r.append(n,r),this.#a=e,e.toolbar=this}addColorPicker(e){if(this.#t)return;this.#t=e;let t=e.renderButton();this.#f(t),this.#r.append(t,this.#p)}async addEditSignatureButton(e){let t=this.#s=await e.renderEditButton(this.#n);this.#f(t),this.#r.append(t,this.#p)}removeButton(e){switch(e){case`comment`:this.#a?.removeToolbarCommentButton(),this.#a=null,this.#o?.remove(),this.#o=null;break}}async addButton(e,t){switch(e){case`colorPicker`:t&&this.addColorPicker(t);break;case`altText`:t&&await this.addAltText(t);break;case`editSignature`:t&&await this.addEditSignatureButton(t);break;case`delete`:this.addDeleteButton();break;case`comment`:t&&this.addComment(t);break}}async addButtonBefore(e,t,n){if(!t&&e===`comment`)return;let r=this.#r.querySelector(n);r&&e===`comment`&&this.addComment(t,r)}updateEditSignatureButton(e){this.#s&&(this.#s.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}},bw=class{#e=null;#t=null;#n;constructor(e){this.#n=e}#r(){let e=this.#t=document.createElement(`div`);e.className=`editToolbar`,e.setAttribute(`role`,`toolbar`),e.dir=this.#n.direction;let t=this.#n._signal;t instanceof AbortSignal&&!t.aborted&&e.addEventListener(`contextmenu`,ZC,{signal:t});let n=this.#e=document.createElement(`div`);return n.className=`buttons`,e.append(n),this.#n.hasCommentManager()&&this.#a(`commentButton`,`pdfjs-comment-floating-button`,`pdfjs-comment-floating-button-label`,()=>{this.#n.commentSelection(`floating_button`)}),this.#a(`highlightButton`,`pdfjs-highlight-floating-button1`,`pdfjs-highlight-floating-button-label`,()=>{this.#n.highlightSelection(`floating_button`)}),e}#i(e,t){let n=0,r=0;for(let i of e){let e=i.y+i.height;if(e<n)continue;let a=i.x+(t?i.width:0);if(e>n){r=a,n=e;continue}t?a>r&&(r=a):a<r&&(r=a)}return[t?1-r:r,n]}show(e,t,n){let[r,i]=this.#i(t,n),{style:a}=this.#t||=this.#r();e.append(this.#t),a.insetInlineEnd=`${100*r}%`,a.top=`calc(${100*i}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#a(e,t,n,r){let i=document.createElement(`button`);i.classList.add(`basic`,e),i.tabIndex=0,i.setAttribute(`data-l10n-id`,t);let a=document.createElement(`span`);i.append(a),a.className=`visuallyHidden`,a.setAttribute(`data-l10n-id`,n);let o=this.#n._signal;o instanceof AbortSignal&&!o.aborted&&(i.addEventListener(`contextmenu`,ZC,{signal:o}),i.addEventListener(`click`,r,{signal:o})),this.#e.append(i)}},xw=Object.freeze({internal:`59968104-cc61-4cf9-b570-014b35b3709c`});function Sw(e,t,n){for(let r of n)t.addEventListener(r,e[r].bind(e))}var Cw=class e{static#e=NaN;static#t=null;static#n=NaN;static#r=null;static initializeAndAddPointerId(t){(e.#t||=new Set).add(t)}static setPointer(t,n){e.#e||=n,e.#r??=t}static setTimeStamp(t){e.#n=t}static isSamePointerId(t){return e.#e===t}static isSamePointerIdOrRemove(t){return e.#e===t?!0:(e.#t?.delete(t),!1)}static isSamePointerType(t){return e.#r===t}static isInitializedAndDifferentPointerType(t){return e.#r!==null&&!e.isSamePointerType(t)}static isSameTimeStamp(t){return e.#n===t}static isUsingMultiplePointers(){return e.#t?.size>=1}static clearPointerType(){e.#r=null}static clearPointerIds(){e.#e=NaN,e.#t=null}static clearTimeStamp(){e.#n=NaN}},ww=class{#e=0;get id(){return`${GS}${this.#e++}`}},Tw=class e{#e=AC();#t=0;#n=null;static get _isSVGFittingCanvas(){let e=`data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="${VS}"><rect width="1" height="1" style="fill:red;"/></svg>`,t=new OffscreenCanvas(1,3).getContext(`2d`,{willReadFrequently:!0}),n=new Image;n.src=e;let r=n.decode().then(()=>(t.drawImage(n,0,0,1,1,0,0,1,3),new Uint32Array(t.getImageData(0,0,1,1).data.buffer)[0]===0));return mC(this,`_isSVGFittingCanvas`,r)}async#r(t,n){this.#n||=new Map;let r=this.#n.get(t);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let t;if(typeof n==`string`?(r.url=n,t=await UC(n,`blob`)):n instanceof File?t=r.file=n:n instanceof Blob&&(t=n),t.type===`image/svg+xml`){let n=e._isSVGFittingCanvas,i=new FileReader,a=new Image,o=new Promise((e,t)=>{a.onload=()=>{r.bitmap=a,r.isSvg=!0,e()},i.onload=async()=>{let e=r.svgUrl=i.result;a.src=await n?`${e}#svgView(preserveAspectRatio(none))`:e},a.onerror=i.onerror=t});i.readAsDataURL(t),await o}else r.bitmap=await createImageBitmap(t);r.refCounter=1}catch(e){sC(e),r=null}return this.#n.set(t,r),r&&this.#n.set(r.id,r),r}async getFromFile(e){let{lastModified:t,name:n,size:r,type:i}=e;return this.#r(`${t}_${n}_${r}_${i}`,e)}async getFromUrl(e){return this.#r(e,e)}async getFromBlob(e,t){let n=await t;return this.#r(e,n)}async getFromId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t)return null;if(t.bitmap)return t.refCounter+=1,t;if(t.file)return this.getFromFile(t.file);if(t.blobPromise){let{blobPromise:e}=t;return delete t.blobPromise,this.getFromBlob(t.id,e)}return this.getFromUrl(t.url)}getFromCanvas(e,t){this.#n||=new Map;let n=this.#n.get(e);if(n?.bitmap)return n.refCounter+=1,n;let r=new OffscreenCanvas(t.width,t.height);return r.getContext(`2d`).drawImage(t,0,0),n={bitmap:r.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#n.set(e,n),this.#n.set(n.id,n),n}getSvgUrl(e){let t=this.#n.get(e);return t?.isSvg?t.svgUrl:null}deleteId(e){this.#n||=new Map;let t=this.#n.get(e);if(!t||(--t.refCounter,t.refCounter!==0))return;let{bitmap:n}=t;if(!t.url&&!t.file){let e=new OffscreenCanvas(n.width,n.height);e.getContext(`bitmaprenderer`).transferFromImageBitmap(n),t.blobPromise=e.convertToBlob()}n.close?.(),t.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}},Ew=class{#e=[];#t=!1;#n;#r=-1;constructor(e=128){this.#n=e}add({cmd:e,undo:t,post:n,mustExec:r,type:i=NaN,overwriteIfSameType:a=!1,keepUndo:o=!1}){if(r&&e(),this.#t)return;let s={cmd:e,undo:t,post:n,type:i};if(this.#r===-1){this.#e.length>0&&(this.#e.length=0),this.#r=0,this.#e.push(s);return}if(a&&this.#e[this.#r].type===i){o&&(s.undo=this.#e[this.#r].undo),this.#e[this.#r]=s;return}let c=this.#r+1;c===this.#n?this.#e.splice(0,1):(this.#r=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(s)}undo(){if(this.#r===-1)return;this.#t=!0;let{undo:e,post:t}=this.#e[this.#r];e(),t?.(),this.#t=!1,--this.#r}redo(){if(this.#r<this.#e.length-1){this.#r+=1,this.#t=!0;let{cmd:e,post:t}=this.#e[this.#r];e(),t?.(),this.#t=!1}}hasSomethingToUndo(){return this.#r!==-1}hasSomethingToRedo(){return this.#r<this.#e.length-1}cleanType(e){if(this.#r!==-1){for(let t=this.#r;t>=0;t--)if(this.#e[t].type!==e){this.#e.splice(t+1,this.#r-t),this.#r=t;return}this.#e.length=0,this.#r=-1}}destroy(){this.#e=null}},Dw=class e{static ALT=1;static CTRL=2;static META=4;static SHIFT=8;constructor(t){this.callbacks=new Map;let{isMac:n}=wC.platform;for(let[r,i,a={}]of t){let t=r.some(e=>e.startsWith(`mac+`));for(let o of r){let r=o;if(t){let e=o.startsWith(`mac+`);if(n!==e)continue;e&&(r=o.slice(4))}let[s,c]=e.#e(r);s!==null&&this.callbacks.getOrInsertComputed(s,MC).push({callback:i,options:a,modifiers:c})}}}static#e(t){let n=null,r=0;for(let i of t.split(`+`)){if(i=i.trim(),!i)continue;let a=i.toUpperCase(),o=e[a];if(o){r|=o;continue}if(n!==null){sC(`KeyboardManager: multiple keys in shortcut "${t}"`);break}n=a===`SPACE`?` `:i}return n===null&&sC(`KeyboardManager: no key found in shortcut "${t}"`),[n,r]}static#t(e){let t=/^(?:Key([A-Z])|(?:Digit|Numpad)(\d))$/.exec(e);return t?t[1]?.toLowerCase()??t[2]:null}exec(t,n){let r=this.callbacks.get(n.key);if(!r){if(/^[a-z]$/i.test(n.key))return;let t=e.#t(n.code);if(t===null||t===n.key||(r=this.callbacks.get(t),!r))return}let i=(n.altKey?e.ALT:0)|(n.ctrlKey?e.CTRL:0)|(n.metaKey?e.META:0)|(n.shiftKey?e.SHIFT:0),a=r.find(e=>e.modifiers===i);if(!a)return;let{callback:o,options:{bubbles:s=!1,args:c=[],checker:l=null}}=a;l&&!l(t,n)||(o.bind(t,...c,n)(),s||QC(n))}},Ow=class e{static _colorsMapping=new Map([[`CanvasText`,[0,0,0]],[`Canvas`,[255,255,255]]]);get _colors(){let e=new Map([[`CanvasText`,null],[`Canvas`,null]]);return nw(e),mC(this,`_colors`,e)}convert(t){let n=tw(t);if(!window.matchMedia(`(forced-colors: active)`).matches)return n;for(let[t,r]of this._colors)if(r.every((e,t)=>e===n[t]))return e._colorsMapping.get(t);return n}getHexCode(e){let t=this._colors.get(e);return t?TC.makeHexColor(...t):e}},kw=class e{#e=new AbortController;#t=null;#n=null;#r=new Map;#i=new Map;#a=null;#o=null;#s=null;#c=null;#l=null;#u=new Ew;#d=null;#f=null;#p=null;#m=0;#h=new Set;#g=null;#_=null;#v=new Set;_editorUndoBar=null;#y=!1;#b=!1;#x=!1;#S=null;#C=null;#w=null;#T=null;#E=!1;#D=null;#O=new ww;#k=!1;#A=!1;#j=!1;#M=null;#N=null;#P=null;#F=null;#I=null;#L=KS.NONE;#R=new Set;#z=null;#B=null;#V=null;#H=null;#U=null;#W={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#G=[0,0];#K=null;#q=null;#J=null;#Y=null;#X=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.#q.contains(document.activeElement)&&document.activeElement.tagName!==`BUTTON`&&e.hasSomethingToControl(),r=(e,{target:t})=>{if(t instanceof HTMLInputElement){let{type:e}=t;return e!==`text`&&e!==`number`}return!0},i=this.TRANSLATE_SMALL,a=this.TRANSLATE_BIG;return mC(this,`_keyboardManager`,new Dw([[[`ctrl+a`,`mac+meta+a`],t.selectAll,{checker:r}],[[`ctrl+z`,`mac+meta+z`],t.undo,{checker:r}],[[`ctrl+y`,`ctrl+shift+z`,`mac+meta+shift+z`,`ctrl+shift+Z`,`mac+meta+shift+Z`],t.redo,{checker:r}],[[`Backspace`,`alt+Backspace`,`ctrl+Backspace`,`shift+Backspace`,`mac+Backspace`,`mac+alt+Backspace`,`mac+ctrl+Backspace`,`Delete`,`ctrl+Delete`,`shift+Delete`,`mac+Delete`],t.delete,{checker:r}],[[`Enter`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#q.contains(t)&&!e.isEnterHandled}],[[`Space`],t.addNewEditorFromKeyboard,{checker:(e,{target:t})=>!(t instanceof HTMLButtonElement)&&e.#q.contains(document.activeElement)}],[[`Escape`],t.unselectAll],[[`ArrowLeft`],t.translateSelectedEditors,{args:[-i,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t.translateSelectedEditors,{args:[-a,0],checker:n}],[[`ArrowRight`],t.translateSelectedEditors,{args:[i,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t.translateSelectedEditors,{args:[a,0],checker:n}],[[`ArrowUp`],t.translateSelectedEditors,{args:[0,-i],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t.translateSelectedEditors,{args:[0,-a],checker:n}],[[`ArrowDown`],t.translateSelectedEditors,{args:[0,i],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t.translateSelectedEditors,{args:[0,a],checker:n}]]))}constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){let g=this._signal=this.#e.signal;this.#q=e,this.#J=t,this.#Y=n,this.#s=r,this.#d=i,this.#B=a,this.#U=s,this._eventBus=o;let _={signal:g,...xw};o.on(`editingaction`,this.onEditingAction.bind(this),_),o.on(`pagechanging`,this.onPageChanging.bind(this),_),o.on(`scalechanging`,this.onScaleChanging.bind(this),_),o.on(`rotationchanging`,this.onRotationChanging.bind(this),_),o.on(`setpreference`,this.onSetPreference.bind(this),_),o.on(`switchannotationeditorparams`,e=>this.updateParams(e.type,e.value),_),window.addEventListener(`pointerdown`,()=>{this.#A=!0},{capture:!0,signal:g}),window.addEventListener(`pointerup`,()=>{this.#A=!1},{capture:!0,signal:g}),window.addEventListener(`beforeunload`,this.endCurrentEditing.bind(this),{capture:!0,signal:g}),this.#ne(),this.#le(),this.#ae(),this.#c=s.annotationStorage,this.#S=s.filterFactory,this.#V=c,this.#T=l||null,this.#y=u,this.#b=d,this.#x=f,this.#I=p||null,this.viewParameters={realScale:HC.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=m||null,this._supportsPinchToZoom=h!==!1,i?.setSidebarUiManager(this)}destroy(){this.#X?.resolve(),this.#X=null,this.#e?.abort(),this.#e=null,this._signal=null;for(let e of this.#i.values())e.destroy();this.#i.clear(),this.#r.clear(),this.#v.clear(),this.#F?.clear(),this.#t=null,this.#R.clear(),this.#u.destroy(),this.#s?.destroy(),this.#d?.destroy(),this.#B?.destroy(),this.#D?.hide(),this.#D=null,this.#P?.destroy(),this.#P=null,this.#n=null,this.#C&&=(clearTimeout(this.#C),null),this.#K&&=(clearTimeout(this.#K),null),this._editorUndoBar?.destroy(),this.#U=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#I}get useNewAltTextFlow(){return this.#b}get useNewAltTextWhenAddingImage(){return this.#x}get hcmFilter(){return mC(this,`hcmFilter`,this.#V?this.#S.addHCMFilter(this.#V.foreground,this.#V.background):`none`)}get direction(){return mC(this,`direction`,getComputedStyle(this.#q).direction)}get _highlightColors(){return mC(this,`_highlightColors`,this.#T?new Map(this.#T.split(`,`).map(e=>(e=e.split(`=`).map(e=>e.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){let{_highlightColors:e}=this;if(!e)return mC(this,`highlightColors`,null);let t=new Map,n=!!this.#V;for(let[r,i]of e){let e=r.endsWith(`_HCM`);if(n&&e){t.set(r.replace(`_HCM`,``),i);continue}!n&&!e&&t.set(r,i)}return mC(this,`highlightColors`,t)}get highlightColorNames(){return mC(this,`highlightColorNames`,this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;let t=this.highlightColorNames.get(e);return this._highlightColors.get(t)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#p=e}setMainHighlightColorPicker(e){this.#P=e}editAltText(e,t=!1){this.#s?.editAltText(this,e,t)}hasCommentManager(){return!!this.#d}editComment(e,t,n,r){this.#d?.showDialog(this,e,t,n,r)}selectComment(e,t){(this.#i.get(e)?.getEditorByUID(t))?.toggleComment(!0,!0)}updateComment(e){this.#d?.updateComment(e.getData())}updatePopupColor(e){this.#d?.updatePopupColor(e)}removeComment(e){this.#d?.removeComments([e.uid])}deleteComment(e,t){let n=()=>{e.comment=t};this.addCommands({cmd:()=>{this._editorUndoBar?.show(n,`comment`),this.toggleComment(null),e.comment=null},undo:n,mustExec:!0})}toggleComment(e,t,n=void 0){this.#d?.toggleCommentPopup(e,t,n)}makeCommentColor(e,t){return e&&this.#d?.makeCommentColor(e,t)||null}getCommentDialogElement(){return this.#d?.dialogElement||null}async waitForEditorsRendered(e){if(this.#i.has(e-1))return;let{resolve:t,promise:n}=Promise.withResolvers(),r=n=>{n.pageNumber===e&&(this._eventBus.off(`editorsrendered`,r),t())};this._eventBus.on(`editorsrendered`,r,xw),await n}getSignature(e){this.#B?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#B}switchToMode(e,t){this._eventBus.on(`annotationeditormodechanged`,t,{once:!0,signal:this._signal,...xw}),this._eventBus.dispatch(`showannotationeditorui`,{source:this,mode:e})}setPreference(e,t){this._eventBus.dispatch(`setpreference`,{source:this,name:e,value:t})}onSetPreference({name:e,value:t}){switch(e){case`enableNewAltTextWhenAddingImage`:this.#x=t;break}}onPageChanging({pageNumber:e}){this.#m=e-1}deletePage(e){for(let t of this.getEditors(e))t.remove();this.#i.delete(e),this.#m===e&&(this.#m=0)}focusMainContainer(){this.#q.focus()}findParent(e,t){for(let n of this.#i.values()){let{x:r,y:i,width:a,height:o}=n.div.getBoundingClientRect();if(e>=r&&e<=r+a&&t>=i&&t<=i+o)return n}return null}disableUserSelect(e=!1){this.#J.classList.toggle(`noUserSelect`,e)}addShouldRescale(e){this.#v.add(e)}removeShouldRescale(e){this.#v.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*HC.PDF_TO_CSS_UNITS;for(let e of this.#v)e.onScaleChanging();this.#p?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#Z({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#Q(e){let{currentLayer:t}=this;if(t.hasTextLayer(e))return t;for(let t of this.#i.values())if(t.hasTextLayer(e))return t;return null}highlightSelection(e=``,t=!1){let n=document.getSelection();if(!n||n.isCollapsed)return;let{anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o}=n,s=n.toString(),c=this.#Z(n).closest(`.textLayer`),l=this.getSelectionBoxes(c);if(!l)return;n.empty();let u=this.#Q(c),d=this.#L===KS.NONE,f=()=>{let n=u?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:l,anchorNode:r,anchorOffset:i,focusNode:a,focusOffset:o,text:s});d&&this.showAllEditors(`highlight`,!0,!0),t&&n?.editComment()};if(d){this.switchToMode(KS.HIGHLIGHT,f);return}f()}commentSelection(e=``){this.highlightSelection(e,!0)}endCurrentEditing(){this.commitOrRemove(),this.currentLayer?.endDrawingSession(!1)}#$(){let e=document.getSelection();if(!e||e.isCollapsed)return;let t=this.#Z(e).closest(`.textLayer`),n=this.getSelectionBoxes(t);n&&(this.#D||=new bw(this),this.#D.show(t,n,this.direction===`ltr`))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#c)return null;let t=`${GS}${e}`,n=this.#c.getRawValue(t);return n&&this.#c.remove(t),n}addToAnnotationStorage(e){!e.isEmpty()&&this.#c&&!this.#c.has(e.id)&&this.#c.setValue(e.id,e)}a11yAlert(e,t=null){let n=this.#Y;n&&(n.setAttribute(`data-l10n-id`,e),t?n.setAttribute(`data-l10n-args`,JSON.stringify(t)):n.removeAttribute(`data-l10n-args`))}#ee(){let e=document.getSelection();if(!e||e.isCollapsed){this.#z&&(this.#D?.hide(),this.#z=null,this.#ue({hasSelectedText:!1}));return}let{anchorNode:t}=e;if(t===this.#z)return;let n=this.#Z(e).closest(`.textLayer`);if(!n){this.#z&&(this.#D?.hide(),this.#z=null,this.#ue({hasSelectedText:!1}));return}if(this.#D?.hide(),this.#z=t,this.#ue({hasSelectedText:!0}),!(this.#L!==KS.HIGHLIGHT&&this.#L!==KS.NONE)&&(this.#L===KS.HIGHLIGHT&&this.showAllEditors(`highlight`,!0,!0),this.#E=this.isShiftKeyDown,!this.isShiftKeyDown)){let e=this.#L===KS.HIGHLIGHT?this.#Q(n):null;if(e?.toggleDrawing(),this.#A){let t=new AbortController,n=this.combinedSignal(t),r=n=>{n.type===`pointerup`&&n.button!==0||(t.abort(),e?.toggleDrawing(!0),n.type===`pointerup`&&this.#te(`main_toolbar`))};window.addEventListener(`pointerup`,r,{signal:n}),window.addEventListener(`blur`,r,{signal:n})}else e?.toggleDrawing(!0),this.#te(`main_toolbar`)}}#te(e=``){this.#L===KS.HIGHLIGHT?this.highlightSelection(e):this.#y&&this.#$()}#ne(){document.addEventListener(`selectionchange`,this.#ee.bind(this),{signal:this._signal})}#re(){if(this.#w)return;this.#w=new AbortController;let e=this.combinedSignal(this.#w);window.addEventListener(`focus`,this.focus.bind(this),{signal:e}),window.addEventListener(`blur`,this.blur.bind(this),{signal:e})}#ie(){this.#w?.abort(),this.#w=null}blur(){if(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#te(`main_toolbar`)),!this.hasSelection)return;let{activeElement:e}=document;for(let t of this.#R)if(t.div.contains(e)){this.#N=[t,e],t._focusEventsAllowed=!1;break}}focus(){if(!this.#N)return;let[e,t]=this.#N;this.#N=null,t.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),t.focus()}#ae(){if(this.#M)return;this.#M=new AbortController;let e=this.combinedSignal(this.#M);window.addEventListener(`keydown`,this.keydown.bind(this),{signal:e}),window.addEventListener(`keyup`,this.keyup.bind(this),{signal:e})}#oe(){this.#M?.abort(),this.#M=null}#se(){if(this.#f)return;this.#f=new AbortController;let e=this.combinedSignal(this.#f);document.addEventListener(`copy`,this.copy.bind(this),{signal:e}),document.addEventListener(`cut`,this.cut.bind(this),{signal:e}),document.addEventListener(`paste`,this.paste.bind(this),{signal:e})}#ce(){this.#f?.abort(),this.#f=null}#le(){let e=this._signal;document.addEventListener(`dragover`,this.dragOver.bind(this),{signal:e}),document.addEventListener(`drop`,this.drop.bind(this),{signal:e})}addEditListeners(){this.#ae(),this.setEditingState(!0)}removeEditListeners(){this.#oe(),this.setEditingState(!1)}dragOver(e){for(let{type:t}of e.dataTransfer.items)for(let n of this.#_)if(n.isHandlingMimeForPasting(t)){e.dataTransfer.dropEffect=`copy`,e.preventDefault();return}}drop(e){for(let t of e.dataTransfer.items)for(let n of this.#_)if(n.isHandlingMimeForPasting(t.type)){n.paste(t,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;let t=[];for(let e of this.#R){let n=e.serialize(!0);n&&t.push(n)}t.length!==0&&e.clipboardData.setData(`application/pdfjs`,JSON.stringify(t))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();let{clipboardData:t}=e;for(let e of t.items)for(let t of this.#_)if(t.isHandlingMimeForPasting(e.type)){t.paste(e,this.currentLayer);return}let n=t.getData(`application/pdfjs`);if(!n)return;try{n=JSON.parse(n)}catch(e){sC(`paste: "${e.message}".`);return}if(!Array.isArray(n))return;this.unselectAll();let r=this.currentLayer;try{let e=[];for(let t of n){let n=await r.deserialize(t);if(!n)return;e.push(n)}this.addCommands({cmd:()=>{for(let t of e)this.#me(t);this.#_e(e)},undo:()=>{for(let t of e)t.remove()},mustExec:!0})}catch(e){sC(`paste: "${e.message}".`)}}keydown(t){!this.isShiftKeyDown&&t.key===`Shift`&&(this.isShiftKeyDown=!0),this.#L!==KS.NONE&&!this.isEditorHandlingKeyboard&&e._keyboardManager.exec(this,t)}keyup(e){this.isShiftKeyDown&&e.key===`Shift`&&(this.isShiftKeyDown=!1,this.#E&&(this.#E=!1,this.#te(`main_toolbar`)))}onEditingAction({name:e}){switch(e){case`undo`:case`redo`:case`delete`:case`selectAll`:this[e]();break;case`highlightSelection`:this.highlightSelection(`context_menu`);break;case`commentSelection`:this.commentSelection(`context_menu`);break}}updatePageIndex(e,t){for(let n of this.#o.get(e)||[])n.pageIndex=t;let n=this.#a.get(e);n&&(n.pageIndex=t,this.#i.set(t,n),this.#k?n.enable():n.disable())}startUpdatePages(){this.#a=new Map(this.#i),this.#i.clear();let e=this.#o=new Map,t=t=>{e.getOrInsertComputed(t.pageIndex,MC).push(t)};for(let e of this.#r.values())t(e);for(let[e,n]of this.#c)e.startsWith(GS)&&!this.#r.has(e)&&Number.isInteger(n?.pageIndex)&&t(n)}endUpdatePages(){this.#a=null,this.#o=null}clonePage(e,t){for(let n of this.getEditors(e)){let e=n.serialize(n.mode!==KS.HIGHLIGHT);e&&(e.pageIndex=t,e.id=this.getId(),e.isClone=!0,delete e.popupRef,this.#c.setValue(e.id,e))}}findClonesForPage(e){let t=[],{pageIndex:n}=e;for(let[r,i]of this.#c)i.pageIndex===n&&i.isClone&&(this.#c.remove(r),t.push(e.deserialize(i).then(t=>{t&&(t.isClone=!0,e.addOrRebuild(t))})));return Promise.all(t)}#ue(e){Object.entries(e).some(([e,t])=>this.#W[e]!==t)&&(this._eventBus.dispatch(`editingstateschanged`,{source:this,details:Object.assign(this.#W,e)}),this.#L===KS.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#de([[qS.HIGHLIGHT_FREE,!0]]))}#de(e){this._eventBus.dispatch(`annotationeditorparamschanged`,{source:this,details:e})}setEditingState(e){e?(this.#re(),this.#se(),this.#ue({isEditing:this.#L!==KS.NONE,isEmpty:this.#ge(),hasSomethingToUndo:this.#u.hasSomethingToUndo(),hasSomethingToRedo:this.#u.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#ie(),this.#ce(),this.#ue({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#_){this.#_=e;for(let e of this.#_)this.#de(e.defaultPropertiesToUpdate)}}getId(){return this.#O.id}get currentLayer(){return this.#i.get(this.#m)}getLayer(e){return this.#i.get(e)}get currentPageIndex(){return this.#m}addLayer(e){this.#i.set(e.pageIndex,e),this.#k?e.enable():e.disable()}removeLayer(e){this.#i.delete(e.pageIndex)}async updateMode(e,t=null,n=!1,r=!1,i=!1,a=!1){if(this.#L!==e&&!(this.#X&&(await this.#X.promise,!this.#X))){if(this.#X=Promise.withResolvers(),this.#p?.commitOrRemove(),this.#L===KS.POPUP&&this.#d?.hideSidebar(),this.#d?.destroyPopup(),this.#L=e,e===KS.NONE){this.setEditingState(!1),this.#pe();for(let e of this.#r.values())e.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#X.resolve();return}for(let e of this.#r.values())e.addStandaloneCommentButton();e===KS.SIGNATURE&&await this.#B?.loadSignatures(),n&&Cw.clearPointerType(),this.setEditingState(!0),await this.#fe(),this.unselectAll();for(let t of this.#i.values())t.updateMode(e);if(e===KS.POPUP){this.#n||=await this.#U.getAnnotationsByType(new Set(this.#_.map(e=>e._editorType)));let e=new Set,t=[];for(let n of this.#r.values()){let{annotationElementId:r,hasComment:i,deleted:a}=n;r&&e.add(r),i&&!a&&t.push(n.getData())}for(let n of this.#n){let{id:r,popupRef:i,contentsObj:a}=n;i&&a?.str&&!e.has(r)&&!this.#h.has(r)&&t.push(n)}this.#d?.showSidebar(t)}if(!t){r&&this.addNewEditorFromKeyboard(),this.#X.resolve();return}for(let e of this.#r.values())e.uid===t?(this.setSelected(e),a?e.editComment():i?e.enterInEditMode():e.focus()):e.unselect();this.#X.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#L&&this._eventBus.dispatch(`switchannotationeditormode`,{source:this,...e})}updateParams(e,t){if(this.#_){switch(e){case qS.CREATE:this.currentLayer.addNewEditor(t);return;case qS.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:{type:`highlight`,action:`toggle_visibility`}}}),(this.#H||=new Map).set(e,t),this.showAllEditors(`highlight`,t);break}if(this.hasSelection)for(let n of this.#R)n.updateParams(e,t);else for(let n of this.#_)n.updateDefaultParams(e,t)}}showAllEditors(e,t,n=!1){for(let n of this.#r.values())n.editorType===e&&n.show(t);(this.#H?.get(qS.HIGHLIGHT_SHOW_ALL)??!0)!==t&&this.#de([[qS.HIGHLIGHT_SHOW_ALL,t]])}enableWaiting(e=!1){if(this.#j!==e){this.#j=e;for(let t of this.#i.values())e?t.disableClick():t.enableClick(),t.div.classList.toggle(`waiting`,e)}}async#fe(){if(!this.#k){this.#k=!0;let e=[];for(let t of this.#i.values())e.push(t.enable());await Promise.all(e);for(let e of this.#r.values())e.enable()}}#pe(){if(this.unselectAll(),this.#k){this.#k=!1;for(let e of this.#i.values())e.disable();for(let e of this.#r.values())e.disable()}}*getEditors(e){for(let t of this.#r.values())t.pageIndex===e&&(yield t)}getEditor(e){return this.#r.get(e)}addEditor(e){this.#r.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#C&&clearTimeout(this.#C),this.#C=setTimeout(()=>{this.focusMainContainer(),this.#C=null},0)),this.#r.delete(e.id),e.annotationElementId&&this.#F?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!this.#h.has(e.annotationElementId))&&this.#c?.remove(e.id)}addDeletedAnnotationElement(e){this.#h.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#h.has(e)}removeDeletedAnnotationElement(e){this.#h.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#me(e){let t=this.#i.get(e.pageIndex);t?t.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#de(e.propertiesToUpdate))}get#he(){let e=null;for(e of this.#R);return e}updateUI(e){this.#he===e&&this.#de(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#de(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#R.has(e)){this.#R.delete(e),e.unselect(),this.#ue({hasSelectedEditor:this.hasSelection});return}this.#R.add(e),e.select(),this.#de(e.propertiesToUpdate),this.#ue({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),this.#p?.commitOrRemove();for(let t of this.#R)t!==e&&t.unselect();this.#d?.destroyPopup(),this.#R.clear(),this.#R.add(e),e.select(),this.#de(e.propertiesToUpdate),this.#ue({hasSelectedEditor:!0})}get firstSelectedEditor(){return this.#R.values().next().value}unselect(e){e.unselect(),this.#R.delete(e),this.#ue({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#R.size!==0}get isEnterHandled(){return this.#R.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#u.undo(),this.#ue({hasSomethingToUndo:this.#u.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#ge()}),this._editorUndoBar?.hide()}redo(){this.#u.redo(),this.#ue({hasSomethingToUndo:!0,hasSomethingToRedo:this.#u.hasSomethingToRedo(),isEmpty:this.#ge()})}addCommands(e){this.#u.add(e),this.#ue({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#ge()})}cleanUndoStack(e){this.#u.cleanType(e)}#ge(){if(this.#r.size===0)return!0;if(this.#r.size===1)for(let e of this.#r.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();let e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;let t=e?[e]:[...this.#R],n=()=>{this._editorUndoBar?.show(r,t.length===1?t[0].editorType:t.length);for(let e of t)e.remove()},r=()=>{for(let e of t)this.#me(e)};this.addCommands({cmd:n,undo:r,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#_e(e){for(let e of this.#R)e.unselect();this.#R.clear();for(let t of e)t.isEmpty()||(this.#R.add(t),t.select());this.#ue({hasSelectedEditor:this.hasSelection})}selectAll(){for(let e of this.#R)e.commit();this.#_e(this.#r.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#L!==KS.NONE))&&!this.#p?.commitOrRemove()&&(this.#d?.destroyPopup(),this.hasSelection)){for(let e of this.#R)e.unselect();this.#R.clear(),this.#ue({hasSelectedEditor:!1})}}translateSelectedEditors(e,t,n=!1){if(n||this.commitOrRemove(),!this.hasSelection)return;this.#G[0]+=e,this.#G[1]+=t;let[r,i]=this.#G,a=[...this.#R];this.#K&&clearTimeout(this.#K),this.#K=setTimeout(()=>{this.#K=null,this.#G[0]=this.#G[1]=0,this.addCommands({cmd:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(r,i),e.translationDone())},undo:()=>{for(let e of a)this.#r.has(e.id)&&(e.translateInPage(-r,-i),e.translationDone())},mustExec:!1})},1e3);for(let n of a)n.translateInPage(e,t),n.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#g=new Map;for(let e of this.#R)this.#g.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#g)return!1;this.disableUserSelect(!1);let e=this.#g;this.#g=null;let t=!1;for(let[{x:n,y:r,pageIndex:i},a]of e)a.newX=n,a.newY=r,a.newPageIndex=i,t||=n!==a.savedX||r!==a.savedY||i!==a.savedPageIndex;if(!t)return!1;let n=(e,t,n,r)=>{if(this.#r.has(e.id)){let i=this.#i.get(r);i?e._setParentAndPosition(i,t,n):(e.pageIndex=r,e.x=t,e.y=n)}};return this.addCommands({cmd:()=>{for(let[t,{newX:r,newY:i,newPageIndex:a}]of e)n(t,r,i,a)},undo:()=>{for(let[t,{savedX:r,savedY:i,savedPageIndex:a}]of e)n(t,r,i,a)},mustExec:!0}),!0}dragSelectedEditors(e,t){if(this.#g)for(let n of this.#g.keys())n.drag(e,t)}rebuild(e){if(e.parent===null){let t=this.getLayer(e.pageIndex);t?(t.changeParent(e),t.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#R.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#L}isEditingMode(){return this.#L!==KS.NONE}get imageManager(){return mC(this,`imageManager`,new Tw)}getSelectionBoxes(e){if(!e)return null;let t=document.getSelection();for(let n=0,r=t.rangeCount;n<r;n++)if(!e.contains(t.getRangeAt(n).commonAncestorContainer))return null;let{x:n,y:r,width:i,height:a}=e.getBoundingClientRect(),o;switch(e.getAttribute(`data-main-rotation`)){case`90`:o=(e,t,o,s)=>({x:(t-r)/a,y:1-(e+o-n)/i,width:s/a,height:o/i});break;case`180`:o=(e,t,o,s)=>({x:1-(e+o-n)/i,y:1-(t+s-r)/a,width:o/i,height:s/a});break;case`270`:o=(e,t,o,s)=>({x:1-(t+s-r)/a,y:(e-n)/i,width:s/a,height:o/i});break;default:o=(e,t,o,s)=>({x:(e-n)/i,y:(t-r)/a,width:o/i,height:s/a});break}let s=[];for(let e=0,n=t.rangeCount;e<n;e++){let n=t.getRangeAt(e);if(!n.collapsed)for(let{x:e,y:t,width:r,height:i}of n.getClientRects())r===0||i===0||s.push(o(e,t,r,i))}return s.length===0?null:s}addChangedExistingAnnotation({annotationElementId:e,id:t}){(this.#l||=new Map).set(e,t)}removeChangedExistingAnnotation({annotationElementId:e}){this.#l?.delete(e)}renderAnnotationElement(e){let t=this.#l?.get(e.data.id);if(!t)return;let n=this.#c.getRawValue(t);n&&(this.#L===KS.NONE&&!n.hasBeenModified||n.renderAnnotationElement(e))}setMissingCanvas(e,t,n){let r=this.#F?.get(e);r&&(r.setCanvas(t,n),this.#F.delete(e))}addMissingCanvas(e,t){(this.#F||=new Map).set(e,t)}},Aw=class e{#e=null;#t=!1;#n=null;#r=null;#i=null;#a=null;#o=!1;#s=null;#c=null;#l=null;#u=null;#d=!1;static#f=null;static _l10n=null;constructor(t){this.#c=t,this.#d=t._uiManager.useNewAltTextFlow,e.#f||=Object.freeze({added:`pdfjs-editor-new-alt-text-added-button`,"added-label":`pdfjs-editor-new-alt-text-added-button-label`,missing:`pdfjs-editor-new-alt-text-missing-button`,"missing-label":`pdfjs-editor-new-alt-text-missing-button-label`,review:`pdfjs-editor-new-alt-text-to-review-button`,"review-label":`pdfjs-editor-new-alt-text-to-review-button-label`})}static initialize(t){e._l10n??=t}async render(){let t=this.#n=document.createElement(`button`);t.className=`altText`,t.tabIndex=`0`;let n=this.#r=document.createElement(`span`);t.append(n),this.#d?(t.classList.add(`new`),t.setAttribute(`data-l10n-id`,e.#f.missing),n.setAttribute(`data-l10n-id`,e.#f[`missing-label`])):(t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-button`),n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-button-label`));let r=this.#c._uiManager._signal;t.addEventListener(`contextmenu`,ZC,{signal:r}),t.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:r});let i=e=>{e.preventDefault(),this.#c._uiManager.editAltText(this.#c),this.#d&&this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_clicked`,data:{label:this.#p}})};return t.addEventListener(`click`,i,{capture:!0,signal:r}),t.addEventListener(`keydown`,e=>{e.target===t&&e.key===`Enter`&&(this.#o=!0,i(e))},{signal:r}),await this.#m(),t}get#p(){return this.#e&&`added`||this.#e===null&&this.guessedText&&`review`||`missing`}finish(){this.#n&&(this.#n.focus({focusVisible:this.#o}),this.#o=!1)}isEmpty(){return this.#d?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#d?this.#e!==null||!!this.#l:this.isEmpty()}get guessedText(){return this.#l}async setGuessedText(t){this.#e===null&&(this.#l=t,this.#u=await e._l10n.get(`pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer`,{generatedAltText:t}),this.#m())}toggleAltTextBadge(e=!1){if(!this.#d||this.#e){this.#s?.remove(),this.#s=null;return}if(!this.#s){let e=this.#s=document.createElement(`div`);e.className=`noAltTextBadge`,this.#c.div.append(e)}this.#s.classList.toggle(`hidden`,!e)}serialize(e){let t=this.#e;return!e&&this.#l===t&&(t=this.#u),{altText:t,decorative:this.#t,guessedText:this.#l,textWithDisclaimer:this.#u}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:t,guessedText:n,textWithDisclaimer:r,cancel:i=!1}){n&&(this.#l=n,this.#u=r),!(this.#e===e&&this.#t===t)&&(i||(this.#e=e,this.#t=t),this.#m())}toggle(e=!1){this.#n&&(!e&&this.#a&&(clearTimeout(this.#a),this.#a=null),this.#n.disabled=!e)}shown(){this.#c._reportTelemetry({action:`pdfjs.image.alt_text.image_status_label_displayed`,data:{label:this.#p}})}destroy(){this.#n?.remove(),this.#n=null,this.#r=null,this.#i=null,this.#s?.remove(),this.#s=null}async#m(){let t=this.#n;if(!t)return;if(this.#d){if(t.classList.toggle(`done`,!!this.#e),t.setAttribute(`data-l10n-id`,e.#f[this.#p]),this.#r?.setAttribute(`data-l10n-id`,e.#f[`${this.#p}-label`]),!this.#e){this.#i?.remove();return}}else{if(!this.#e&&!this.#t){t.classList.remove(`done`),this.#i?.remove();return}t.classList.add(`done`),t.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-edit-button`)}let n=this.#i;if(!n){this.#i=n=document.createElement(`span`),n.className=`tooltip`,n.setAttribute(`role`,`tooltip`),n.id=`alt-text-tooltip-${this.#c.id}`;let e=this.#c._uiManager._signal;e.addEventListener(`abort`,()=>{clearTimeout(this.#a),this.#a=null},{once:!0}),t.addEventListener(`mouseenter`,()=>{this.#a=setTimeout(()=>{this.#a=null,this.#i.classList.add(`show`),this.#c._reportTelemetry({action:`alt_text_tooltip`})},100)},{signal:e}),t.addEventListener(`mouseleave`,()=>{this.#a&&=(clearTimeout(this.#a),null),this.#i?.classList.remove(`show`)},{signal:e})}this.#t?n.setAttribute(`data-l10n-id`,`pdfjs-editor-alt-text-decorative-tooltip`):(n.removeAttribute(`data-l10n-id`),n.textContent=this.#e),n.parentNode||t.append(n),this.#c.getElementForAltText()?.setAttribute(`aria-describedby`,n.id)}},jw=class{#e=null;#t=null;#n=!1;#r=null;#i=null;#a=null;#o=null;#s=null;#c=!1;#l=null;constructor(e){this.#r=e}renderForToolbar(){let e=this.#t=document.createElement(`button`);return e.className=`comment`,this.#u(e,!1)}renderForStandalone(){let e=this.#e=document.createElement(`button`);e.className=`annotationCommentButton`;let t=this.#r.commentButtonPosition;if(t){let{style:n}=e;n.insetInlineEnd=`calc(${100*(this.#r._uiManager.direction===`ltr`?1-t[0]:t[0])}% - var(--comment-button-dim))`,n.top=`calc(${100*t[1]}% - var(--comment-button-dim))`;let r=this.#r.commentButtonColor;r&&(n.backgroundColor=r)}return this.#u(e,!0)}focusButton(){setTimeout(()=>{(this.#e??this.#t)?.focus()},0)}onUpdatedColor(){if(!this.#e)return;let e=this.#r.commentButtonColor;e&&(this.#e.style.backgroundColor=e),this.#r._uiManager.updatePopupColor(this.#r)}get commentButtonWidth(){return(this.#e?.getBoundingClientRect().width??0)/this.#r.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#l)return this.#l;if(!this.#e)return null;let{x:e,y:t,height:n}=this.#e.getBoundingClientRect(),{x:r,y:i,width:a,height:o}=this.#r.parent.boundingClientRect;return[(e-r)/a,(t+n-i)/o]}set commentPopupPositionInLayer(e){this.#l=e}hasDefaultPopupPosition(){return this.#l===null}removeStandaloneCommentButton(){this.#e?.remove(),this.#e=null}removeToolbarCommentButton(){this.#t?.remove(),this.#t=null}setCommentButtonStates({selected:e,hasPopup:t}){this.#e&&(this.#e.classList.toggle(`selected`,e),this.#e.ariaExpanded=t)}#u(e,t){if(!this.#r._uiManager.hasCommentManager())return null;e.tabIndex=`0`,e.ariaHasPopup=`dialog`,t?(e.ariaControls=`commentPopup`,e.setAttribute(`data-l10n-id`,`pdfjs-show-comment-button`)):(e.ariaControlsElements=[this.#r._uiManager.getCommentDialogElement()],e.setAttribute(`data-l10n-id`,`pdfjs-editor-add-comment-button`));let n=this.#r._uiManager._signal;if(!(n instanceof AbortSignal)||n.aborted)return e;e.addEventListener(`contextmenu`,ZC,{signal:n}),t&&(e.addEventListener(`focusin`,e=>{this.#r._focusEventsAllowed=!1,QC(e)},{capture:!0,signal:n}),e.addEventListener(`focusout`,e=>{this.#r._focusEventsAllowed=!0,QC(e)},{capture:!0,signal:n})),e.addEventListener(`pointerdown`,e=>e.stopPropagation(),{signal:n});let r=t=>{t.preventDefault(),e===this.#t?this.edit():this.#r.toggleComment(!0)};return e.addEventListener(`click`,r,{capture:!0,signal:n}),e.addEventListener(`keydown`,t=>{t.target===e&&t.key===`Enter`&&(this.#n=!0,r(t))},{signal:n}),e.addEventListener(`pointerenter`,()=>{this.#r.toggleComment(!1,!0)},{signal:n}),e.addEventListener(`pointerleave`,()=>{this.#r.toggleComment(!1,!1)},{signal:n}),e}edit(e){let t=this.commentPopupPositionInLayer,n,r;if(t)[n,r]=t;else{[n,r]=this.#r.commentButtonPosition;let{width:e,height:t,x:i,y:a}=this.#r;n=i+n*e,r=a+r*t}let i=this.#r.parent.boundingClientRect,{x:a,y:o,width:s,height:c}=i;this.#r._uiManager.editComment(this.#r,a+n*s,o+r*c,{...e,parentDimensions:i})}finish(){this.#t&&(this.#t.focus({focusVisible:this.#n}),this.#n=!1)}isDeleted(){return this.#c||this.#o===``}isEmpty(){return this.#o===null}hasBeenEdited(){return this.isDeleted()||this.#o!==this.#i}serialize(){return this.data}get data(){return{text:this.#o,richText:this.#a,date:this.#s,deleted:this.isDeleted()}}set data(e){if(e!==this.#o&&(this.#a=null),e===null){this.#o=``,this.#c=!0;return}this.#o=e,this.#s=new Date,this.#c=!1}restoreData({text:e,richText:t,date:n}){this.#o=e,this.#a=t,this.#s=n,this.#c=!1}setInitialText(e,t=null){this.#i=e,this.data=e,this.#s=null,this.#a=t}shown(){}destroy(){this.#t?.remove(),this.#t=null,this.#e?.remove(),this.#e=null,this.#o=``,this.#a=null,this.#s=null,this.#r=null,this.#n=!1,this.#c=!1}};function Mw(e){e.preventDefault()}var Nw=1e-4;function Pw(e){return e.cancelable?(QC(e),!0):(e.stopPropagation(),!1)}var Fw=class{#e;#t=!1;#n=null;#r;#i;#a;#o;#s;#c=!1;#l=null;#u;#d=new Set;#f=null;#p;#m=null;#h=0;constructor({container:e,isPinchingDisabled:t=null,isPinchingStopped:n=null,onPinchStart:r=null,onPinching:i=null,onPinchEnd:a=null,onPanning:o=null,signal:s}){this.#e=e,this.#n=n,this.#r=t,this.#i=r,this.#a=i,this.#o=a,this.#s=o,this.#p=new AbortController,this.#u=AbortSignal.any([s,this.#p.signal]),e.addEventListener(`touchstart`,this.#g.bind(this),{passive:!1,signal:this.#u})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/ow.pixelRatio}get MIN_TOUCH_DISTANCE_TO_SCALE(){return 4/ow.pixelRatio}#g(e){if(this.#r?.())return;this.#v(e);let t=this.#d;for(let{identifier:n}of e.changedTouches)t.add(n);if(t.size===1){this.#_();return}if(!this.#m){this.#m=new AbortController;let e=AbortSignal.any([this.#u,this.#m.signal]),t=this.#e,n={signal:e,capture:!1,passive:!1};t.addEventListener(`touchmove`,this.#x.bind(this),n);let r=this.#S.bind(this);t.addEventListener(`touchend`,r,n),t.addEventListener(`touchcancel`,r,n),n.capture=!0,t.addEventListener(`pointerdown`,QC,n),t.addEventListener(`pointermove`,QC,n),t.addEventListener(`pointercancel`,Mw,n),t.addEventListener(`pointerup`,Mw,n),this.#i?.()}this.#c=Pw(e),this.#b(e)}#_(){if(this.#l)return;let e=this.#l=new AbortController,t=AbortSignal.any([this.#u,e.signal]),n=this.#e,r={capture:!0,signal:t,passive:!1},i=e=>{e.pointerType===`touch`&&(this.#l?.abort(),this.#l=null)};n.addEventListener(`pointerdown`,e=>{e.pointerType===`touch`&&(QC(e),i(e))},r),n.addEventListener(`pointerup`,i,r),n.addEventListener(`pointercancel`,i,r)}#v(e){let t=this.#d;if(t.size===0)return;let n=this.#d=new Set;for(let{identifier:r}of e.touches)t.has(r)&&n.add(r)}#y(e){let t=this.#d,n=[];for(let r of e.touches)t.has(r.identifier)&&n.push(r);return n}#b(e){let t=this.#y(e);if(t.length!==2||this.#n?.()){this.#f=null;return}let[n,r]=t;this.#f={touch0X:n.screenX,touch0Y:n.screenY,touch1X:r.screenX,touch1Y:r.screenY,panX:(n.clientX+r.clientX)/2,panY:(n.clientY+r.clientY)/2,screenPanX:(n.screenX+r.screenX)/2,screenPanY:(n.screenY+r.screenY)/2}}#x(e){if(!this.#f)return;let t=this.#y(e);if(t.length!==2)return;let n=this.#c;if(this.#c=Pw(e),!this.#c)return;if(!n){this.#b(e);return}let[r,i]=t,{screenX:a,screenY:o}=r,{screenX:s,screenY:c}=i,l=this.#f,{touch0X:u,touch0Y:d,touch1X:f,touch1Y:p,panX:m,panY:h}=l,g=f-u,_=p-d,v=s-a,y=c-o,b=(r.clientX+i.clientX)/2,x=(r.clientY+i.clientY)/2;l.panX=b,l.panY=x;let S=b-m,C=x-h,w=(a+s)/2,T=(o+c)/2,E=Math.hypot(w-l.screenPanX,T-l.screenPanY);l.screenPanX=w,l.screenPanY=T;let D=Math.hypot(v,y),O=Math.hypot(g,_),k=this.#t?this.MIN_TOUCH_DISTANCE_TO_SCALE:this.MIN_TOUCH_DISTANCE_TO_PINCH+2*E;if(D<Nw||O<Nw||Math.abs(O-D)<=k){(S||C)&&this.#s?.(S,C);return}l.touch0X=a,l.touch0Y=o,l.touch1X=s,l.touch1Y=c;let A=Math.sign(D-O);if(!this.#t){this.#t=!0,this.#h=A,(S||C)&&this.#s?.(S,C);return}if(this.#h){let e=this.#h;if(this.#h=0,A!==e&&Math.abs(D-O)<=2*E){this.#t=!1,(S||C)&&this.#s?.(S,C);return}}this.#a?.([m,h],O,D,S,C)}#S(e){if(this.#v(e),this.#d.size>=2){this.#b(e);return}let t=!!this.#f;this.#C(),this.#d.size===1&&this.#_(),t&&Pw(e)}#C(){this.#f=null,this.#t=!1,this.#h=0,this.#c=!1,this.#m&&(this.#m.abort(),this.#m=null,this.#o?.())}destroy(){this.#C(),this.#d.clear(),this.#p?.abort(),this.#p=null,this.#l?.abort(),this.#l=null}},Iw=class e{#e=null;#t=null;#n=null;#r=null;#i=null;#a=!1;#o=null;#s=``;#c=null;#l=null;#u=null;#d=null;#f=null;#p=``;#m=!1;#h=null;#g=!1;#_=!1;#v=!1;#y=null;#b=0;#x=0;#S=null;#C=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nAlert=null;static _l10nResizer=null;#w=!1;#T=e._zIndex++;static _borderLineWidth=-1;static _colorManager=new Ow;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){let t=e.prototype._resizeWithKeyboard,n=kw.TRANSLATE_SMALL,r=kw.TRANSLATE_BIG;return mC(this,`_resizerKeyboardManager`,new Dw([[[`ArrowLeft`],t,{args:[-n,0]}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t,{args:[-r,0]}],[[`ArrowRight`],t,{args:[n,0]}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t,{args:[r,0]}],[[`ArrowUp`],t,{args:[0,-n]}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t,{args:[0,-r]}],[[`ArrowDown`],t,{args:[0,n]}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t,{args:[0,r]}],[[`Escape`],e.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;let{rotation:t,rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}=this.parent.viewport;this.rotation=t,this.pageRotation=(360+t-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[n,r],this.pageTranslation=[i,a];let[o,s]=this.parentDimensions;this.x=e.x/o,this.y=e.y/s,this.isAttachedToDOM=!1,this.deleted=!1}updatePageIndex(e){this.pageIndex=e}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return mC(this,`_defaultLineColor`,this._colorManager.getHexCode(`CanvasText`))}static deleteAnnotationElement(e){let t=new Lw({id:e._uiManager.getId(),parent:e.parent,uiManager:e._uiManager});t.annotationElementId=e.annotationElementId,t.deleted=!0,t._uiManager.addToAnnotationStorage(t)}static initialize(t,n){if(e._l10n??=t,e._l10nAlert??=Object.freeze({highlight:`pdfjs-editor-highlight-added-alert`,freetext:`pdfjs-editor-freetext-added-alert`,ink:`pdfjs-editor-ink-added-alert`,stamp:`pdfjs-editor-stamp-added-alert`,signature:`pdfjs-editor-signature-added-alert`}),e._l10nResizer??=Object.freeze({topLeft:`pdfjs-editor-resizer-top-left`,topMiddle:`pdfjs-editor-resizer-top-middle`,topRight:`pdfjs-editor-resizer-top-right`,middleRight:`pdfjs-editor-resizer-middle-right`,bottomRight:`pdfjs-editor-resizer-bottom-right`,bottomMiddle:`pdfjs-editor-resizer-bottom-middle`,bottomLeft:`pdfjs-editor-resizer-bottom-left`,middleLeft:`pdfjs-editor-resizer-middle-left`}),e._borderLineWidth!==-1)return;let r=getComputedStyle(document.documentElement);e._borderLineWidth=parseFloat(r.getPropertyValue(`--outline-width`))||0}static updateDefaultParams(e,t){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,t){cC(`Not implemented`)}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#w}set _isDraggable(e){this.#w=e,this.div?.classList.toggle(`draggable`,e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){let[e,t]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*t/(e*2),this.y+=this.width*e/(t*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*t/(e*2),this.y-=this.width*e/(t*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#T}setParent(e){e===null?(this.#G(),this.#d?.remove(),this.#d=null):(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#m?this.#m=!1:this.parent.setSelected(this))}focusout(e){this._focusEventsAllowed&&this.isAttachedToDOM&&(e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove()))}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,t,n,r){let[i,a]=this.parentDimensions;[n,r]=this.screenToPageTranslation(n,r),this.x=(e+n)/i,this.y=(t+r)/a,this.fixAndSetPosition()}_moveAfterPaste(e,t){if(this.isClone){delete this.isClone;return}let[n,r]=this.parentDimensions;this.setAt(e*n,t*r,this.width*n,this.height*r),this._onTranslated()}#E([e,t],n,r){[n,r]=this.screenToPageTranslation(n,r),this.x+=n/e,this.y+=r/t,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,t){this.#E(this.parentDimensions,e,t)}translateInPage(e,t){this.#h||=[this.x,this.y,this.width,this.height],this.#E(this.pageDimensions,e,t),this.div.scrollIntoView({block:`nearest`})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,t){this.#h||=[this.x,this.y,this.width,this.height];let{div:n,parentDimensions:[r,i]}=this;if(this.x+=e/r,this.y+=t/i,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){let{x:e,y:t}=this.div.getBoundingClientRect();this.parent.findNewParent(this,e,t)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:a,y:o}=this,[s,c]=this.getBaseTranslation();a+=s,o+=c;let{style:l}=n;l.left=`${(100*a).toFixed(2)}%`,l.top=`${(100*o).toFixed(2)}%`,this._onTranslating(a,o)}_onTranslating(e,t){}_onTranslated(e,t){}get _hasBeenMoved(){return!!this.#h&&(this.#h[0]!==this.x||this.#h[1]!==this.y)}get _hasBeenResized(){return!!this.#h&&(this.#h[2]!==this.width||this.#h[3]!==this.height)}getBaseTranslation(){let[t,n]=this.parentDimensions,{_borderLineWidth:r}=e,i=r/t,a=r/n;switch(this.rotation){case 90:return[-i,a];case 180:return[i,a];case 270:return[i,-a];default:return[-i,-a]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){let{div:{style:t},pageDimensions:[n,r]}=this,{x:i,y:a,width:o,height:s}=this;if(o*=n,s*=r,i*=n,a*=r,this._mustFixPosition)switch(e){case 0:i=IC(i,0,n-o),a=IC(a,0,r-s);break;case 90:i=IC(i,0,n-s),a=IC(a,o,r);break;case 180:i=IC(i,o,n),a=IC(a,s,r);break;case 270:i=IC(i,s,n),a=IC(a,0,r-o);break}this.x=i/=n,this.y=a/=r;let[c,l]=this.getBaseTranslation();i+=c,a+=l,t.left=`${(100*i).toFixed(2)}%`,t.top=`${(100*a).toFixed(2)}%`,this.moveInDOM()}static#D(e,t,n){switch(n){case 90:return[t,-e];case 180:return[-e,-t];case 270:return[-t,e];default:return[e,t]}}screenToPageTranslation(t,n){return e.#D(t,n,this.parentRotation)}pageTranslationToScreen(t,n){return e.#D(t,n,360-this.parentRotation)}#O(e){switch(e){case 90:{let[e,t]=this.pageDimensions;return[0,-e/t,t/e,0]}case 180:return[-1,0,0,-1];case 270:{let[e,t]=this.pageDimensions;return[0,e/t,-t/e,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){let{parentScale:e,pageDimensions:[t,n]}=this;return[t*e,n*e]}setDims(){let{div:{style:e},width:t,height:n}=this;e.width=`${(100*t).toFixed(2)}%`,e.height=`${(100*n).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#k(){if(this.#c)return;this.#c=document.createElement(`div`),this.#c.classList.add(`resizers`);let e=this._willKeepAspectRatio?[`topLeft`,`topRight`,`bottomRight`,`bottomLeft`]:[`topLeft`,`topMiddle`,`topRight`,`middleRight`,`bottomRight`,`bottomMiddle`,`bottomLeft`,`middleLeft`],t=this._uiManager._signal;for(let n of e){let e=document.createElement(`div`);this.#c.append(e),e.classList.add(`resizer`,n),e.setAttribute(`data-resizer-name`,n),e.addEventListener(`pointerdown`,this.#A.bind(this,n),{signal:t}),e.addEventListener(`contextmenu`,ZC,{signal:t}),e.tabIndex=-1}this.div.prepend(this.#c)}#A(e,t){t.preventDefault();let{isMac:n}=wC.platform;if(t.button!==0||t.ctrlKey&&n)return;this.#n?.toggle(!1);let r=this._isDraggable;this._isDraggable=!1,this.#l=[t.screenX,t.screenY];let i=new AbortController,a=this._uiManager.combinedSignal(i);this.parent.togglePointerEvents(!1),window.addEventListener(`pointermove`,this.#N.bind(this,e),{passive:!0,capture:!0,signal:a}),window.addEventListener(`touchmove`,QC,{passive:!1,signal:a}),window.addEventListener(`contextmenu`,ZC,{signal:a}),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let o=this.parent.div.style.cursor,s=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(t.target).cursor;let c=()=>{i.abort(),this.parent.togglePointerEvents(!0),this.#n?.toggle(!0),this._isDraggable=r,this.parent.div.style.cursor=o,this.div.style.cursor=s,this.#M()};window.addEventListener(`pointerup`,c,{signal:a}),window.addEventListener(`blur`,c,{signal:a})}#j(e,t,n,r){this.width=n,this.height=r,this.x=e,this.y=t,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#M(){if(!this.#u)return;let{savedX:e,savedY:t,savedWidth:n,savedHeight:r}=this.#u;this.#u=null;let i=this.x,a=this.y,o=this.width,s=this.height;i===e&&a===t&&o===n&&s===r||this.addCommands({cmd:this.#j.bind(this,i,a,o,s),undo:this.#j.bind(this,e,t,n,r),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#N(t,n){let[r,i]=this.parentDimensions,a=this.x,o=this.y,s=this.width,c=this.height,l=e.MIN_SIZE/r,u=e.MIN_SIZE/i,d=this.#O(this.rotation),f=(e,t)=>[d[0]*e+d[2]*t,d[1]*e+d[3]*t],p=this.#O(360-this.rotation),m=(e,t)=>[p[0]*e+p[2]*t,p[1]*e+p[3]*t],h,g,_=!1,v=!1;switch(t){case`topLeft`:_=!0,h=(e,t)=>[0,0],g=(e,t)=>[e,t];break;case`topMiddle`:h=(e,t)=>[e/2,0],g=(e,t)=>[e/2,t];break;case`topRight`:_=!0,h=(e,t)=>[e,0],g=(e,t)=>[0,t];break;case`middleRight`:v=!0,h=(e,t)=>[e,t/2],g=(e,t)=>[0,t/2];break;case`bottomRight`:_=!0,h=(e,t)=>[e,t],g=(e,t)=>[0,0];break;case`bottomMiddle`:h=(e,t)=>[e/2,t],g=(e,t)=>[e/2,0];break;case`bottomLeft`:_=!0,h=(e,t)=>[0,t],g=(e,t)=>[e,0];break;case`middleLeft`:v=!0,h=(e,t)=>[0,t/2],g=(e,t)=>[e,t/2];break}let y=h(s,c),b=g(s,c),x=f(...b),S=e._round(a+x[0]),C=e._round(o+x[1]),w=1,T=1,E,D;if(n.fromKeyboard)({deltaX:E,deltaY:D}=n);else{let{screenX:e,screenY:t}=n,[r,i]=this.#l;[E,D]=this.screenToPageTranslation(e-r,t-i),this.#l[0]=e,this.#l[1]=t}if([E,D]=m(E/r,D/i),_){let e=Math.hypot(s,c);w=T=Math.max(Math.min(Math.hypot(b[0]-y[0]-E,b[1]-y[1]-D)/e,1/s,1/c),l/s,u/c)}else v?w=IC(Math.abs(b[0]-y[0]-E),l,1)/s:T=IC(Math.abs(b[1]-y[1]-D),u,1)/c;let O=e._round(s*w),k=e._round(c*T);x=f(...g(O,k));let A=S-x[0],j=C-x[1];this.#h||=[this.x,this.y,this.width,this.height],this.width=O,this.height=k,this.x=A,this.y=j,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#n?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#_)return this._editToolbar;this._editToolbar=new yw(this),this.div.append(this._editToolbar.render());let{toolbarButtons:e}=this;if(e)for(let[t,n]of e)await this._editToolbar.addButton(t,n);return this.hasComment||this._editToolbar.addButton(`comment`,this.addCommentButton()),this._editToolbar.addButton(`delete`),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore(`comment`,this.addCommentButton(),`.deleteButton`)}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton(`comment`)}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#n?.destroy()}addContainer(e){let t=this._editToolbar?.div;t?t.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#n||(Aw.initialize(e._l10n),this.#n=new Aw(this),this.#e&&=(this.#n.data=this.#e,null)),this.#n}get altTextData(){return this.#n?.data}set altTextData(e){this.#n&&(this.#n.data=e)}get guessedAltText(){return this.#n?.guessedText}async setGuessedAltText(e){await this.#n?.setGuessedText(e)}serializeAltText(e){return this.#n?.serialize(e)}hasAltText(){return!!this.#n&&!this.#n.isEmpty()}hasAltTextData(){return this.#n?.hasData()??!1}focusCommentButton(){this.#r?.focusButton()}addCommentButton(){return this.canAddComment?this.#r||=new jw(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#i){this._uiManager.isEditingMode()&&this.#i.classList.remove(`hidden`);return}this.hasComment&&(this.#i=this.#r.renderForStandalone(),this.div.append(this.#i))}}removeStandaloneCommentButton(){this.#r.removeStandaloneCommentButton(),this.#i=null}hideStandaloneCommentButton(){this.#i?.classList.add(`hidden`)}get comment(){if(!this.#r)return null;let{data:{richText:e,text:t,date:n,deleted:r}}=this.#r;return{text:t,richText:e,date:n,deleted:r,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#r||=new jw(this),typeof e==`object`&&e?this.#r.restoreData(e):this.#r.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:t,richText:n}){if(!t||(this.#r||=new jw(this),this.#r.setInitialText(e,n),!this.annotationElementId))return;let r=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);r&&this.updateFromAnnotationLayer(r)}get hasEditedComment(){return this.#r?.hasBeenEdited()}get hasDeletedComment(){return this.#r?.isDeleted()}get hasComment(){return!!this.#r&&!this.#r.isEmpty()&&!this.#r.isDeleted()}async editComment(e){this.#r||=new jw(this),this.#r.edit(e)}toggleComment(e,t=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,t)}setSelectedCommentButton(e){this.#r.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){let[,,,t]=e.rect,[n]=this.pageDimensions,[r]=this.pageTranslation,i=r+n+1,a=t-100,o=i+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[i,a,o,t]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:t}}){this.#r.data=t?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){let e=this.div=document.createElement(`div`);e.setAttribute(`data-editor-rotation`,(360-this.rotation)%360),e.className=this.name,e.setAttribute(`id`,this.id),e.tabIndex=this.#a?-1:0,e.setAttribute(`role`,`application`),this.defaultL10nId&&e.setAttribute(`data-l10n-id`,this.defaultL10nId),this._isVisible||e.classList.add(`hidden`),this.setInForeground(),this.#z();let[t,n]=this.parentDimensions;this.parentRotation%180!=0&&(e.style.maxWidth=`${(100*n/t).toFixed(2)}%`,e.style.maxHeight=`${(100*t/n).toFixed(2)}%`);let[r,i]=this.getInitialTranslation();return this.translate(r,i),Sw(this,e,[`keydown`,`pointerdown`,`dblclick`]),this.#B(),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#P(){this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#n?.toggle(!1),this.parent.togglePointerEvents(!1)}#F(t,n,r){let i=.7,a=r/n*i+1-i;if(a===1)return;let o=this.#O(this.rotation),s=(e,t)=>[o[0]*e+o[2]*t,o[1]*e+o[3]*t],[c,l]=this.parentDimensions,u=this.x,d=this.y,f=this.width,p=this.height,m=e.MIN_SIZE/c,h=e.MIN_SIZE/l;a=Math.max(Math.min(a,1/f,1/p),m/f,h/p);let g=e._round(f*a),_=e._round(p*a);if(g===f&&_===p)return;this.#h||=[u,d,f,p];let v=s(f/2,p/2),y=e._round(u+v[0]),b=e._round(d+v[1]),x=s(g/2,_/2);this.x=y-x[0],this.y=b-x[1],this.width=g,this.height=_,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#I(){this.#n?.toggle(!0),this.parent.togglePointerEvents(!0),this.#M()}pointerdown(e){let{isMac:t}=wC.platform;if(e.button!==0||e.ctrlKey&&t){e.preventDefault();return}if(this.#m=!0,this._isDraggable){this.#R(e);return}this.#L(e)}#L(e){let{isMac:t}=wC.platform;e.ctrlKey&&!t||e.shiftKey||e.metaKey&&t?this.parent.toggleSelected(this):this.parent.setSelected(this)}#R(e){let{isSelected:t}=this;this._uiManager.setUpDragSession();let n=!1,r=new AbortController,i=this._uiManager.combinedSignal(r),a={capture:!0,passive:!1,signal:i},o=e=>{r.abort(),this.#o=null,this.#m=!1,this._uiManager.endDragSession()||this.#L(e),n&&this._onStopDragging()};t&&(this.#b=e.clientX,this.#x=e.clientY,this.#o=e.pointerId,this.#s=e.pointerType,window.addEventListener(`pointermove`,e=>{n||(n=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());let{clientX:t,clientY:r,pointerId:i}=e;if(i!==this.#o){QC(e);return}let[a,o]=this.screenToPageTranslation(t-this.#b,r-this.#x);this.#b=t,this.#x=r,this._uiManager.dragSelectedEditors(a,o),this.div.scrollIntoView({block:`nearest`})},a),window.addEventListener(`touchmove`,QC,a),window.addEventListener(`pointerdown`,e=>{e.pointerType===this.#s&&(this.#C||e.isPrimary)&&o(e),QC(e)},a));let s=e=>{if(!this.#o||this.#o===e.pointerId){o(e);return}QC(e)};window.addEventListener(`pointerup`,s,{signal:i}),window.addEventListener(`blur`,s,{signal:i})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#y&&clearTimeout(this.#y),this.#y=setTimeout(()=>{this.#y=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,t,n){e.changeParent(this),this.x=t,this.y=n,this.fixAndSetPosition(),this._onTranslated()}getRect(e,t,n=this.rotation){let r=this.parentScale,[i,a]=this.pageDimensions,[o,s]=this.pageTranslation,c=e/r,l=t/r,u=this.x*i,d=this.y*a,f=this.width*i,p=this.height*a;switch(n){case 0:return[u+c+o,a-d-l-p+s,u+c+f+o,a-d-l+s];case 90:return[u+l+o,a-d+c+s,u+l+p+o,a-d+c+f+s];case 180:return[u-c-f+o,a-d+l+s,u-c+o,a-d+l+p+s];case 270:return[u-l-p+o,a-d-c-f+s,u-l+o,a-d-c+s];default:throw Error(`Invalid rotation`)}}getRectInCurrentCoords(e,t){let[n,r,i,a]=e,o=i-n,s=a-r;switch(this.rotation){case 0:return[n,t-a,o,s];case 90:return[n,t-r,s,o];case 180:return[i,t-r,o,s];case 270:return[i,t-a,s,o];default:throw Error(`Invalid rotation`)}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&e._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#r?.onUpdatedColor()}getData(){let{comment:{text:e,color:t,date:n,opacity:r,deleted:i,richText:a},uid:o,pageIndex:s,creationDate:c,modificationDate:l}=this;return{id:o,pageIndex:s,rect:this.getPDFRect(),richText:a,contentsObj:{str:e},creationDate:c,modificationDate:n||l,popupRef:!i,color:t,opacity:r}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),this.#_=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#_=!1,!0):!1}isInEditMode(){return this.#_}shouldGetKeyboardEvents(){return this.#v}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){let{top:e,left:t,bottom:n,right:r}=this.getClientDimensions(),{innerHeight:i,innerWidth:a}=window;return t<a&&r>0&&e<i&&n>0}#z(){if(this.#f||!this.div)return;this.#f=new AbortController;let e=this._uiManager.combinedSignal(this.#f);this.div.addEventListener(`focusin`,this.focusin.bind(this),{signal:e}),this.div.addEventListener(`focusout`,this.focusout.bind(this),{signal:e})}#B(){this.#C||!this.div||!this.isResizable||!this._uiManager._supportsPinchToZoom||(this.#C=new Fw({container:this.div,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#P.bind(this),onPinching:this.#F.bind(this),onPinchEnd:this.#I.bind(this),signal:this._uiManager._signal}))}rebuild(){this.#z(),this.#B()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||``}}serialize(e=!1,t=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||``}}static async deserialize(e,t,n){let r=new this.prototype.constructor({parent:t,id:n.getId(),uiManager:n,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});r.rotation=e.rotation,r.#e=e.accessibilityData,r._isCopy=e.isCopy||!1;let[i,a]=r.pageDimensions,[o,s,c,l]=r.getRectInCurrentCoords(e.rect,a);return r.x=o/i,r.y=s/a,r.width=c/i,r.height=l/a,r}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#f?.abort(),this.#f=null,this.isEmpty()||this.commit(),this.#C?.destroy(),this.#C=null,this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#y&&=(clearTimeout(this.#y),null),this.#G(),this.removeEditToolbar(),this.#S){for(let e of this.#S.values())clearTimeout(e);this.#S=null}this.parent=null,this.#d?.remove(),this.#d=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#k(),this.#c.classList.remove(`hidden`))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction===`ltr`?[1,0]:[0,0]}get commentButtonPositionInPage(){let{commentButtonPosition:[t,n]}=this,[r,i,a,o]=this.getPDFRect();return[e._round(r+(a-r)*t),e._round(i+(o-i)*(1-n))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#r.commentPopupPositionInLayer}set commentPopupPosition(e){this.#r.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#r.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#r.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#r?.setCommentButtonStates(e)}keydown(t){if(!this.isResizable||t.target!==this.div||t.key!==`Enter`)return;this._uiManager.setSelected(this),this.#u={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};let n=this.#c.children;if(!this.#t){this.#t=Array.from(n);let t=this.#V.bind(this),r=this.#H.bind(this),i=this._uiManager._signal;for(let n of this.#t){let a=n.getAttribute(`data-resizer-name`);n.setAttribute(`role`,`spinbutton`),n.addEventListener(`keydown`,t,{signal:i}),n.addEventListener(`blur`,r,{signal:i}),n.addEventListener(`focus`,this.#U.bind(this,a),{signal:i}),n.setAttribute(`data-l10n-id`,e._l10nResizer[a])}}let r=this.#t[0],i=0;for(let e of n){if(e===r)break;i++}let a=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(a!==i){if(a<i)for(let e=0;e<i-a;e++)this.#c.append(this.#c.firstElementChild);else if(a>i)for(let e=0;e<a-i;e++)this.#c.firstElementChild.before(this.#c.lastElementChild);let t=0;for(let r of n){let n=this.#t[t++].getAttribute(`data-resizer-name`);r.setAttribute(`data-l10n-id`,e._l10nResizer[n])}}this.#W(0),this.#v=!0,this.#c.firstElementChild.focus({focusVisible:!0}),t.preventDefault(),t.stopImmediatePropagation()}#V(t){e._resizerKeyboardManager.exec(this,t)}#H(e){this.#v&&e.relatedTarget?.parentNode!==this.#c&&this.#G()}#U(e){this.#p=this.#v?e:``}#W(e){if(this.#t)for(let t of this.#t)t.tabIndex=e}_resizeWithKeyboard(e,t){this.#v&&this.#N(this.#p,{deltaX:e,deltaY:t,fromKeyboard:!0})}#G(){this.#v=!1,this.#W(-1),this.#M()}_stopResizingWithKeyboard(){this.#G(),this.div.focus()}select(){if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add(`selectedEditor`),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains(`selectedEditor`)&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#n?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#c?.classList.add(`hidden`),this.div?.classList.remove(`selectedEditor`),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#n?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,t){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!==`BUTTON`&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#g}set isEditing(e){this.#g=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:`added`}}get telemetryFinalData(){return null}_reportTelemetry(t,n=!1){if(n){this.#S||=new Map;let{action:n}=t,r=this.#S.get(n);r&&clearTimeout(r),r=setTimeout(()=>{this._reportTelemetry(t),this.#S.delete(n),this.#S.size===0&&(this.#S=null)},e._telemetryTimeout),this.#S.set(n,r);return}t.type||=this.editorType,this._uiManager._eventBus.dispatch(`reporttelemetry`,{source:this,details:{type:`editing`,data:t}})}show(e=this._isVisible){this.div.classList.toggle(`hidden`,!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#a=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#a=!0}updateFakeAnnotationElement(e){if(!this.#d&&!this.deleted){this.#d=e.addFakeAnnotation(this);return}if(this.deleted){this.#d.remove(),this.#d=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#d.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let t=e.container.querySelector(`.annotationContent`);if(!t)t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.container.prepend(t);else if(t.nodeName===`CANVAS`){let e=t;t=document.createElement(`div`),t.classList.add(`annotationContent`,this.editorType),e.before(t)}return t}resetAnnotationElement(e){let{firstElementChild:t}=e.container;t?.nodeName===`DIV`&&t.classList.contains(`annotationContent`)&&t.remove()}},Lw=class extends Iw{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}},Rw=3285377520,zw=4294901760,Bw=65535,Vw=class{constructor(e){this.h1=e?e&4294967295:Rw,this.h2=e?e&4294967295:Rw}update(e){let t,n;if(typeof e==`string`){t=new Uint8Array(e.length*2),n=0;for(let r=0,i=e.length;r<i;r++){let i=e.charCodeAt(r);i<=255?t[n++]=i:(t[n++]=i>>>8,t[n++]=i&255)}}else if(ArrayBuffer.isView(e))t=e.slice(),n=t.byteLength;else throw Error(`Invalid data format, must be a string or TypedArray.`);let r=n>>2,i=n-r*4,a=new Uint32Array(t.buffer,0,r),o=0,s=0,c=this.h1,l=this.h2,u=3432918353,d=461845907,f=11601,p=13715;for(let e=0;e<r;e++)e&1?(o=a[e],o=o*u&zw|o*f&Bw,o=o<<15|o>>>17,o=o*d&zw|o*p&Bw,c^=o,c=c<<13|c>>>19,c=c*5+3864292196):(s=a[e],s=s*u&zw|s*f&Bw,s=s<<15|s>>>17,s=s*d&zw|s*p&Bw,l^=s,l=l<<13|l>>>19,l=l*5+3864292196);switch(o=0,i){case 3:o^=t[r*4+2]<<16;case 2:o^=t[r*4+1]<<8;case 1:o^=t[r*4],o=o*u&zw|o*f&Bw,o=o<<15|o>>>17,o=o*d&zw|o*p&Bw,r&1?c^=o:l^=o}this.h1=c,this.h2=l}hexdigest(){let e=this.h1,t=this.h2;return e^=t>>>1,e=e*3981806797&zw|e*36045&Bw,t=t*4283543511&zw|((t<<16|e>>>16)*2950163797&zw)>>>16,e^=t>>>1,e=e*444984403&zw|e*60499&Bw,t=t*3301882366&zw|((t<<16|e>>>16)*3120437893&zw)>>>16,e^=t>>>1,(e>>>0).toString(16).padStart(8,`0`)+(t>>>0).toString(16).padStart(8,`0`)}},Hw=Object.freeze({map:null,hash:``,transfer:void 0}),Uw=class{#e=!1;#t=null;#n=null;#r=new Map;onSetModified=null;onResetModified=null;onAnnotationEditor=null;getValue(e,t){let n=this.#r.get(e);return n===void 0?t:Object.assign(t,n)}getRawValue(e){return this.#r.get(e)}remove(e){let t=this.#r.get(e);t!==void 0&&(t instanceof Iw&&this.#n.delete(t.annotationElementId),this.#r.delete(e),this.#r.size===0&&this.resetModified(),!this.#r.values().some(e=>e instanceof Iw)&&this.onAnnotationEditor?.(null))}setValue(e,t){let n=this.#r.get(e),r=!1;if(n!==void 0)for(let[e,i]of Object.entries(t))n[e]!==i&&(r=!0,n[e]=i);else r=!0,this.#r.set(e,t);r&&this.#i(),t instanceof Iw&&((this.#n||=new Map).set(t.annotationElementId,t),this.onAnnotationEditor?.(t.constructor._type))}has(e){return this.#r.has(e)}get size(){return this.#r.size}#i(){this.#e||(this.#e=!0,this.onSetModified?.())}resetModified(){this.#e&&(this.#e=!1,this.onResetModified?.())}get print(){return new Ww(this)}get serializable(){if(this.#r.size===0)return Hw;let e=new Map,t=new Vw,n=[],r=Object.create(null),i=!1;for(let[n,a]of this.#r){let o=a instanceof Iw?a.serialize(!1,r):a;a.page&&(a.pageIndex=a.page._pageIndex,delete a.page),o&&(e.set(n,o),t.update(`${n}:${JSON.stringify(o)}`),i||=!!o.bitmap)}if(i)for(let t of e.values())t.bitmap&&n.push(t.bitmap);return e.size>0?{map:e,hash:t.hexdigest(),transfer:n}:Hw}get editorStats(){let e=null,t=new Map,n=0,r=0;for(let i of this.#r.values()){if(!(i instanceof Iw)){i.popup&&(i.popup.deleted?r+=1:n+=1);continue}i.isCommentDeleted?r+=1:i.hasEditedComment&&(n+=1);let a=i.telemetryFinalData;if(!a)continue;let{type:o}=a;t.getOrInsertComputed(o,()=>Object.getPrototypeOf(i).constructor),e||=Object.create(null);let s=e[o]||=new Map;for(let[e,t]of Object.entries(a)){if(e===`type`)continue;let n=s.getOrInsertComputed(e,NC);n.set(t,(n.get(t)??0)+1)}}if((r>0||n>0)&&(e||=Object.create(null),e.comments={deleted:r,edited:n}),!e)return null;for(let[n,r]of t)e[n]=r.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#t=null}updateEditor(e,t){let n=this.#n?.get(e);return n?(n.updateFromAnnotationLayer(t),!0):!1}getEditor(e){return this.#n?.get(e)||null}get modifiedIds(){if(this.#t)return this.#t;let e=[];if(this.#n)for(let t of this.#n.values())t.serialize()&&e.push(t.annotationElementId);let t=``;if(e.length){let n=new Vw;n.update(e.join(`,`)),t=n.hexdigest()}return this.#t={ids:new Set(e),hash:t}}[Symbol.iterator](){return this.#r.entries()}},Ww=class extends Uw{#e=Hw;constructor(e){super();let{serializable:t}=e;if(t===Hw)return;let{map:n,hash:r,transfer:i}=t,a=structuredClone(n,i?{transfer:i}:null);this.#e={map:a,hash:r,transfer:[]}}get print(){cC(`Should not call PrintAnnotationStorage.print`)}get serializable(){return this.#e}get modifiedIds(){return mC(this,`modifiedIds`,{ids:new Set,hash:``})}},Gw=`__forcedDependency`,{floor:Kw,ceil:qw}=Math;function Jw(e,t,n,r,i,a){e[t*4+0]=Math.min(e[t*4+0],n),e[t*4+1]=Math.min(e[t*4+1],r),e[t*4+2]=Math.max(e[t*4+2],i),e[t*4+3]=Math.max(e[t*4+3],a)}function Yw(e,t,n,r,i){let a;e?(e<0&&(a=i[0],i[0]=i[2],i[2]=a),i[0]*=e,i[2]*=e,t<0&&(a=i[1],i[1]=i[3],i[3]=a),i[1]*=t,i[3]*=t):i.fill(0),i[0]+=n,i[1]+=r,i[2]+=n,i[3]+=r}var Xw=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0],Zw=class{#e;#t;constructor(e,t){this.#e=e,this.#t=t}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===Xw}minX(e){return this.#t[e*4+0]/256}minY(e){return this.#t[e*4+1]/256}maxX(e){return(this.#t[e*4+2]+1)/256}maxY(e){return(this.#t[e*4+3]+1)/256}},Qw=(e,t)=>e?.getOrInsertComputed(t,()=>({dependencies:new Set,isRenderingOperation:!1})),$w=class{#e=[[1,0,0,1,0,0]];#t=[-1/0,-1/0,1/0,1/0];#n=new Float64Array(RS);_pendingBBoxIdx=-1;#r;#i;#a;#o;_savesStack=[];_markedContentStack=[];constructor(e,t){this.#r=e.width,this.#i=e.height,this.#s(t)}growOperationsCount(e){e>=this.#o.length&&this.#s(e,this.#o)}#s(e,t){let n=new ArrayBuffer(e*4);this.#a=new Uint8ClampedArray(n),this.#o=new Uint32Array(n),t&&t.length>0?(this.#o.set(t),this.#o.fill(Xw,t.length)):this.#o.fill(Xw)}get clipBox(){return this.#t}save(e){return this.#t={__proto__:this.#t},this._savesStack.push(e),this}restore(e,t){let n=Object.getPrototypeOf(this.#t);if(n===null)return this;this.#t=n;let r=this._savesStack.pop();return r!==void 0&&(t?.(r,e),this.#o[e]=this.#o[r]),this}recordOpenMarker(e){return this._savesStack.push(e),this}getOpenMarker(){return this._savesStack.length===0?null:this._savesStack.at(-1)}recordCloseMarker(e,t){let n=this._savesStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}beginMarkedContent(e){return this._markedContentStack.push(e),this}endMarkedContent(e,t){let n=this._markedContentStack.pop();return n!==void 0&&(t?.(n,e),this.#o[e]=this.#o[n]),this}pushBaseTransform(e){return this.#e.push(TC.multiplyByDOMMatrix(this.#e.at(-1),e.getTransform())),this}popBaseTransform(){return this.#e.length>1&&this.#e.pop(),this}resetBBox(e){return this._pendingBBoxIdx!==e&&(this._pendingBBoxIdx=e,this.#n.set(RS,0)),this}recordClipBox(e,t,n,r,i,a){let o=TC.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform()),s=RS.slice();TC.axialAlignedBoundingBox([n,i,r,a],o,s);let c=TC.intersect(this.#t,s);return c?(this.#t[0]=c[0],this.#t[1]=c[1],this.#t[2]=c[2],this.#t[3]=c[3]):(this.#t[0]=this.#t[1]=1/0,this.#t[2]=this.#t[3]=-1/0),this}recordBBox(e,t,n,r,i,a){let o=this.#t;if(o[0]===1/0)return this;let s=TC.multiplyByDOMMatrix(this.#e.at(-1),t.getTransform());if(o[0]===-1/0)return TC.axialAlignedBoundingBox([n,i,r,a],s,this.#n),this;let c=RS.slice();return TC.axialAlignedBoundingBox([n,i,r,a],s,c),this.#n[0]=IC(c[0],o[0],this.#n[0]),this.#n[1]=IC(c[1],o[1],this.#n[1]),this.#n[2]=IC(c[2],this.#n[2],o[2]),this.#n[3]=IC(c[3],this.#n[3],o[3]),this}recordFullPageBBox(e){return this.#n[0]=Math.max(0,this.#t[0]),this.#n[1]=Math.max(0,this.#t[1]),this.#n[2]=Math.min(this.#r,this.#t[2]),this.#n[3]=Math.min(this.#i,this.#t[3]),this}recordOperation(e,t=!1,n){if(this._pendingBBoxIdx!==e)return this;let r=Kw(this.#n[0]*256/this.#r),i=Kw(this.#n[1]*256/this.#i),a=qw(this.#n[2]*256/this.#r),o=qw(this.#n[3]*256/this.#i);if(Jw(this.#a,e,r,i,a,o),n)for(let t of n)for(let n of t)n!==e&&Jw(this.#a,n,r,i,a,o);return t||(this._pendingBBoxIdx=-1),this}bboxToClipBoxDropOperation(e){return this._pendingBBoxIdx===e&&(this._pendingBBoxIdx=-1,this.#t[0]=Math.max(this.#t[0],this.#n[0]),this.#t[1]=Math.max(this.#t[1],this.#n[1]),this.#t[2]=Math.min(this.#t[2],this.#n[2]),this.#t[3]=Math.min(this.#t[3],this.#n[3])),this}take(){return new Zw(this.#o,this.#a)}takeDebugMetadata(){throw Error(`Unreachable`)}recordSimpleData(e,t){return this}recordIncrementalData(e,t){return this}resetIncrementalData(e,t){return this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this}recordFutureForcedDependency(e,t){return this}inheritSimpleDataAsFutureForcedDependencies(e){return this}inheritPendingDependenciesAsFutureForcedDependencies(){return this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){return this}getSimpleIndex(e){}recordDependencies(e,t){return this}recordNamedDependency(e,t){return this}recordShowTextOperation(e,t=!1){return this}},eT=class{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[Gw]:[]};#n=new Map;#r=new Set;#i=new Map;#a;#o;#s;constructor(e,t=!1){this.#s=e,t&&(this.#a=new Map,this.#o=(e,t)=>{Qw(this.#a,t).dependencies.add(e)})}get clipBox(){return this.#s.clipBox}growOperationsCount(e){this.#s.growOperationsCount(e)}save(e){return this.#e={__proto__:this.#e},this.#t={__proto__:this.#t,transform:{__proto__:this.#t.transform},moveText:{__proto__:this.#t.moveText},sameLineText:{__proto__:this.#t.sameLineText},[Gw]:{__proto__:this.#t[Gw]}},this.#s.save(e),this}restore(e){this.#s.restore(e,this.#o);let t=Object.getPrototypeOf(this.#e);return t===null?this:(this.#e=t,this.#t=Object.getPrototypeOf(this.#t),this)}recordOpenMarker(e){return this.#s.recordOpenMarker(e,this.#o),this}getOpenMarker(){return this.#s.getOpenMarker()}recordCloseMarker(e){return this.#s.recordCloseMarker(e,this.#o),this}beginMarkedContent(e){return this.#s.beginMarkedContent(e),this}endMarkedContent(e){return this.#s.endMarkedContent(e,this.#o),this}pushBaseTransform(e){return this.#s.pushBaseTransform(e),this}popBaseTransform(){return this.#s.popBaseTransform(),this}recordSimpleData(e,t){return this.#e[e]=t,this}recordIncrementalData(e,t){return this.#t[e].push(t),this}resetIncrementalData(e,t){return this.#t[e].length=0,this}recordNamedData(e,t){return this.#n.set(e,t),this}recordSimpleDataFromNamed(e,t,n){this.#e[e]=this.#n.get(t)??n}recordFutureForcedDependency(e,t){return this.recordIncrementalData(Gw,t),this}inheritSimpleDataAsFutureForcedDependencies(e){for(let t of e)t in this.#e&&this.recordFutureForcedDependency(t,this.#e[t]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(let e of this.#r)this.recordFutureForcedDependency(Gw,e);return this}resetBBox(e){return this.#s.resetBBox(e),this}recordClipBox(e,t,n,r,i,a){return this.#s.recordClipBox(e,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#s.recordBBox(e,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r=1,i=0,a=0,o){let s=n.bbox,c,l;if(s&&(c=s[2]!==s[0]&&s[3]!==s[1]&&this.#i.get(n),c!==!1&&(l=[0,0,0,0],TC.axialAlignedBoundingBox(s,n.fontMatrix,l),(r!==1||i!==0||a!==0)&&Yw(r,-r,i,a,l),c)))return this.recordBBox(e,t,l[0],l[2],l[1],l[3]);if(!o)return this.recordFullPageBBox(e);let u=o();return s&&l&&c===void 0&&(c=l[0]<=i-u.actualBoundingBoxLeft&&l[2]>=i+u.actualBoundingBoxRight&&l[1]<=a-u.actualBoundingBoxAscent&&l[3]>=a+u.actualBoundingBoxDescent,this.#i.set(n,c),c)?this.recordBBox(e,t,l[0],l[2],l[1],l[3]):this.recordBBox(e,t,i-u.actualBoundingBoxLeft,i+u.actualBoundingBoxRight,a-u.actualBoundingBoxAscent,a+u.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#s.recordFullPageBBox(e),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,t){let n=this.#r,r=this.#e,i=this.#t;for(let e of t)e in this.#e?n.add(r[e]):e in i&&i[e].forEach(n.add,n);return this}recordNamedDependency(e,t){return this.#n.has(t)&&this.#r.add(this.#n.get(t)),this}recordOperation(e,t=!1){if(this.recordDependencies(e,[Gw]),this.#a){let t=Qw(this.#a,e),{dependencies:n}=t;this.#r.forEach(n.add,n),this.#s._savesStack.forEach(n.add,n),this.#s._markedContentStack.forEach(n.add,n),n.delete(e),t.isRenderingOperation=!0}let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.recordOperation(e,t,[this.#r,this.#s._savesStack,this.#s._markedContentStack]),n&&this.#r.clear(),this}recordShowTextOperation(e,t=!1){let n=Array.from(this.#r);this.recordOperation(e,t),this.recordIncrementalData(`sameLineText`,e);for(let e of n)this.recordIncrementalData(`sameLineText`,e);return this}bboxToClipBoxDropOperation(e,t=!1){let n=!t&&e===this.#s._pendingBBoxIdx;return this.#s.bboxToClipBoxDropOperation(e),n&&this.#r.clear(),this}take(){return this.#i.clear(),this.#s.take()}takeDebugMetadata(){return this.#a}},tT=class e{#e;#t;#n;#r=0;#i=0;constructor(t,n,r){if(t instanceof e&&t.#n===!!r)return t;this.#e=t,this.#t=n,this.#n=!!r}get clipBox(){return this.#e.clipBox}growOperationsCount(){throw Error(`Unreachable`)}save(e){return this.#i++,this.#e.save(this.#t),this}restore(e){return this.#i>0&&(this.#e.restore(this.#t),this.#i--),this}recordOpenMarker(e){return this.#r++,this}getOpenMarker(){return this.#r>0?this.#t:this.#e.getOpenMarker()}recordCloseMarker(e){return this.#r--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#e.pushBaseTransform(e),this}popBaseTransform(){return this.#e.popBaseTransform(),this}recordSimpleData(e,t){return this.#e.recordSimpleData(e,this.#t),this}recordIncrementalData(e,t){return this.#e.recordIncrementalData(e,this.#t),this}resetIncrementalData(e,t){return this.#e.resetIncrementalData(e,this.#t),this}recordNamedData(e,t){return this}recordSimpleDataFromNamed(e,t,n){return this.#e.recordSimpleDataFromNamed(e,t,this.#t),this}recordFutureForcedDependency(e,t){return this.#e.recordFutureForcedDependency(e,this.#t),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#e.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#e.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#n||this.#e.resetBBox(this.#t),this}recordClipBox(e,t,n,r,i,a){return this.#n||this.#e.recordClipBox(this.#t,t,n,r,i,a),this}recordBBox(e,t,n,r,i,a){return this.#n||this.#e.recordBBox(this.#t,t,n,r,i,a),this}recordCharacterBBox(e,t,n,r,i,a,o){return this.#n||this.#e.recordCharacterBBox(this.#t,t,n,r,i,a,o),this}recordFullPageBBox(e){return this.#n||this.#e.recordFullPageBBox(this.#t),this}getSimpleIndex(e){return this.#e.getSimpleIndex(e)}recordDependencies(e,t){return this.#e.recordDependencies(this.#t,t),this}recordNamedDependency(e,t){return this.#e.recordNamedDependency(this.#t,t),this}recordOperation(e){return this.#e.recordOperation(this.#t,!0),this}recordShowTextOperation(e){return this.#e.recordShowTextOperation(this.#t,!0),this}bboxToClipBoxDropOperation(e){return this.#n||this.#e.bboxToClipBoxDropOperation(this.#t,!0),this}take(){throw Error(`Unreachable`)}takeDebugMetadata(){throw Error(`Unreachable`)}},nT={stroke:[`path`,`transform`,`filter`,`strokeColor`,`strokeAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`dash`],fill:[`path`,`transform`,`filter`,`fillColor`,`fillAlpha`,`globalCompositeOperation`,`SMask`],imageXObject:[`transform`,`SMask`,`filter`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`],rawFillPath:[`filter`,`fillColor`,`fillAlpha`],showText:[`transform`,`leading`,`charSpacing`,`wordSpacing`,`hScale`,`textRise`,`moveText`,`textMatrix`,`font`,`fontObj`,`filter`,`fillColor`,`textRenderingMode`,`SMask`,`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`,`sameLineText`],transform:[`transform`],transformAndFill:[`transform`,`fillColor`]},rT=class e{#e;#t;#n=4;#r=0;#i=new e.#a(this.#n*6);static#a=wC.isFloat16ArraySupported?Float16Array:Float32Array;constructor(e){this.#e=e.width,this.#t=e.height}record(t,n,r,i){if(this.#r===this.#n){this.#n*=2;let t=new e.#a(this.#n*6);t.set(this.#i),this.#i=t}let a=rw(t),o;if(i[0]!==1/0){let e=RS.slice();TC.axialAlignedBoundingBox([0,-r,n,0],a,e);let t=TC.intersect(i,e);if(!t)return;let[s,c,l,u]=t;if(s!==e[0]||c!==e[1]||l!==e[2]||u!==e[3]){let e=Math.atan2(a[1],a[0]),t=Math.abs(Math.sin(e)),n=Math.abs(Math.cos(e));if(t<1e-6||n<1e-6||Math.abs(t-n)<1e-6)o=[s,c,s,u,l,c];else{let e=l-s,r=u-c,i=t*t,a=n*n,d=n*t,f=a-i,p=(r*a-e*d)/f;o=[s+(r*d-e*i)/f,c,s,c+p,l,u-p]}}}o||(o=[0,-r,0,0,n,-r],TC.applyTransform(o,a,0),TC.applyTransform(o,a,2),TC.applyTransform(o,a,4)),o[0]/=this.#e,o[1]/=this.#t,o[2]/=this.#e,o[3]/=this.#t,o[4]/=this.#e,o[5]/=this.#t,this.#i.set(o,this.#r*6),this.#r++}take(){return this.#i.subarray(0,this.#r*6)}},iT=/\p{Cc}/u;function aT(e){let t=e[0];if(e.length<2||t!==`"`&&t!==`'`||e.at(-1)!==t)return!1;let n=e.length-1;for(let r=1;r<n;r++){let i=e[r];if(i===t||iT.test(i)||i===`\\`&&(++r>=n||iT.test(e[r])))return!1}return!0}function oT(e){return aT(e)?e:`"${e.replaceAll(/["\\\p{Cc}]/gu,e=>e===`"`||e===`\\`?`\\${e}`:`\\${e.codePointAt(0).toString(16)} `)}"`}var sT=class{#e=new Set;#t=null;constructor({ownerDocument:e=globalThis.document,styleElement:t=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){let t=this.#n();t.insertRule(e,t.cssRules.length)}#n(){if(this.#t)return this.#t;let e=this._document.defaultView?.CSSStyleSheet||globalThis.CSSStyleSheet;if(!this.styleElement&&e){let{adoptedStyleSheets:t}=this._document;if(t){let n=new e;return t.push(n),this.#t=n}}return this.styleElement||(this.styleElement=this._document.createElement(`style`),this._document.documentElement.getElementsByTagName(`head`)[0].append(this.styleElement)),this.#t=this.styleElement.sheet}clear(){for(let e of this.nativeFontFaces)this._document.fonts.delete(e);if(this.nativeFontFaces.clear(),this.#e.clear(),this.#t){let{adoptedStyleSheets:e}=this._document;e?.includes(this.#t)&&(this._document.adoptedStyleSheets=e.filter(e=>e!==this.#t)),this.#t=null}this.styleElement&&=(this.styleElement.remove(),null)}async loadSystemFont({systemFontInfo:e,disableFontFace:t,_inspectFont:n}){if(!(!e||this.#e.has(e.loadedName))){if(lC(!t,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){let{loadedName:t,src:r,style:i}=e,a=new FontFace(t,r,i);this.addNativeFontFace(a);try{await a.load(),this.#e.add(t),n?.(e)}catch{sC(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}cC(`Not implemented: loadSystemFont without the Font Loading API.`)}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){let t=e.createNativeFontFace();if(t){this.addNativeFontFace(t);try{await t.loaded}catch(n){throw sC(`Failed to load font '${t.family}': '${n}'.`),e.disableFontFace=!0,n}}return}let t=e.createFontFaceRule();if(t){if(this.insertRule(t),this.isSyncFontLoadingSupported)return;await new Promise(t=>{let n=this._queueLoadingCallback(t);this._prepareFontLoadEvent(e,n)})}}get isFontLoadingAPISupported(){let e=!!this._document?.fonts;return mC(this,`isFontLoadingAPISupported`,e)}get isSyncFontLoadingSupported(){return mC(this,`isSyncFontLoadingSupported`,LS||wC.platform.isFirefox)}_queueLoadingCallback(e){function t(){for(lC(!r.done,`completeRequest() cannot be called twice.`),r.done=!0;n.length>0&&n[0].done;){let e=n.shift();setTimeout(e.callback,0)}}let{loadingRequests:n}=this,r={done:!1,complete:t,callback:e};return n.push(r),r}get _loadTestFont(){let e=atob(`T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAA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3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==`);return mC(this,`_loadTestFont`,e)}_prepareFontLoadEvent(e,t){function n(e,t){return e.charCodeAt(t)<<24|e.charCodeAt(t+1)<<16|e.charCodeAt(t+2)<<8|e.charCodeAt(t+3)&255}function r(e){return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,e&255)}function i(e,t,n,r){let i=e.substring(0,t),a=e.substring(t+n);return i+r+a}let a,o,s=this._document.createElement(`canvas`);s.width=1,s.height=1;let c=s.getContext(`2d`),l=0;function u(e,t){if(++l>30){sC(`Load test font never loaded.`),t();return}if(c.font=`30px `+e,c.fillText(`.`,0,20),c.getImageData(0,0,1,1).data[3]>0){t();return}setTimeout(u.bind(null,e,t))}let d=`lt${Date.now()}${this.loadTestFontId++}`,f=this._loadTestFont;f=i(f,976,d.length,d);let p=1482184792,m=n(f,16);for(a=0,o=d.length-3;a<o;a+=4)m=m-p+n(d,a)|0;a<d.length&&(m=m-p+n(d+`XXX`,a)|0),f=i(f,16,4,r(m));let h=`@font-face {font-family:"${d}";src:${`url(data:font/opentype;base64,${btoa(f)});`}}`;this.insertRule(h);let g=this._document.createElement(`div`);g.style.visibility=`hidden`,g.style.width=g.style.height=`10px`,g.style.position=`absolute`,g.style.top=g.style.left=`0px`;for(let t of[e.loadedName,d]){let e=this._document.createElement(`span`);e.textContent=`Hi`,e.style.fontFamily=t,g.append(e)}this._document.body.append(g),u(d,()=>{g.remove(),t.complete()})}},cT=class{compiledGlyphs=Object.create(null);#e;constructor(e,t=null,n,r){this.#e=e,this._inspectFont=t,n&&(this.charProcOperatorList=n),r&&Object.assign(this,r)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{let t={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(t.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(oT(this.cssFontInfo.fontFamily),this.data,t)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;let e=`url(data:${this.mimetype};base64,${this.data.toBase64()});`,t;if(!this.cssFontInfo)t=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let n=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(n+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),t=`@font-face {font-family:${oT(this.cssFontInfo.fontFamily)};${n}src:${e}}`}return this._inspectFont?.(this,e),t}getPathGenerator(e,t){if(this.compiledGlyphs[t]!==void 0)return this.compiledGlyphs[t];let n=this.loadedName+`_path_`+t,r;try{r=e.get(n)}catch(e){sC(`getPathGenerator - ignoring character: "${e}".`)}let i=vw(r?.path);return this.fontExtraProperties||e.delete(n),this.compiledGlyphs[t]=i}get black(){return this.#e.black}get bold(){return this.#e.bold}get disableFontFace(){return this.#e.disableFontFace}set disableFontFace(e){mC(this,`disableFontFace`,!!e)}get fontExtraProperties(){return this.#e.fontExtraProperties}get isInvalidPDFjsFont(){return this.#e.isInvalidPDFjsFont}get isType3Font(){return this.#e.isType3Font}get italic(){return this.#e.italic}get missingFile(){return this.#e.missingFile}get remeasure(){return this.#e.remeasure}get vertical(){return this.#e.vertical}get ascent(){return this.#e.ascent}get defaultWidth(){return this.#e.defaultWidth}get descent(){return this.#e.descent}get bbox(){return this.#e.bbox}get fontMatrix(){return this.#e.fontMatrix}get fallbackName(){return this.#e.fallbackName}get loadedName(){return this.#e.loadedName}get mimetype(){return this.#e.mimetype}get name(){return this.#e.name}get data(){return this.#e.data}clearData(){this.#e.clearData()}get cssFontInfo(){return this.#e.cssFontInfo}get systemFontInfo(){return this.#e.systemFontInfo}get defaultVMetrics(){return this.#e.defaultVMetrics}},lT=class{static strings=[`fontFamily`,`fontWeight`,`italicAngle`]},uT=class{static strings=[`css`,`loadedName`,`baseFontName`,`src`]},dT=class{static bools=[`black`,`bold`,`disableFontFace`,`fontExtraProperties`,`isInvalidPDFjsFont`,`isType3Font`,`italic`,`missingFile`,`remeasure`,`vertical`];static numbers=[`ascent`,`defaultWidth`,`descent`];static strings=[`fallbackName`,`loadedName`,`mimetype`,`name`];static OFFSET_NUMBERS=Math.ceil(this.bools.length*2/8);static OFFSET_BBOX=this.OFFSET_NUMBERS+this.numbers.length*8;static OFFSET_FONT_MATRIX=this.OFFSET_BBOX+1+8;static OFFSET_DEFAULT_VMETRICS=this.OFFSET_FONT_MATRIX+1+48;static OFFSET_STRINGS=this.OFFSET_DEFAULT_VMETRICS+1+6},fT=class{static KIND=0;static HAS_BBOX=1;static HAS_BACKGROUND=2;static SHADING_TYPE=3;static N_COORD=4;static N_COLOR=8;static N_STOP=12;static N_FIGURES=16},pT=class{static get decoder(){return mC(this,`decoder`,new TextDecoder)}static get encoder(){return mC(this,`encoder`,new TextEncoder)}},mT=class{#e;#t;constructor(e){this.#e=e,this.#t=new DataView(e)}#n(e){lC(e<lT.strings.length,`Invalid string index`);let{decoder:t}=pT,n=0;for(let t=0;t<e;t++)n+=this.#t.getUint32(n)+4;let r=this.#t.getUint32(n);return t.decode(new Uint8Array(this.#e,n+4,r))}get fontFamily(){return this.#n(0)}get fontWeight(){return this.#n(1)}get italicAngle(){return this.#n(2)}},hT=class{#e;#t;constructor(e){this.#e=e,this.#t=new DataView(e)}get guessFallback(){return this.#t.getUint8(0)!==0}#n(e){lC(e<uT.strings.length,`Invalid string index`);let{decoder:t}=pT,n=5;for(let t=0;t<e;t++)n+=this.#t.getUint32(n)+4;let r=this.#t.getUint32(n);return t.decode(new Uint8Array(this.#e,n+4,r))}get css(){return this.#n(0)}get loadedName(){return this.#n(1)}get baseFontName(){return this.#n(2)}get src(){return this.#n(3)}get style(){let{decoder:e}=pT,t=1;t+=4+this.#t.getUint32(t);let n=this.#t.getUint32(t),r=e.decode(new Uint8Array(this.#e,t+4,n));t+=4+n;let i=this.#t.getUint32(t);return{style:r,weight:e.decode(new Uint8Array(this.#e,t+4,i))}}},gT=class{#e;#t;constructor({buffer:e,extra:t}){this.#e=e,this.#t=new DataView(e),t&&Object.assign(this,t)}#n(e){lC(e<dT.bools.length,`Invalid boolean index`);let t=Math.floor(e/4),n=e*2%8,r=this.#t.getUint8(t)>>n&3;return r===0?void 0:r===2}get black(){return this.#n(0)}get bold(){return this.#n(1)}get disableFontFace(){return this.#n(2)}get fontExtraProperties(){return this.#n(3)}get isInvalidPDFjsFont(){return this.#n(4)}get isType3Font(){return this.#n(5)}get italic(){return this.#n(6)}get missingFile(){return this.#n(7)}get remeasure(){return this.#n(8)}get vertical(){return this.#n(9)}#r(e){return lC(e<dT.numbers.length,`Invalid number index`),this.#t.getFloat64(dT.OFFSET_NUMBERS+e*8)}get ascent(){return this.#r(0)}get defaultWidth(){return this.#r(1)}get descent(){return this.#r(2)}#i(e,t,n,r){let i=this.#t.getUint8(e);if(i===0)return;lC(i===t,`Invalid array length.`),e+=1;let a=Array(i);for(let t=0;t<i;t++)a[t]=this.#t[n](e,!0),e+=r;return a}get bbox(){return this.#i(dT.OFFSET_BBOX,4,`getInt16`,2)}get fontMatrix(){return this.#i(dT.OFFSET_FONT_MATRIX,6,`getFloat64`,8)}get defaultVMetrics(){return this.#i(dT.OFFSET_DEFAULT_VMETRICS,3,`getInt16`,2)}#a(e){lC(e<dT.strings.length,`Invalid string index`);let{decoder:t}=pT,n=dT.OFFSET_STRINGS+4;for(let t=0;t<e;t++)n+=this.#t.getUint32(n)+4;let r=this.#t.getUint32(n);return t.decode(new Uint8Array(this.#e,n+4,r))}get fallbackName(){return this.#a(0)}get loadedName(){return this.#a(1)}get mimetype(){return this.#a(2)}get name(){return this.#a(3)}#o(){let e=dT.OFFSET_STRINGS,t=this.#t.getUint32(e);e+=4+t;let n=this.#t.getUint32(e);e+=4+n;let r=this.#t.getUint32(e);e+=4+r;let i=this.#t.getUint32(e);return{offset:e,length:i}}get data(){let{offset:e,length:t}=this.#o();return t===0?void 0:new Uint8Array(this.#e,e+4,t)}clearData(){let{offset:e,length:t}=this.#o();t!==0&&(this.#t.setUint32(e,0),this.#e=new Uint8Array(this.#e,0,e+4).slice().buffer,this.#t=new DataView(this.#e))}get cssFontInfo(){let e=dT.OFFSET_STRINGS,t=this.#t.getUint32(e);e+=4+t;let n=this.#t.getUint32(e);e+=4+n;let r=this.#t.getUint32(e);if(r===0)return null;let i=new Uint8Array(r);return i.set(new Uint8Array(this.#e,e+4,r)),new mT(i.buffer)}get systemFontInfo(){let e=dT.OFFSET_STRINGS,t=this.#t.getUint32(e);e+=4+t;let n=this.#t.getUint32(e);if(n===0)return null;let r=new Uint8Array(n);return r.set(new Uint8Array(this.#e,e+4,n)),new hT(r.buffer)}},_T=class{constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}getIR(){let e=this.view,t=this.data[fT.KIND],n=!!this.data[fT.HAS_BBOX],r=!!this.data[fT.HAS_BACKGROUND],i=e.getUint32(fT.N_COORD,!0),a=e.getUint32(fT.N_COLOR,!0),o=e.getUint32(fT.N_STOP,!0),s=20,c=new Float32Array(this.buffer,s,i*2);s+=i*8;let l=new Uint8Array(this.buffer,s,a*4);s+=a*4;let u=[];for(let t=0;t<o;++t){let t=e.getFloat32(s,!0);s+=4;let n=e.getUint32(s,!0);s+=4,u.push([t,`#${n.toString(16).padStart(6,`0`)}`])}let d=null;if(n){d=[];for(let t=0;t<4;++t)d.push(e.getFloat32(s,!0)),s+=4}let f=null;if(r&&(f=new Uint8Array(this.buffer,s,3),s+=3),t===1)return[`RadialAxial`,`axial`,d,u,Array.from(c.slice(0,2)),Array.from(c.slice(2,4)),null,null];if(t===2)return[`RadialAxial`,`radial`,d,u,[c[0],c[1]],[c[3],c[4]],c[2],c[5]];if(t===3){let e=this.data[fT.SHADING_TYPE],t=null;if(c.length>0){t=RS.slice();for(let e=0,n=c.length;e<n;e+=2)TC.pointBoundingBox(c[e],c[e+1],t)}return[`Mesh`,e,c,l,i,t,d,f]}throw Error(`Unsupported pattern kind: ${t}`)}},vT=class{#e;constructor(e){this.#e=e}get path(){return wC.isFloat16ArraySupported?new Float16Array(this.#e):new Float32Array(this.#e)}};function yT(e){if(e instanceof URL)return e;if(typeof e==`string`){if(LS){if(/^[a-z][a-z0-9\-+.]+:/i.test(e))return new URL(e);let t=process.getBuiltinModule(`url`);return new URL(t.pathToFileURL(e))}let t=URL.parse(e,window.location);if(t)return t}throw Error(`Invalid PDF url data: either string or URL-object is expected in the url property.`)}function bT(e){if(LS&&typeof Buffer<`u`&&e instanceof Buffer)throw Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength)return e;if(typeof e==`string`)return CC(e);if(e instanceof ArrayBuffer||ArrayBuffer.isView(e)||typeof e==`object`&&!isNaN(e?.length))return new Uint8Array(e);throw Error(`Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.`)}function xT(e){if(typeof e!=`string`)return null;if(e.endsWith(`/`))return e;throw Error(`Invalid factory url: "${e}" must include trailing slash.`)}var ST=e=>typeof e==`object`&&Number.isInteger(e?.num)&&e.num>=0&&Number.isInteger(e?.gen)&&e.gen>=0,CT=jC.bind(null,ST,e=>typeof e==`object`&&typeof e?.name==`string`),wT=class{#e=new Map;#t=Promise.resolve();postMessage(e,t){let n={data:structuredClone(e,t?{transfer:t}:null)};this.#t.then(()=>{for(let[e]of this.#e)e.call(this,n)})}addEventListener(e,t,n=null){let r=null;if(n?.signal instanceof AbortSignal){let{signal:i}=n;if(i.aborted){sC("LoopbackPort - cannot use an `aborted` signal.");return}let a=()=>this.removeEventListener(e,t);r=()=>i.removeEventListener(`abort`,a),i.addEventListener(`abort`,a)}this.#e.set(t,r)}removeEventListener(e,t){this.#e.get(t)?.(),this.#e.delete(t)}terminate(){for(let[,e]of this.#e)e?.();this.#e.clear()}},TT={DATA:1,ERROR:2},ET={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function DT(){}function OT(e){if(e instanceof xC||e instanceof vC||e instanceof gC||e instanceof yC||e instanceof _C)return e;switch(e instanceof Error||typeof e==`object`&&e||cC(`wrapReason: Expected "reason" to be a (possibly cloned) Error.`),e.name){case`AbortException`:return new xC(e.message);case`InvalidPDFException`:return new vC(e.message);case`PasswordException`:return new gC(e.message,e.code);case`ResponseException`:return new yC(e.message,e.status,e.missing);case`UnknownErrorException`:return new _C(e.message,e.details)}return new _C(e.message,e.toString())}var kT=class{#e=new AbortController;constructor(e,t,n){this.sourceName=e,this.targetName=t,this.comObj=n,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),n.addEventListener(`message`,this.#t.bind(this),{signal:this.#e.signal})}#t({data:e}){if(e.targetName!==this.sourceName)return;if(e.stream){this.#r(e);return}if(e.callback){let t=e.callbackId,n=this.callbackCapabilities[t];if(!n)throw Error(`Cannot resolve callback ${t}`);if(delete this.callbackCapabilities[t],e.callback===TT.DATA)n.resolve(e.data);else if(e.callback===TT.ERROR)n.reject(OT(e.reason));else throw Error(`Unexpected callback case`);return}let t=this.actionHandler[e.action];if(!t)throw Error(`Unknown action from worker: ${e.action}`);if(e.callbackId){let n=this.sourceName,r=e.sourceName,i=this.comObj;Promise.try(t,e.data).then(function(t){i.postMessage({sourceName:n,targetName:r,callback:TT.DATA,callbackId:e.callbackId,data:t})},function(t){i.postMessage({sourceName:n,targetName:r,callback:TT.ERROR,callbackId:e.callbackId,reason:OT(t)})});return}if(e.streamId){this.#n(e);return}t(e.data)}on(e,t){let n=this.actionHandler;if(n[e])throw Error(`There is already an actionName called "${e}"`);n[e]=t}send(e,t,n){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,data:t},n)}sendWithPromise(e,t,n){let r=this.callbackId++,i=Promise.withResolvers();this.callbackCapabilities[r]=i;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:e,callbackId:r,data:t},n)}catch(e){i.reject(e)}return i.promise}sendWithStream(e,t,n,r){let i=this.streamId++,a=this.sourceName,o=this.targetName,s=this.comObj;return new ReadableStream({start:n=>{let c=Promise.withResolvers();return this.streamControllers[i]={controller:n,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},s.postMessage({sourceName:a,targetName:o,action:e,streamId:i,data:t,desiredSize:n.desiredSize},r),c.promise},pull:e=>{let t=Promise.withResolvers();return this.streamControllers[i].pullCall=t,s.postMessage({sourceName:a,targetName:o,stream:ET.PULL,streamId:i,desiredSize:e.desiredSize}),t.promise},cancel:e=>{lC(e instanceof Error,`cancel must have a valid reason`);let t=Promise.withResolvers();return this.streamControllers[i].cancelCall=t,this.streamControllers[i].isClosed=!0,s.postMessage({sourceName:a,targetName:o,stream:ET.CANCEL,streamId:i,reason:OT(e)}),t.promise}},n)}#n(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this,o=this.actionHandler[e.action],s={enqueue(e,a=1,o){if(this.isCancelled)return;let s=this.desiredSize;this.desiredSize-=a,s>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),i.postMessage({sourceName:n,targetName:r,stream:ET.ENQUEUE,streamId:t,chunk:e},o)},close(){this.isCancelled||(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:ET.CLOSE,streamId:t}),delete a.streamSinks[t])},error(e){lC(e instanceof Error,`error must have a valid reason`),!this.isCancelled&&(this.isCancelled=!0,i.postMessage({sourceName:n,targetName:r,stream:ET.ERROR,streamId:t,reason:OT(e)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:e.desiredSize,ready:null};s.sinkCapability.resolve(),s.ready=s.sinkCapability.promise,this.streamSinks[t]=s,Promise.try(o,e.data,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:ET.START_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:ET.START_COMPLETE,streamId:t,reason:OT(e)})})}#r(e){let t=e.streamId,n=this.sourceName,r=e.sourceName,i=this.comObj,a=this.streamControllers[t],o=this.streamSinks[t];switch(e.stream){case ET.START_COMPLETE:e.success?a.startCall.resolve():a.startCall.reject(OT(e.reason));break;case ET.PULL_COMPLETE:e.success?a.pullCall.resolve():a.pullCall.reject(OT(e.reason));break;case ET.PULL:if(!o){i.postMessage({sourceName:n,targetName:r,stream:ET.PULL_COMPLETE,streamId:t,success:!0});break}o.desiredSize<=0&&e.desiredSize>0&&o.sinkCapability.resolve(),o.desiredSize=e.desiredSize,Promise.try(o.onPull||DT).then(function(){i.postMessage({sourceName:n,targetName:r,stream:ET.PULL_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:ET.PULL_COMPLETE,streamId:t,reason:OT(e)})});break;case ET.ENQUEUE:if(lC(a,`enqueue should have stream controller`),a.isClosed)break;a.controller.enqueue(e.chunk);break;case ET.CLOSE:if(lC(a,`close should have stream controller`),a.isClosed)break;a.isClosed=!0,a.controller.close(),this.#i(a,t);break;case ET.ERROR:lC(a,`error should have stream controller`),a.controller.error(OT(e.reason)),this.#i(a,t);break;case ET.CANCEL_COMPLETE:e.success?a.cancelCall.resolve():a.cancelCall.reject(OT(e.reason)),this.#i(a,t);break;case ET.CANCEL:if(!o)break;let s=OT(e.reason);Promise.try(o.onCancel||DT,s).then(function(){i.postMessage({sourceName:n,targetName:r,stream:ET.CANCEL_COMPLETE,streamId:t,success:!0})},function(e){i.postMessage({sourceName:n,targetName:r,stream:ET.CANCEL_COMPLETE,streamId:t,reason:OT(e)})}),o.sinkCapability.reject(s),o.isCancelled=!0,delete this.streamSinks[t];break;default:throw Error(`Unexpected stream case`)}}async#i(e,t){await Promise.allSettled([e.startCall?.promise,e.pullCall?.promise,e.cancelCall?.promise]),delete this.streamControllers[t]}destroy(){this.#e?.abort(),this.#e=null}},AT=class{#e=Object.freeze({cMapUrl:`CMap`,standardFontDataUrl:`font`,wasmUrl:`wasm`});constructor({cMapUrl:e=null,standardFontDataUrl:t=null,wasmUrl:n=null}){this.cMapUrl=e,this.standardFontDataUrl=t,this.wasmUrl=n}async fetch({kind:e,filename:t}){switch(e){case`cMapUrl`:case`standardFontDataUrl`:case`wasmUrl`:break;default:cC(`Not implemented: ${e}`)}let n=this[e];if(!n)throw Error(`Ensure that the \`${e}\` API parameter is provided.`);let r=`${n}${t}`;return this._fetch(r,e).catch(t=>{throw Error(`Unable to load ${this.#e[e]} data at: ${r}`)})}async _fetch(e,t){cC("Abstract method `_fetch` called.")}},jT=class extends AT{async _fetch(e,t){let n=await UC(e,t===`cMapUrl`&&!e.endsWith(`.bcmap`)?`text`:`bytes`);return n instanceof Uint8Array?n:CC(n)}},MT=class{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,t){if(e<=0||t<=0)throw Error(`Invalid canvas size`);let n=this._createCanvas(e,t);return{canvas:n,context:n.getContext(`2d`,{willReadFrequently:!this.#e})}}reset({canvas:e},t,n){if(!e)throw Error(`Canvas is not specified`);if(t<=0||n<=0)throw Error(`Invalid canvas size`);e.width=t,e.height=n}destroy(e){let{canvas:t}=e;if(!t)throw Error(`Canvas is not specified`);t.width=t.height=0,e.canvas=null,e.context=null}_createCanvas(e,t){cC("Abstract method `_createCanvas` called.")}},NT=class extends MT{constructor({ownerDocument:e=globalThis.document,enableHWA:t=!1}){super({enableHWA:t}),this._document=e}_createCanvas(e,t){let n=this._document.createElement(`canvas`);return n.width=e,n.height=t,n}},PT=class{addFilter(e){return`none`}addHCMFilter(e,t){return`none`}addAlphaFilter(e){return`none`}addLuminosityFilter(e){return`none`}addKnockoutFilter(e=0){return`none`}addHighlightHCMFilter(e,t,n,r,i){return`none`}addSelectionHCMFilter(e,t){return`none`}addSelectionFilter(){return`none`}createSelectionStyle(e=null){return null}destroy(e=!1){}},FT=class extends PT{#e;#t;#n;#r;#i;#a;#o=0;constructor({docId:e,ownerDocument:t=globalThis.document}){super(),this.#r=e,this.#i=t}get#s(){return this.#t||=new Map}get#c(){return this.#a||=new Map}get#l(){if(!this.#n){let e=this.#i.createElement(`div`),{style:t}=e;t.colorScheme=`only light`,t.visibility=`hidden`,t.contain=`strict`,t.width=t.height=0,t.position=`absolute`,t.top=t.left=0,t.zIndex=-1;let n=this.#i.createElementNS(VS,`svg`);n.setAttribute(`width`,0),n.setAttribute(`height`,0),this.#n=this.#i.createElementNS(VS,`defs`),e.append(n),n.append(this.#n),this.#i.body.append(e)}return this.#n}#u(e){if(e.length===1){let t=e[0],n=Array(256);for(let e=0;e<256;e++)n[e]=t[e]/255;let r=n.join(`,`);return[r,r,r]}let[t,n,r]=e,i=Array(256),a=Array(256),o=Array(256);for(let e=0;e<256;e++)i[e]=t[e]/255,a[e]=n[e]/255,o[e]=r[e]/255;return[i.join(`,`),a.join(`,`),o.join(`,`)]}#d(e){if(this.#e===void 0){this.#e=``;let e=this.#i.URL;e!==this.#i.baseURI&&(GC(e)?sC(`#createUrl: ignore "data:"-URL for performance reasons.`):this.#e=fC(e,``))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return`none`;let t=this.#s.get(e);if(t)return t;let[n,r,i]=this.#u(e),a=e.length===1?n:`${n}${r}${i}`;if(t=this.#s.get(a),t)return this.#s.set(e,t),t;let o=`g_${this.#r}_transfer_map_${this.#o++}`,s=this.#d(o);this.#s.set(e,s),this.#s.set(a,s);let c=this.#m(o);return this.#g(n,r,i,c),s}addHCMFilter(e,t){let n=`${e}-${t}`,r=`base`,i=this.#c.get(r);if(i?.key===n||(i?(i.filter?.remove(),i.key=n,i.url=`none`,i.filter=null):(i={key:n,url:`none`,filter:null},this.#c.set(r,i)),!e||!t))return i.url;let a=this.#v(e);e=TC.makeHexColor(...a);let o=this.#v(t);if(t=TC.makeHexColor(...o),this.#b(),e===`#000000`&&t===`#ffffff`||e===t)return i.url;let s=Array.from({length:256},(e,t)=>pw(t/255)).join(`,`),c=`g_${this.#r}_hcm_filter`,l=i.filter=this.#m(c);this.#g(s,s,s,l),this.#p(l);let u=(e,t)=>{let n=a[e]/255,r=o[e]/255,i=Array(t+1);for(let e=0;e<=t;e++)i[e]=n+e/t*(r-n);return i.join(`,`)};return this.#g(u(0,5),u(1,5),u(2,5),l),i.url=this.#d(c),i.url}addSelectionHCMFilter(e,t){return this.addHighlightHCMFilter(`selection`,e,t,`HighlightText`,`Highlight`)}addSelectionFilter(){return this.addHighlightHCMFilter(`selection_default`,`black`,`white`,`HighlightText`,`Highlight`)}createSelectionStyle(e=null){let t=e?this.addSelectionHCMFilter(e.foreground,e.background):this.addSelectionFilter();return t===`none`||!wC.platform.isFirefox?null:{"backdrop-filter":t,"background-color":`transparent`}}addAlphaFilter(e){let t=this.#s.get(e);if(t)return t;let[n]=this.#u([e]),r=`alpha_${n}`;if(t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_alpha_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#_(n,o),a}addLuminosityFilter(e){let t=this.#s.get(e||`luminosity`);if(t)return t;let n,r;if(e?([n]=this.#u([e]),r=`luminosity_${n}`):r=`luminosity`,t=this.#s.get(r),t)return this.#s.set(e,t),t;let i=`g_${this.#r}_luminosity_map_${this.#o++}`,a=this.#d(i);this.#s.set(e,a),this.#s.set(r,a);let o=this.#m(i);return this.#f(o),e&&this.#_(n,o),a}addKnockoutFilter(e=0){let t=e>0?Math.min(1/e,1e6):1e6,n=`knockout_${t}`,r=this.#s.get(n);if(r)return r;let i=`g_${this.#r}_knockout_filter_${this.#o++}`,a=this.#d(i);this.#s.set(n,a);let o=this.#m(i),s=this.#i.createElementNS(VS,`feComponentTransfer`);o.append(s);let c=this.#i.createElementNS(VS,`feFuncA`);return c.setAttribute(`type`,`linear`),c.setAttribute(`slope`,`${t}`),c.setAttribute(`intercept`,`0`),s.append(c),a}addHighlightHCMFilter(e,t,n,r,i){let a=`${t}-${n}-${r}-${i}`,o=this.#c.get(e);if(o?.key===a||(o?(o.filter?.remove(),o.key=a,o.url=`none`,o.filter=null):(o={key:a,url:`none`,filter:null},this.#c.set(e,o)),!t||!n))return o.url;let[s,c]=[t,n].map(this.#v.bind(this)),l=Math.round(.2126*s[0]+.7152*s[1]+.0722*s[2]),u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[d,f]=[r,i].map(this.#x.bind(this));u<l&&([l,u,d,f]=[u,l,f,d]),this.#b();let p=(e,t,n)=>{let r=Array(256),i=(u-l)/n,a=e/255,o=(t-e)/(255*n),s=0;for(let e=0;e<=n;e++){let t=Math.round(l+e*i),n=a+e*o;for(let e=s;e<=t;e++)r[e]=n;s=t+1}for(let e=s;e<256;e++)r[e]=r[s-1];return r.join(`,`)},m=`g_${this.#r}_hcm_${e}_filter`,h=o.filter=this.#m(m);return this.#p(h),this.#g(p(d[0],f[0],5),p(d[1],f[1],5),p(d[2],f[2],5),h),o.url=this.#d(m),o.url}destroy(e=!1){e&&this.#a?.size||(this.#n?.parentNode.parentNode.remove(),this.#n=null,this.#t?.clear(),this.#t=null,this.#a?.clear(),this.#a=null,this.#o=0)}#f(e){let t=this.#i.createElementNS(VS,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0`),e.append(t)}#p(e){let t=this.#i.createElementNS(VS,`feColorMatrix`);t.setAttribute(`type`,`matrix`),t.setAttribute(`values`,`0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0`),e.append(t)}#m(e){let t=this.#i.createElementNS(VS,`filter`);return t.setAttribute(`color-interpolation-filters`,`sRGB`),t.setAttribute(`id`,e),this.#l.append(t),t}#h(e,t,n){let r=this.#i.createElementNS(VS,t);r.setAttribute(`type`,`discrete`),r.setAttribute(`tableValues`,n),e.append(r)}#g(e,t,n,r){let i=this.#i.createElementNS(VS,`feComponentTransfer`);r.append(i),this.#h(i,`feFuncR`,e),this.#h(i,`feFuncG`,t),this.#h(i,`feFuncB`,n)}#_(e,t){let n=this.#i.createElementNS(VS,`feComponentTransfer`);t.append(n),this.#h(n,`feFuncA`,e)}#v(e){return this.#l.style.color=`CanvasText`,this.#l.style.backgroundColor=e,tw(getComputedStyle(this.#l).getPropertyValue(`background-color`))}#y(e){return this.#l.style.color=`CanvasText`,this.#l.style.backgroundColor=e,ew(getComputedStyle(this.#l).getPropertyValue(`background-color`))}#b(){this.#l.style.color=``,this.#l.style.backgroundColor=``}#x(e){let[t,n,r,i]=this.#y(e);if(i===1)return[t,n,r];let[a,o,s]=this.#v(`Canvas`);return[IT(t,a,i),IT(n,o,i),IT(r,s,i)]}};function IT(e,t,n){return Math.round(n*e+(1-n)*t)}LS&&sC("Please use the `legacy` build in Node.js environments.");async function LT(e){let t=await process.getBuiltinModule(`fs/promises`).readFile(e);return new Uint8Array(t)}var RT=class extends PT{},zT=class extends MT{_createCanvas(e,t){return process.getBuiltinModule(`module`).createRequire(import.meta.url)(`@napi-rs/canvas`).createCanvas(e,t)}},BT=class extends AT{async _fetch(e,t){return LT(e)}};function VT({src:e,srcPos:t=0,dest:n,width:r,height:i,nonBlackColor:a=4294967295,inverseDecode:o=!1}){let s=wC.isLittleEndian?4278190080:255,[c,l]=o?[a,s]:[s,a],u=r>>3,d=r&7,f=c^l,p=e.length;n=new Uint32Array(n.buffer);let m=0;for(let r=0;r<i;++r){for(let r=t+u;t<r;++t,m+=8){let r=e[t];n[m]=c^-(r>>7&1)&f,n[m+1]=c^-(r>>6&1)&f,n[m+2]=c^-(r>>5&1)&f,n[m+3]=c^-(r>>4&1)&f,n[m+4]=c^-(r>>3&1)&f,n[m+5]=c^-(r>>2&1)&f,n[m+6]=c^-(r>>1&1)&f,n[m+7]=c^-(r&1)&f}if(d===0)continue;let r=t<p?e[t++]:255;for(let e=0;e<d;++e,++m)n[m]=c^-(r>>7-e&1)&f}return{srcPos:t,destPos:m}}function HT({src:e,srcPos:t=0,dest:n,destPos:r=0,width:i,height:a}){let o=0,s=i*a*3,c=s>>2,l=new Uint32Array(e.buffer,t,c),u=wC.isLittleEndian?4278190080:255;if(wC.isLittleEndian){for(;o<c-2;o+=3,r+=4){let e=l[o],t=l[o+1],i=l[o+2];n[r]=e|u,n[r+1]=e>>>24|t<<8|u,n[r+2]=t>>>16|i<<16|u,n[r+3]=i>>>8|u}for(let i=o*4,a=t+s;i<a;i+=3)n[r++]=e[i]|e[i+1]<<8|e[i+2]<<16|u}else{for(;o<c-2;o+=3,r+=4){let e=l[o],t=l[o+1],i=l[o+2];n[r]=e|u,n[r+1]=e<<24|t>>>8|u,n[r+2]=t<<16|i>>>16|u,n[r+3]=i<<8|u}for(let i=o*4,a=t+s;i<a;i+=3)n[r++]=e[i]<<24|e[i+1]<<16|e[i+2]<<8|u}return{srcPos:t+s,destPos:r}}var UT=`
|
|
80
|
+
struct Uniforms {
|
|
81
|
+
offsetX : f32,
|
|
82
|
+
offsetY : f32,
|
|
83
|
+
scaleX : f32,
|
|
84
|
+
scaleY : f32,
|
|
85
|
+
paddedWidth : f32,
|
|
86
|
+
paddedHeight : f32,
|
|
87
|
+
borderSize : f32,
|
|
88
|
+
_pad : f32,
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
@group(0) @binding(0) var<uniform> u : Uniforms;
|
|
92
|
+
|
|
93
|
+
struct VertexInput {
|
|
94
|
+
@location(0) position : vec2<f32>,
|
|
95
|
+
@location(1) color : vec4<f32>,
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
struct VertexOutput {
|
|
99
|
+
@builtin(position) position : vec4<f32>,
|
|
100
|
+
@location(0) color : vec3<f32>,
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
@vertex
|
|
104
|
+
fn vs_main(in : VertexInput) -> VertexOutput {
|
|
105
|
+
var out : VertexOutput;
|
|
106
|
+
let cx = (in.position.x + u.offsetX) * u.scaleX;
|
|
107
|
+
let cy = (in.position.y + u.offsetY) * u.scaleY;
|
|
108
|
+
out.position = vec4<f32>(
|
|
109
|
+
((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,
|
|
110
|
+
1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,
|
|
111
|
+
0.0,
|
|
112
|
+
1.0
|
|
113
|
+
);
|
|
114
|
+
out.color = in.color.rgb;
|
|
115
|
+
return out;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@fragment
|
|
119
|
+
fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
|
|
120
|
+
return vec4<f32>(in.color, 1.0);
|
|
121
|
+
}
|
|
122
|
+
`,WT=new class{#e=null;#t=null;#n=null;#r=null;async#i(){if(!globalThis.navigator?.gpu)return!1;try{let e=await navigator.gpu.requestAdapter();return e?(this.#r=navigator.gpu.getPreferredCanvasFormat(),this.#t=await e.requestDevice(),!0):!1}catch{return!1}}init(){return this.#e||=this.#i()}get isReady(){return this.#t!==null}loadMeshShader(){if(!this.#t||this.#n)return;let e=this.#t.createShaderModule({code:UT});this.#n=this.#t.createRenderPipeline({layout:`auto`,vertex:{module:e,entryPoint:`vs_main`,buffers:[{arrayStride:8,attributes:[{shaderLocation:0,offset:0,format:`float32x2`}]},{arrayStride:4,attributes:[{shaderLocation:1,offset:0,format:`unorm8x4`}]}]},fragment:{module:e,entryPoint:`fs_main`,targets:[{format:this.#r}]},primitive:{topology:`triangle-list`}})}draw(e,t,n,r,i,a,o,s){this.loadMeshShader();let c=this.#t,{offsetX:l,offsetY:u,scaleX:d,scaleY:f}=r,p=c.createBuffer({size:Math.max(e.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});e.byteLength>0&&c.queue.writeBuffer(p,0,e);let m=c.createBuffer({size:Math.max(t.byteLength,4),usage:GPUBufferUsage.VERTEX|GPUBufferUsage.COPY_DST});t.byteLength>0&&c.queue.writeBuffer(m,0,t);let h=c.createBuffer({size:32,usage:GPUBufferUsage.UNIFORM|GPUBufferUsage.COPY_DST});c.queue.writeBuffer(h,0,new Float32Array([l,u,d,f,a,o,s,0]));let g=c.createBindGroup({layout:this.#n.getBindGroupLayout(0),entries:[{binding:0,resource:{buffer:h}}]}),_=new OffscreenCanvas(a,o),v=_.getContext(`webgpu`);v.configure({device:c,format:this.#r,alphaMode:i?`opaque`:`premultiplied`});let y=i?{r:i[0]/255,g:i[1]/255,b:i[2]/255,a:1}:{r:0,g:0,b:0,a:0},b=c.createCommandEncoder(),x=b.beginRenderPass({colorAttachments:[{view:v.getCurrentTexture().createView(),clearValue:y,loadOp:`clear`,storeOp:`store`}]});return n>0&&(x.setPipeline(this.#n),x.setBindGroup(0,g),x.setVertexBuffer(0,p),x.setVertexBuffer(1,m),x.draw(n)),x.end(),c.queue.submit([b.finish()]),p.destroy(),m.destroy(),h.destroy(),_.transferToImageBitmap()}};function GT(){return WT.init()}function KT(){return WT.isReady}function qT(){WT.loadMeshShader()}function JT(e,t,n,r,i,a,o,s){return WT.draw(e,t,n,r,i,a,o,s)}var YT={FILL:`Fill`,STROKE:`Stroke`,SHADING:`Shading`};function XT(e,t){if(!t)return;let n=t[2]-t[0],r=t[3]-t[1],i=new Path2D;i.rect(t[0],t[1],n,r),e.clip(i)}var ZT=class{matrix=null;isModifyingCurrentTransform(){return!1}getPattern(){cC("Abstract method `getPattern` called.")}},QT=class extends ZT{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7]}isOriginBased(){return this._p0[0]===0&&this._p0[1]===0&&(!this.isRadial()||this._p1[0]===0&&this._p1[1]===0)}isRadial(){return this._type===`radial`}areConic(){if(!this.isRadial())return!1;let e=Math.hypot(this._p0[0]-this._p1[0],this._p0[1]-this._p1[1]);return e+this._r1>this._r0&&e+this._r0>this._r1}_createGradient(e,t=null){let n,r=this._p0,i=this._p1;if(t&&(r=r.slice(),i=i.slice(),TC.applyTransform(r,t),TC.applyTransform(i,t)),this._type===`axial`)n=e.createLinearGradient(r[0],r[1],i[0],i[1]);else if(this._type===`radial`){let a=this._r0,o=this._r1;if(t){let e=new Float32Array(2);TC.singularValueDecompose2dScale(t,e),a*=e[0],o*=e[0]}n=e.createRadialGradient(r[0],r[1],a,i[0],i[1],o)}for(let e of this._colorStops)n.addColorStop(e[0],e[1]);return n}_createReversedGradient(e,t=null){let n=this._p1,r=this._p0;t&&(n=n.slice(),r=r.slice(),TC.applyTransform(n,t),TC.applyTransform(r,t));let i=this._r1,a=this._r0;if(t){let e=new Float32Array(2);TC.singularValueDecompose2dScale(t,e),i*=e[0],a*=e[0]}let o=e.createRadialGradient(n[0],n[1],i,r[0],r[1],a),s=this._colorStops.map(([e,t])=>[1-e,t]).reverse();for(let[e,t]of s)o.addColorStop(e,t);return o}getPattern(e,t,n,r){let i;if(r===YT.STROKE||r===YT.FILL){if(this.isOriginBased()){let r=TC.transform(n,t.baseTransform);this.matrix&&(r=TC.transform(r,this.matrix));let i=.001,a=Math.hypot(r[0],r[1]),o=Math.hypot(r[2],r[3]),s=(r[0]*r[2]+r[1]*r[3])/(a*o);if(Math.abs(s)<i)if(this.isRadial()){if(Math.abs(a-o)<i)return this._createGradient(e,r)}else return this._createGradient(e,r)}let a=t.current.getClippedPathBoundingBox(r,rw(e))||[0,0,0,0],o=Math.ceil(a[2]-a[0])||1,s=Math.ceil(a[3]-a[1])||1,c=t.canvasFactory.create(o,s),l=c.context;l.clearRect(0,0,l.canvas.width,l.canvas.height),l.beginPath(),l.rect(0,0,l.canvas.width,l.canvas.height),l.translate(-a[0],-a[1]),n=TC.transform(n,[1,0,0,1,a[0],a[1]]),l.transform(...t.baseTransform),this.matrix&&l.transform(...this.matrix),XT(l,this._bbox),this.areConic()&&(l.fillStyle=this._createReversedGradient(l),l.fill()),l.fillStyle=this._createGradient(l),l.fill(),i=e.createPattern(c.canvas,`no-repeat`),t.canvasFactory.destroy(c);let u=new DOMMatrix(n);i.setTransform(u)}else this.areConic()&&(e.save(),XT(e,this._bbox),e.fillStyle=this._createReversedGradient(e),e.fillRect(-1e10,-1e10,2e10,2e10),e.restore()),XT(e,this._bbox),i=this._createGradient(e);return i}};function $T(e,t,n,r,i,a,o,s){let c=t.coords,l=t.colors,u=e.data,d=e.width*4,f;c[n*2+1]>c[r*2+1]&&(f=n,n=r,r=f,f=a,a=o,o=f),c[r*2+1]>c[i*2+1]&&(f=r,r=i,i=f,f=o,o=s,s=f),c[n*2+1]>c[r*2+1]&&(f=n,n=r,r=f,f=a,a=o,o=f);let p=(c[n*2]+t.offsetX)*t.scaleX,m=(c[n*2+1]+t.offsetY)*t.scaleY,h=(c[r*2]+t.offsetX)*t.scaleX,g=(c[r*2+1]+t.offsetY)*t.scaleY,_=(c[i*2]+t.offsetX)*t.scaleX,v=(c[i*2+1]+t.offsetY)*t.scaleY;if(m>=v)return;let y=l[a*4],b=l[a*4+1],x=l[a*4+2],S=l[o*4],C=l[o*4+1],w=l[o*4+2],T=l[s*4],E=l[s*4+1],D=l[s*4+2],O=Math.round(m),k=Math.round(v),A,j,M,N,P,F,I,L;for(let e=O;e<=k;e++){if(e<g){let t=e<m?0:(m-e)/(m-g);A=p-(p-h)*t,j=y-(y-S)*t,M=b-(b-C)*t,N=x-(x-w)*t}else{let t;t=e>v?1:g===v?0:(g-e)/(g-v),A=h-(h-_)*t,j=S-(S-T)*t,M=C-(C-E)*t,N=w-(w-D)*t}let t;t=e<m?0:e>v?1:(m-e)/(m-v),P=p-(p-_)*t,F=y-(y-T)*t,I=b-(b-E)*t,L=x-(x-D)*t;let n=Math.round(Math.min(A,P)),r=Math.round(Math.max(A,P)),i=d*e+n*4;for(let e=n;e<=r;e++)t=(A-e)/(A-P),t<0?t=0:t>1&&(t=1),u[i++]=j-(j-F)*t|0,u[i++]=M-(M-I)*t|0,u[i++]=N-(N-L)*t|0,u[i++]=255}}var eE=class extends ZT{constructor(e){super(),this._posData=e[2],this._colData=e[3],this._vertexCount=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],qT()}_createMeshCanvas(e,t,n){let r=1.1,i=3e3,a=Math.floor(this._bounds[0]),o=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-a,c=Math.ceil(this._bounds[3])-o,l=Math.min(Math.ceil(Math.abs(s*e[0]*r)),i)||1,u=Math.min(Math.ceil(Math.abs(c*e[1]*r)),i)||1,d=s?s/l:1,f=c?c/u:1,p={coords:this._posData,colors:this._colData,offsetX:-a,offsetY:-o,scaleX:1/d,scaleY:1/f},m=l+4,h=u+4,g=n.create(m,h);if(KT()&&this._vertexCount>48)g.context.drawImage(JT(this._posData,this._colData,this._vertexCount,p,t,m,h,2),0,0);else{let e=g.context.createImageData(l,u);if(t){let n=e.data;for(let e=0,r=n.length;e<r;e+=4)n[e]=t[0],n[e+1]=t[1],n[e+2]=t[2],n[e+3]=255}for(let t=0,n=this._vertexCount;t<n;t+=3)$T(e,p,t,t+1,t+2,t,t+1,t+2);g.context.putImageData(e,2,2)}return{canvas:g.canvas,offsetX:a-2*d,offsetY:o-2*f,scaleX:d,scaleY:f}}isModifyingCurrentTransform(){return!0}getPattern(e,t,n,r){XT(e,this._bbox);let i=new Float32Array(2);if(r===YT.SHADING)TC.singularValueDecompose2dScale(rw(e),i);else if(this.matrix){TC.singularValueDecompose2dScale(this.matrix,i);let[e,n]=i;TC.singularValueDecompose2dScale(t.baseTransform,i),i[0]*=e,i[1]*=n}else TC.singularValueDecompose2dScale(t.baseTransform,i);let a=this._createMeshCanvas(i,r===YT.SHADING?null:this._background,t.canvasFactory);r!==YT.SHADING&&(e.setTransform(...t.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(a.offsetX,a.offsetY),e.scale(a.scaleX,a.scaleY);let o=e.createPattern(a.canvas,`no-repeat`);return t.canvasFactory.destroy(a),o}},tE=class extends ZT{getPattern(){return`hotpink`}};function nE(e){switch(e[0]){case`RadialAxial`:return new QT(e);case`Mesh`:return new eE(e);case`Dummy`:return new tE}throw Error(`Unknown IR type: ${e[0]}`)}var rE={COLORED:1,UNCOLORED:2},iE=class e{static MAX_PATTERN_SIZE=3e3;constructor(e,t,n,r){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.needsIsolation=e[9]??!0,this.ctx=t,this.canvasGraphicsFactory=n,this.baseTransform=r,this.patternBaseMatrix=this.matrix?TC.transform(r,this.matrix):r}canSkipPatternCanvas([e,t,n,r]){let[i,a,o,s]=this.bbox,c=Math.abs(this.xstep),l=Math.abs(this.ystep);if(e>c+1e-6||t>l+1e-6)return null;let u=Math.floor((n-o)/c)+1,d=Math.ceil((n+e-i)/c)-1,f=Math.floor((r-s)/l)+1,p=Math.ceil((r+t-a)/l)-1;return d<=u&&p<=f?[u,f]:null}updatePatternDims(e,t){let n=TC.inverseTransform(this.patternBaseMatrix),r=[e[0],e[1]],i=[e[2],e[3]];TC.applyTransform(r,n),TC.applyTransform(i,n),t[0]=Math.abs(i[0]-r[0]),t[1]=Math.abs(i[1]-r[1]),t[2]=Math.min(r[0],i[0]),t[3]=Math.min(r[1],i[1])}_renderTileCanvas(e,t,n,r){let[i,a,o,s]=this.bbox,c=e.canvasFactory.create(n.size,r.size),l=c.context,u=this.canvasGraphicsFactory.createCanvasGraphics(l,t);return u.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(u,this.paintType,this.color),l.translate(-n.scale*i,-r.scale*a),u.transform(0,n.scale,0,0,r.scale,0,0),l.save(),u.dependencyTracker?.save(),this.clipBbox(u,i,a,o,s),u.baseTransform=rw(u.ctx),u.executeOperatorList(this.operatorList),u.endDrawing(),u.dependencyTracker?.restore(),l.restore(),c}_getCombinedScales(){let e=new Float32Array(2);TC.singularValueDecompose2dScale(this.matrix,e);let[t,n]=e;return TC.singularValueDecompose2dScale(this.baseTransform,e),[t*e[0],n*e[1]]}drawPattern(e,t,n=!1,[r,i],a){let[o,s,c,l]=this.bbox,u=e.dependencyTracker;if(u&&(e.dependencyTracker=new tT(u,a)),e.save(),n?e.ctx.clip(t,`evenodd`):e.ctx.clip(t),e.ctx.setTransform(...this.patternBaseMatrix),e.ctx.translate(r*this.xstep,i*this.ystep),this.needsIsolation||e.ctx.globalAlpha!==1||e.ctx.globalCompositeOperation!==`source-over`||e.inSMaskMode){let t=c-o,n=l-s,[r,i]=this._getCombinedScales(),u=this.getSizeAndScale(t,this.ctx.canvas.width,r),d=this.getSizeAndScale(n,this.ctx.canvas.height,i),f=this._renderTileCanvas(e,a,u,d);e.ctx.drawImage(f.canvas,o,s,t,n),e.canvasFactory.destroy(f)}else this.setFillAndStrokeStyleToContext(e,this.paintType,this.color),this.clipBbox(e,o,s,c,l),e.baseTransformStack.push(e.baseTransform),e.baseTransform=rw(e.ctx),e.executeOperatorList(this.operatorList),e.baseTransform=e.baseTransformStack.pop();e.restore(),u&&(e.dependencyTracker=u)}createPatternCanvas(e,t){let[n,r,i,a]=this.bbox,o=i-n,s=a-r,{xstep:c,ystep:l}=this;c=Math.abs(c),l=Math.abs(l),oC(`TilingType: `+this.tilingType);let[u,d]=this._getCombinedScales(),f=o,p=s,m=!1,h=!1;Math.ceil(c*u)>=Math.ceil(o*u)?f=c:m=!0,Math.ceil(l*d)>=Math.ceil(s*d)?p=l:h=!0;let g=this.getSizeAndScale(f,this.ctx.canvas.width,u),_=this.getSizeAndScale(p,this.ctx.canvas.height,d),v=this._renderTileCanvas(e,t,g,_);if(m||h){let t=v.canvas;m&&(f=c),h&&(p=l);let i=this.getSizeAndScale(f,this.ctx.canvas.width,u),a=this.getSizeAndScale(p,this.ctx.canvas.height,d),g=i.size,_=a.size,y=e.canvasFactory.create(g,_),b=y.context,x=m?Math.floor(o/c):0,S=h?Math.floor(s/l):0;for(let e=0;e<=x;e++)for(let n=0;n<=S;n++)b.drawImage(t,g*e,_*n,g,_,0,0,g,_);return e.canvasFactory.destroy(v),{canvas:y.canvas,canvasEntry:y,scaleX:i.scale,scaleY:a.scale,offsetX:n,offsetY:r}}return{canvas:v.canvas,canvasEntry:v,scaleX:g.scale,scaleY:_.scale,offsetX:n,offsetY:r}}getSizeAndScale(t,n,r){let i=Math.max(e.MAX_PATTERN_SIZE,n),a=Math.ceil(t*r);return a>=i?a=i:r=a/t,{scale:r,size:a}}clipBbox(e,t,n,r,i){let a=r-t,o=i-n,s=new Path2D;s.rect(t,n,a,o),TC.axialAlignedBoundingBox([t,n,r,i],rw(e.ctx),e.current.minMax),e.ctx.clip(s),e.current.updateClipFromPath()}setFillAndStrokeStyleToContext(e,t,n){let r=e.ctx,i=e.current;switch(i.patternFill=i.patternStroke=!1,t){case rE.COLORED:let{fillStyle:e,strokeStyle:a}=this.ctx;r.fillStyle=i.fillColor=e,r.strokeStyle=i.strokeColor=a;break;case rE.UNCOLORED:r.fillStyle=r.strokeStyle=n,i.fillColor=i.strokeColor=n;break;default:throw new bC(`Unsupported paint type: ${t}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,t,n,r,i){let a=r===YT.SHADING?n:TC.transform(n,this.patternBaseMatrix),o=this.createPatternCanvas(t,i),s=new DOMMatrix(a);s=s.translate(o.offsetX,o.offsetY),s=s.scale(1/o.scaleX,1/o.scaleY);let c=e.createPattern(o.canvas,`repeat`);return t.canvasFactory.destroy(o.canvasEntry),c.setTransform(s),c}},aE=16,oE=100,sE=15,cE=10,lE=16,uE=new Float32Array(2);function dE(e,t){if(e._removeMirroring)throw Error(`Context is already forwarding operations.`);let n=new Map;for(let r of[`save`,`restore`,`rotate`,`scale`,`translate`,`transform`,`setTransform`,`resetTransform`,`clip`,`moveTo`,`lineTo`,`bezierCurveTo`,`quadraticCurveTo`,`arc`,`arcTo`,`ellipse`,`rect`,`roundRect`,`closePath`,`beginPath`]){let i=e[r];typeof i!=`function`||typeof t[r]!=`function`||(n.set(r,i),e[r]=function(...e){return t[r](...e),i.apply(this,e)})}e._removeMirroring=()=>{for(let[t,r]of n)e[t]=r;delete e._removeMirroring}}function fE(e,t,n,r,i,a,o,s,c,l){let[u,d,f,p,m,h]=rw(e);if(d===0&&f===0){let g=o*u+m,_=Math.round(g),v=s*p+h,y=Math.round(v),b=(o+c)*u+m,x=Math.abs(Math.round(b)-_)||1,S=(s+l)*p+h,C=Math.abs(Math.round(S)-y)||1;return e.setTransform(Math.sign(u),0,0,Math.sign(p),_,y),e.drawImage(t,n,r,i,a,0,0,x,C),e.setTransform(u,d,f,p,m,h),[x,C]}if(u===0&&p===0){let g=s*f+m,_=Math.round(g),v=o*d+h,y=Math.round(v),b=(s+l)*f+m,x=Math.abs(Math.round(b)-_)||1,S=(o+c)*d+h,C=Math.abs(Math.round(S)-y)||1;return e.setTransform(0,Math.sign(d),Math.sign(f),0,_,y),e.drawImage(t,n,r,i,a,0,0,C,x),e.setTransform(u,d,f,p,m,h),[C,x]}e.drawImage(t,n,r,i,a,o,s,c,l);let g=Math.hypot(u,d),_=Math.hypot(f,p);return[g*c,_*l]}var pE=class{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=BS;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=YS.FILL;textRise=0;fillColor=`#000000`;strokeColor=`#000000`;tilingPatternDims=null;patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps=`none`;minMax=zS.slice();constructor(e,t){this.clipBox=new Float32Array([0,0,e,t])}clone(){let e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e.tilingPatternDims=this.tilingPatternDims?.slice(),e}getPathBoundingBox(e=YT.FILL,t=null){let n=this.minMax.slice();if(e===YT.STROKE){t||cC(`Stroke bounding box must include transform.`),TC.singularValueDecompose2dScale(t,uE);let e=uE[0]*this.lineWidth/2,r=uE[1]*this.lineWidth/2;n[0]-=e,n[1]-=r,n[2]+=e,n[3]+=r}return n}updateClipFromPath(){let e=TC.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(zS,0)}getClippedPathBoundingBox(e=YT.FILL,t=null){return TC.intersect(this.clipBox,this.getPathBoundingBox(e,t))}};function mE(e,t){let{width:n,height:r,kind:i}=t,a=r%lE,o=(r-a)/lE,s=a===0?o:o+1,c=e.createImageData(n,lE),l=0,u=t.data,d=c.data,f;if(i===XS.GRAYSCALE_1BPP)for(f=0;f<s;f++)({srcPos:l}=VT({src:u,srcPos:l,dest:d,width:n,height:f<o?lE:a})),e.putImageData(c,0,f*lE);else if(i===XS.RGBA_32BPP){let t=0,r=n*lE*4;for(f=0;f<o;f++)d.set(u.subarray(l,l+r)),l+=r,e.putImageData(c,0,t),t+=lE;f<s&&(r=n*a*4,d.set(u.subarray(l,l+r)),e.putImageData(c,0,t))}else if(i===XS.RGB_24BPP)for(f=0;f<s;f++)({srcPos:l}=HT({src:u,srcPos:l,dest:new Uint32Array(d.buffer),width:n,height:f<o?lE:a})),e.putImageData(c,0,f*lE);else throw Error(`bad image kind: ${i}`)}function hE(e,t){if(t.bitmap){e.drawImage(t.bitmap,0,0);return}let{width:n,height:r}=t,i=r%lE,a=(r-i)/lE,o=i===0?a:a+1,s=e.createImageData(n,lE),c=0,l=t.data,u=s.data;for(let t=0;t<o;t++)({srcPos:c}=VT({src:l,srcPos:c,dest:u,width:n,height:t<a?lE:i,nonBlackColor:0})),e.putImageData(s,0,t*lE)}function gE(e,t){for(let n of[`strokeStyle`,`fillStyle`,`fillRule`,`globalAlpha`,`lineWidth`,`lineCap`,`lineJoin`,`miterLimit`,`globalCompositeOperation`,`font`,`filter`])e[n]!==void 0&&(t[n]=e[n]);e.setLineDash!==void 0&&(t.setLineDash(e.getLineDash()),t.lineDashOffset=e.lineDashOffset)}function _E(e){e.strokeStyle=e.fillStyle=`#000000`,e.fillRule=`nonzero`,e.globalAlpha=1,e.lineWidth=1,e.lineCap=`butt`,e.lineJoin=`miter`,e.miterLimit=10,e.globalCompositeOperation=`source-over`,e.font=`10px sans-serif`,e.setLineDash!==void 0&&(e.setLineDash([]),e.lineDashOffset=0);let{filter:t}=e;t!==`none`&&t!==``&&(e.filter=`none`)}function vE(e,t){if(t)return!0;TC.singularValueDecompose2dScale(e,uE);let n=Math.fround(ow.pixelRatio*HC.PDF_TO_CSS_UNITS);return uE[0]<=n&&uE[1]<=n}var yE=[`butt`,`round`,`square`],bE=[`miter`,`round`,`bevel`],xE={},SE={},CE=class e{static#e=null;#t=0;#n=0;#r=null;#i=null;#a=null;#o=null;#s=1;#c;#l=null;#u=[];constructor(e,t,n,r,i,{optionalContentConfig:a,markedContentStack:o=null},s,c,l,u){this.ctx=e,this.current=new pE(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.commonObjs=t,this.objs=n,this.canvasFactory=r,this.filterFactory=i,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.tempSMask=null,this.smaskGroupCanvases=[],this.smaskPreparedEntry=null,this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.smaskPreparedOOBAlpha=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=o||[],this.optionalContentConfig=a,this.cachedPatterns=new Map,this.annotationCanvasMap=s,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=l??null,this.imagesTracker=u??null}getObject(e,t,n=null){return typeof t==`string`?(this.dependencyTracker?.recordNamedDependency(e,t),t.startsWith(`g_`)?this.commonObjs.get(t):this.objs.get(t)):n}beginDrawing({transform:e,viewport:t,transparency:n=!1,background:r=null}){let i=this.ctx.canvas.width,a=this.ctx.canvas.height,o=this.ctx.fillStyle;if(this.ctx.fillStyle=r||`#ffffff`,this.ctx.fillRect(0,0,i,a),this.ctx.fillStyle=o,n){let e=this.transparentCanvasEntry=this.canvasFactory.create(i,a);this.compositeCtx=this.ctx,{canvas:this.transparentCanvas,context:this.ctx}=e,this.ctx.save(),this.ctx.transform(...rw(this.compositeCtx))}this.ctx.save(),_E(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[3]),this.ctx.transform(...t.transform),this.viewportScale=t.scale,this.baseTransform=rw(this.ctx)}executeOperatorList(e,t,n,r,i){let a=e.argsArray,o=e.fnArray,s=t||0,c=a.length;if(c===s)return s;let l=c-s>cE&&typeof n==`function`,u=l?Date.now()+sE:0,d=0,f=this.commonObjs,p=this.objs,m,h;for(;;){if(r!==void 0){if(s===r.nextBreakPoint)return r.breakIt(s,n),s;if(r.shouldSkip(s)){if(++s===c)return s;continue}}if(!i||i(s))if(m=o[s],h=a[s]??null,m!==eC.dependency)h===null?this[m](s):this[m](s,...h);else for(let e of h){this.dependencyTracker?.recordNamedData(e,s);let t=e.startsWith(`g_`)?f:p;if(!t.has(e))return t.get(e,n),s}if(s++,s===c)return s;if(l&&++d>cE){if(Date.now()>u)return n(),s;d=0}}}#d(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.canvasFactory.destroy(this.transparentCanvasEntry),this.transparentCanvas=null,this.transparentCanvasEntry=null)}endDrawing(){this.#d();for(let e of this.smaskGroupCanvases)this.canvasFactory.destroy(e);this.smaskGroupCanvases.length=0,this._clearPreparedSMask(),this.tempSMask=null,this.smaskStack.length=0;for(let e of this.#u)this.#b(e);this.#u.length=0,this.#r=null,this.#i=null,this.#a=null,this.#o=null,this.#s=1,this.#l=null,this.#n=0,this.#t=0,this.cachedPatterns.clear();for(let e of this._cachedBitmapsMap.values()){for(let t of e.values())typeof HTMLCanvasElement<`u`&&t instanceof HTMLCanvasElement&&(t.width=t.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#f()}#f(){if(this.pageColors){let e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!==`none`){let t=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=t}}}_scaleImage(e,t){let n=e.width??e.displayWidth,r=e.height??e.displayHeight,i=Math.max(Math.hypot(t[0],t[1]),1),a=Math.max(Math.hypot(t[2],t[3]),1),o=[],s=i,c=a,l=n,u=r;for(;s>2&&l>1||c>2&&u>1;){let e=l,t=u;s>2&&l>1&&(e=Math.ceil(l/2),s/=l/e),c>2&&u>1&&(t=Math.ceil(u/2),c/=u/t),o.push({newWidth:e,newHeight:t}),l=e,u=t}if(o.length===0)return{img:e,paintWidth:n,paintHeight:r,tmpCanvas:null};if(o.length===1){let{newWidth:t,newHeight:i}=o[0],a=this.canvasFactory.create(t,i);return a.context.drawImage(e,0,0,n,r,0,0,t,i),{img:a.canvas,paintWidth:t,paintHeight:i,tmpCanvas:a}}let d=this.canvasFactory.create(1,1),f=this.canvasFactory.create(1,1),p=n,m=r,h=e;for(let{newWidth:e,newHeight:t}of o)this.canvasFactory.reset(f,e,t),f.context.drawImage(h,0,0,p,m,0,0,e,t),[d,f]=[f,d],h=d.canvas,p=e,m=t;return this.canvasFactory.destroy(f),{img:d.canvas,paintWidth:p,paintHeight:m,tmpCanvas:d}}_createMaskCanvas(e,t){let n=this.ctx,{width:r,height:i}=t,a=this.current.fillColor,o=this.current.patternFill,s=rw(n),c,l,u,d;if((t.bitmap||t.data)&&t.count>1){let n=t.bitmap||t.data.buffer;l=JSON.stringify(o?s:[s.slice(0,4),a]),c=this._cachedBitmapsMap.getOrInsertComputed(n,NC);let r=c.get(l);if(r&&!o){let t=Math.round(Math.min(s[0],s[2])+s[4]),n=Math.round(Math.min(s[1],s[3])+s[5]);return this.dependencyTracker?.recordDependencies(e,nT.transformAndFill),{canvas:r,offsetX:t,offsetY:n}}u=r}u||(d=this.canvasFactory.create(r,i),hE(d.context,t));let f=TC.transform(s,[1/r,0,0,-1/i,0,0]);f=TC.transform(f,[1,0,0,1,0,-i]);let p=zS.slice();TC.axialAlignedBoundingBox([0,0,r,i],f,p);let[m,h,g,_]=p,v=Math.round(g-m)||1,y=Math.round(_-h)||1,b=this.canvasFactory.create(v,y),x=b.context,S=m,C=h;x.translate(-S,-C),x.transform(...f);let w=null;if(!u){let e=this._scaleImage(d.canvas,iw(x));u=e.img,w=e.tmpCanvas,u!==d.canvas&&(this.canvasFactory.destroy(d),d=null),c&&o&&(c.set(l,u),w=null,d=null)}x.imageSmoothingEnabled=vE(rw(x),t.interpolate),fE(x,u,0,0,u.width,u.height,0,0,r,i),w&&this.canvasFactory.destroy(w),d&&this.canvasFactory.destroy(d),x.globalCompositeOperation=`source-in`;let T=TC.transform(iw(x),[1,0,0,1,-S,-C]);return x.fillStyle=o?a.getPattern(n,this,T,YT.FILL,e):a,x.fillRect(0,0,r,i),c&&!o&&c.set(l,b.canvas),this.dependencyTracker?.recordDependencies(e,nT.transformAndFill),{canvas:b.canvas,canvasEntry:c&&!o?null:b,offsetX:Math.round(S),offsetY:Math.round(C)}}setLineWidth(e,t){this.dependencyTracker?.recordSimpleData(`lineWidth`,e),t!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=t,this.ctx.lineWidth=t}setLineCap(e,t){this.dependencyTracker?.recordSimpleData(`lineCap`,e),this.ctx.lineCap=yE[t]}setLineJoin(e,t){this.dependencyTracker?.recordSimpleData(`lineJoin`,e),this.ctx.lineJoin=bE[t]}setMiterLimit(e,t){this.dependencyTracker?.recordSimpleData(`miterLimit`,e),this.ctx.miterLimit=t}setDash(e,t,n){this.dependencyTracker?.recordSimpleData(`dash`,e);let r=this.ctx;r.setLineDash!==void 0&&(r.setLineDash(t),r.lineDashOffset=n)}setRenderingIntent(e,t){}setFlatness(e,t){}setGState(e,t){for(let[n,r]of t)switch(n){case`LW`:this.setLineWidth(e,r);break;case`LC`:this.setLineCap(e,r);break;case`LJ`:this.setLineJoin(e,r);break;case`ML`:this.setMiterLimit(e,r);break;case`D`:this.setDash(e,r[0],r[1]);break;case`RI`:this.setRenderingIntent(e,r);break;case`FL`:this.setFlatness(e,r);break;case`Font`:this.setFont(e,r[0],r[1]);break;case`CA`:this.dependencyTracker?.recordSimpleData(`strokeAlpha`,e),this.current.strokeAlpha=r;break;case`ca`:this.dependencyTracker?.recordSimpleData(`fillAlpha`,e),this.ctx.globalAlpha=this.current.fillAlpha=r;break;case`BM`:this.dependencyTracker?.recordSimpleData(`globalCompositeOperation`,e),this.ctx.globalCompositeOperation=r;break;case`SMask`:this.dependencyTracker?.recordSimpleData(`SMask`,e),this.current.activeSMask=r?this.tempSMask:null,this.current.activeSMask&&(this.current.activeSMask.blendMode=this.ctx.globalCompositeOperation),this.tempSMask=null,this.checkSMaskState(e);break;case`TR`:this.dependencyTracker?.recordSimpleData(`filter`,e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(r);break}}get inSMaskMode(){return!!this.suspendedCtx}_clearPreparedSMask(){this.smaskPreparedEntry&&=(this.canvasFactory.destroy(this.smaskPreparedEntry),null),this.smaskPreparedFor=null,this.smaskPreparedOffsetX=0,this.smaskPreparedOffsetY=0,this.smaskPreparedOOBAlpha=null}_ensurePreparedSMask(e){e!==this.smaskPreparedFor&&(this._clearPreparedSMask(),this._prepareSMaskCanvas(e))}checkSMaskState(e){let t=this.inSMaskMode;this.current.activeSMask&&!t?this.beginSMaskMode(e):!this.current.activeSMask&&t?this.endSMaskMode():this.current.activeSMask&&t&&this._ensurePreparedSMask(this.current.activeSMask)}_prepareSMaskCanvas(e){let{canvas:t,subtype:n,backdrop:r,transferMap:i}=e,a=n===`Luminosity`||n===`Alpha`&&i;if(!a&&!(n===`Luminosity`&&r)){this.smaskPreparedFor=e;return}let o;if(n===`Luminosity`&&r){let[e,t,n]=ew(r),a=Math.round(.3*e+.59*t+.11*n);o=i?.[a]??a}else o=i?.[0]??0;let{width:s,height:c}=this.ctx.canvas,l=t.width*t.height,u=s*c<4*l,d=a?{url:n===`Alpha`?this.filterFactory.addAlphaFilter(i):this.filterFactory.addLuminosityFilter(i),subtype:n,transferMap:i}:null,f=n===`Luminosity`?r:null,p,m,h;u?(p=this._bakeSMaskCanvas(t,e.offsetX,e.offsetY,s,c,f,d),m=0,h=0):(p=this._bakeSMaskCanvas(t,0,0,t.width,t.height,f,d),m=e.offsetX,h=e.offsetY),this.smaskPreparedEntry=p,this.smaskPreparedFor=e,this.smaskPreparedOffsetX=m,this.smaskPreparedOffsetY=h,this.smaskPreparedOOBAlpha=!u&&o!==0?o:null}_bakeSMaskCanvas(e,t,n,r,i,a,o){!a&&!o&&cC(`_bakeSMaskCanvas with neither backdrop nor filter`);let s=this.canvasFactory.create(r,i),c=s.context;if(c.drawImage(e,t,n),a&&(c.globalCompositeOperation=`destination-atop`,c.fillStyle=a,c.fillRect(0,0,r,i)),!o)return s;let l=this.canvasFactory.create(r,i),u=l.context;u.filter=o.url;let d=wC.isCanvasFilterSupported&&u.filter!==`none`&&u.filter!==``;if(u.drawImage(s.canvas,0,0),wC.isCanvasFilterSupported&&(u.filter=`none`),!d){let e=u.getImageData(0,0,r,i),{data:t}=e,{transferMap:n}=o;if(o.subtype===`Luminosity`)for(let e=0,r=t.length;e<r;e+=4){let r=.3*t[e]+.59*t[e+1]+.11*t[e+2]+.5|0;t[e]=t[e+1]=t[e+2]=0,t[e+3]=n?.[r]??r}else for(let e=3,r=t.length;e<r;e+=4)t[e]=n[t[e]];u.putImageData(e,0,0)}return this.canvasFactory.destroy(s),l}beginSMaskMode(e){if(this.inSMaskMode)throw Error(`beginSMaskMode called while already in smask mode`);let{width:t,height:n}=this.ctx.canvas,r=this.canvasFactory.create(t,n);this.smaskScratchCanvas=r,this.suspendedCtx=this.ctx;let i=this.ctx=r.context;i.setTransform(this.suspendedCtx.getTransform()),gE(this.suspendedCtx,i),dE(i,this.suspendedCtx),this._ensurePreparedSMask(this.current.activeSMask),this.setGState(e,[[`BM`,`source-over`]])}endSMaskMode(){if(!this.inSMaskMode)throw Error(`endSMaskMode called while not in smask mode`);this.ctx._removeMirroring(),gE(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null,this.canvasFactory.destroy(this.smaskScratchCanvas),this.smaskScratchCanvas=null,this._clearPreparedSMask()}#p(e,t=null,n=1){let{width:r,height:i}=e,a=t??this.canvasFactory.create(r,i),o=a.context;n=Math.round(n*255)/255;let s=n<1;s&&this.#c===void 0&&(this.#c=wC.isCanvasFilterSupported?new Map:`none`);let c=`none`;if(s&&this.#c instanceof Map&&(c=this.#c.getOrInsertComputed(n,()=>this.filterFactory.addKnockoutFilter(n))),!s||c!==`none`)return t&&(o.save(),o.setTransform(1,0,0,1,0,0),o.clearRect(0,0,r,i),o.restore()),o.filter=c,o.drawImage(e,0,0),o.filter=`none`,a;let l=e.getContext(`2d`,{willReadFrequently:!0}).getImageData(0,0,r,i),u=o.createImageData(r,i),d=l.data,f=u.data,p=n>0?1/n:1e6;for(let e=3,t=d.length;e<t;e+=4)f[e]=Math.min(Math.round(d[e]*p),255);return o.putImageData(u,0,0),a}#m(e,t,n,r){let i=e?.[t]??null;if(i&&(i.canvas.width!==n||i.canvas.height!==r)&&(this.canvasFactory.destroy(i),i=null),!i)return i=this.canvasFactory.create(n,r),e&&(e[t]=i),i;let a=i.context;return a.save(),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,n,r),a.restore(),i}#h(e,t,n={}){let{backdropCanvas:r=null,destTransform:i=[1,0,0,1,0,0],backdropOffset:a=[0,0],reuseMaskEntry:o=null,poolMeta:s=null,sourceAlpha:c=1,sourceFilter:l=`none`,knockoutAlpha:u=1}=n,{width:d,height:f}=t,p=this.#p(t,o,u),m=e.globalCompositeOperation;if(e.save(),e.setTransform(...i),e.globalAlpha=1,wC.isCanvasFilterSupported&&(e.filter=`none`),e.globalCompositeOperation=`destination-out`,e.drawImage(p.canvas,0,0),r){let[t,n]=a,i=this.#m(s,`knockoutBackdropEntry`,d,f),o=i.context;o.drawImage(r,t,n,d,f,0,0,d,f),o.globalCompositeOperation=`destination-in`,o.drawImage(p.canvas,0,0),o.globalCompositeOperation=`source-over`,e.globalCompositeOperation=`destination-over`,e.drawImage(i.canvas,0,0),s||this.canvasFactory.destroy(i)}e.globalCompositeOperation=m,e.globalAlpha=c,wC.isCanvasFilterSupported&&(e.filter=l??`none`),e.drawImage(t,0,0),e.restore(),o||this.canvasFactory.destroy(p)}#g(e=1){if(this.#t===0||this.#n>0||!this.contentVisible)return!1;this.#n++,this.#s=e;let t=this.#u.at(-1),{canvas:n}=this.ctx,r=this.#m(t,`knockoutTempEntry`,n.width,n.height);this.#r=r;let i=r.context;return i.save(),i.setTransform(this.ctx.getTransform()),gE(this.ctx,i),this.#o=i.globalCompositeOperation,i.globalCompositeOperation=`source-over`,dE(i,this.ctx),this.#l=t,this.#i=this.ctx,this.#a=this.suspendedCtx,this.ctx=i,this.inSMaskMode&&(this.suspendedCtx=i),!0}#_(e){if(!e)return;let t=this.#r,n=this.#i,r=this.#a,i=t.context;this.#r=null,this.#i=null,this.#a=null,this.inSMaskMode&&this.suspendedCtx===i&&this.ctx!==i&&this.endSMaskMode(),this.inSMaskMode&&(this.suspendedCtx=r),this.ctx._removeMirroring(),this.ctx.globalCompositeOperation=this.#o,this.#o=null,gE(this.ctx,n),this.ctx=n;let a=this.#l;this.#l=null;let o=this.#s;this.#s=1;try{this.#h(r??n,t.canvas,{backdropCanvas:a?.backdropCtx?.canvas??null,backdropOffset:a?.backdropCtx?[a.offsetX,a.offsetY]:[0,0],reuseMaskEntry:a?.knockoutMaskEntry??null,poolMeta:a,knockoutAlpha:o})}finally{i.restore(),this.#n--,a||this.canvasFactory.destroy(t)}}compose(e){if(!this.current.activeSMask)return;e=e?[Math.floor(e[0]),Math.floor(e[1]),Math.ceil(e[2]),Math.ceil(e[3])]:[0,0,this.ctx.canvas.width,this.ctx.canvas.height];let t=this.current.activeSMask,n=this.suspendedCtx,r=this.#n>0&&n===this.ctx;this.composeSMask(r?null:n,t,this.ctx,e),!r&&(this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore())}composeSMask(e,t,n,r){let i=r[0],a=r[1],o=r[2]-i,s=r[3]-a;if(o===0||s===0)return;let c=this.smaskPreparedEntry;if(c){let e=i,r=a,l=o,u=s,d=this.smaskPreparedOOBAlpha,f=d!==null;if(f){e=Math.max(i,t.offsetX),r=Math.max(a,t.offsetY);let n=Math.min(i+o,t.offsetX+t.canvas.width),c=Math.min(a+s,t.offsetY+t.canvas.height);l=n-e,u=c-r}if(l>0&&u>0){let t=e-this.smaskPreparedOffsetX,i=r-this.smaskPreparedOffsetY;n.save(),n.globalAlpha=1,n.setTransform(1,0,0,1,0,0);let a=new Path2D;a.rect(e,r,l,u),n.clip(a),n.globalCompositeOperation=`destination-in`,n.drawImage(c.canvas,t,i,l,u,e,r,l,u),n.restore()}f&&d<255&&this._applySMaskOOBAlpha(n,i,a,o,s,e,r,e+l,r+u,d)}else this.genericComposeSMask(t,n,o,s,i,a);e&&(e.save(),e.globalAlpha=1,e.globalCompositeOperation=t.blendMode||`source-over`,e.setTransform(1,0,0,1,0,0),e.drawImage(n.canvas,i,a,o,s,i,a,o,s),e.restore())}_applySMaskOOBAlpha(e,t,n,r,i,a,o,s,c,l){let u=a<s&&o<c;if(u&&a===t&&o===n&&s===t+r&&c===n+i)return;let d=new Path2D;d.rect(t,n,r,i),u&&d.rect(a,o,s-a,c-o),e.save(),e.globalAlpha=l/255,e.setTransform(1,0,0,1,0,0),e.clip(d,`evenodd`),e.globalCompositeOperation=`destination-in`,e.fillStyle=`#000000`,e.fillRect(t,n,r,i),e.restore()}genericComposeSMask(e,t,n,r,i,a){let{context:o,offsetX:s,offsetY:c}=e;t.save(),t.globalAlpha=1,t.setTransform(1,0,0,1,0,0);let l=new Path2D;l.rect(i,a,n,r),t.clip(l),t.globalCompositeOperation=`destination-in`,t.drawImage(o.canvas,i-s,a-c,n,r,i,a,n,r),t.restore()}save(e){this.inSMaskMode&&gE(this.ctx,this.suspendedCtx),this.ctx.save();let t=this.current;this.stateStack.push(t),this.current=t.clone(),this.dependencyTracker?.save(e)}restore(e){if(this.dependencyTracker?.restore(e),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&(gE(this.suspendedCtx,this.ctx),this.ctx.setTransform(this.suspendedCtx.getTransform())),this.checkSMaskState(e),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,t,n,r,i,a,o){this.dependencyTracker?.recordIncrementalData(`transform`,e),this.ctx.transform(t,n,r,i,a,o),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,t,n,r){let[i]=n;if(!r){i||=n[0]=new Path2D,t!==eC.stroke&&t!==eC.closeStroke&&(this.current.tilingPatternDims=null),this[t](e,i);return}if(this.dependencyTracker!==null){let n=t===eC.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,r[0]-n,r[2]+n,r[1]-n,r[3]+n).recordDependencies(e,[`transform`])}i instanceof Path2D||(i=n[0]=vw(i)),TC.axialAlignedBoundingBox(r,rw(this.ctx),this.current.minMax);let a=this.current.tilingPatternDims;if(a&&t!==eC.stroke&&t!==eC.closeStroke&&this.current.fillColor instanceof iE){let e=TC.intersect(this.current.clipBox,this.current.minMax);e?this.current.fillColor.updatePatternDims(e,a):this.current.tilingPatternDims=null}this[t](e,i),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,t,n=!0){let r=n&&this.#g(this.current.strokeAlpha),i=this.ctx,a=this.current.strokeColor;if(i.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof a==`object`&&a?.getPattern){let n=a.isModifyingCurrentTransform()?i.getTransform():null;if(i.save(),i.strokeStyle=a.getPattern(i,this,iw(i),YT.STROKE,e),n){let e=new Path2D;e.addPath(t,i.getTransform().invertSelf().multiplySelf(n)),t=e}this.rescaleAndStroke(t,!1),i.restore()}else this.rescaleAndStroke(t,!0);this.dependencyTracker?.recordDependencies(e,nT.stroke),n&&this.consumePath(e,t,this.current.getClippedPathBoundingBox(YT.STROKE,rw(this.ctx))),i.globalAlpha=this.current.fillAlpha,this.#_(r)}closeStroke(e,t){this.stroke(e,t)}fill(e,t,n=!0){let r=n&&this.#g(this.current.fillAlpha),i=this.ctx,a=this.current.fillColor,o=this.current.patternFill,s=!1,c=this.current.getClippedPathBoundingBox();if(this.dependencyTracker?.recordDependencies(e,nT.fill),o){let o=this.current.tilingPatternDims,l=o&&a.canSkipPatternCanvas(o);if(l){a.drawPattern(this,t,this.pendingEOFill,l,e),this.pendingEOFill=!1,n&&this.consumePath(e,t,c),this.current.tilingPatternDims=null,this.#_(r);return}let u=a.isModifyingCurrentTransform()?i.getTransform():null;if(this.dependencyTracker?.save(e),i.save(),i.fillStyle=a.getPattern(i,this,iw(i),YT.FILL,e),u){let e=new Path2D;e.addPath(t,i.getTransform().invertSelf().multiplySelf(u)),t=e}s=!0}this.contentVisible&&c!==null&&(this.pendingEOFill?(i.fill(t,`evenodd`),this.pendingEOFill=!1):i.fill(t)),s&&(i.restore(),this.dependencyTracker?.restore(e)),n&&this.consumePath(e,t,c),this.#_(r)}eoFill(e,t){this.pendingEOFill=!0,this.fill(e,t)}fillStroke(e,t){let n=this.#g(Math.min(this.current.fillAlpha,this.current.strokeAlpha));this.fill(e,t,!1),this.stroke(e,t,!1),this.consumePath(e,t),this.#_(n)}eoFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}closeFillStroke(e,t){this.fillStroke(e,t)}closeEOFillStroke(e,t){this.pendingEOFill=!0,this.fillStroke(e,t)}endPath(e,t){this.consumePath(e,t)}rawFillPath(e,t){let n=this.#g(this.current.fillAlpha);this.ctx.fill(t),this.dependencyTracker?.recordDependencies(e,nT.rawFillPath).recordOperation(e),this.#_(n)}clip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=xE}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency(`clipMode`,e),this.pendingClip=SE}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData(`sameLineText`).resetIncrementalData(`moveText`,e)}endText(e){let t=this.pendingTextPaths,n=this.ctx;if(this.dependencyTracker){let{dependencyTracker:n}=this;t!==void 0&&n.recordFutureForcedDependency(`textClip`,n.getOpenMarker()).recordFutureForcedDependency(`textClip`,e),n.recordCloseMarker(e)}if(t!==void 0){let e=new Path2D,r=n.getTransform().invertSelf();for(let{transform:n,x:i,y:a,fontSize:o,path:s}of t)s&&e.addPath(s,new DOMMatrix(n).preMultiplySelf(r).translate(i,a).scale(o,-o));n.clip(e)}delete this.pendingTextPaths}setCharSpacing(e,t){this.dependencyTracker?.recordSimpleData(`charSpacing`,e),this.current.charSpacing=t}setWordSpacing(e,t){this.dependencyTracker?.recordSimpleData(`wordSpacing`,e),this.current.wordSpacing=t}setHScale(e,t){this.dependencyTracker?.recordSimpleData(`hScale`,e),this.current.textHScale=t/100}setLeading(e,t){this.dependencyTracker?.recordSimpleData(`leading`,e),this.current.leading=-t}setFont(e,t,n){this.dependencyTracker?.recordSimpleData(`font`,e).recordSimpleDataFromNamed(`fontObj`,t,e);let r=this.commonObjs.get(t),i=this.current;if(!r)throw Error(`Can't find font for ${t}`);if(i.fontMatrix=r.fontMatrix||BS,(i.fontMatrix[0]===0||i.fontMatrix[3]===0)&&sC(`Invalid font matrix for font `+t),n<0?(n=-n,i.fontDirection=-1):i.fontDirection=1,this.current.font=r,this.current.fontSize=n,r.isType3Font)return;let a=r.loadedName||`sans-serif`,o=r.systemFontInfo?.css||`"${a}", ${r.fallbackName}`,s=`normal`;r.black?s=`900`:r.bold&&(s=`bold`);let c=r.italic?`italic`:`normal`,l=IC(n,aE,oE);this.current.fontSizeScale=n/l,this.ctx.font=`${c} ${s} ${l}px ${o}`}setTextRenderingMode(e,t){this.dependencyTracker?.recordSimpleData(`textRenderingMode`,e),this.current.textRenderingMode=t}setTextRise(e,t){this.dependencyTracker?.recordSimpleData(`textRise`,e),this.current.textRise=t}moveText(e,t,n){this.dependencyTracker?.resetIncrementalData(`sameLineText`).recordIncrementalData(`moveText`,e),this.current.x=this.current.lineX+=t,this.current.y=this.current.lineY+=n}setLeadingMoveText(e,t,n){this.setLeading(e,-n),this.moveText(e,t,n)}setTextMatrix(e,t){this.dependencyTracker?.resetIncrementalData(`sameLineText`).recordSimpleData(`textMatrix`,e);let{current:n}=this;n.textMatrix=t,n.textMatrixScale=Math.hypot(t[0],t[1]),n.x=n.lineX=0,n.y=n.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData(`moveText`,this.dependencyTracker.getSimpleIndex(`leading`)??e)}#v(e,t,n){let r=new Path2D;return r.addPath(e,new DOMMatrix(n).invertSelf().multiplySelf(t)),r}paintChar(e,t,n,r,i,a){let o=this.ctx,s=this.current,c=s.font,l=s.textRenderingMode,u=s.fontSize/s.fontSizeScale,d=l&YS.FILL_STROKE_MASK,f=!!(l&YS.ADD_TO_PATH_FLAG),p=s.patternFill&&!c.missingFile,m=s.patternStroke&&!c.missingFile,h;if((c.disableFontFace||f||p||m)&&!c.missingFile&&(h=c.getPathGenerator(this.commonObjs,t)),h&&(c.disableFontFace||p||m)){o.save(),o.translate(n,r),o.scale(u,-u),this.dependencyTracker?.recordCharacterBBox(e,o,c);let t;if(d===YS.FILL||d===YS.FILL_STROKE)if(i){t=o.getTransform(),o.setTransform(...i);let e=this.#v(h,t,i);o.fill(e)}else o.fill(h);if(d===YS.STROKE||d===YS.FILL_STROKE)if(a){t||=o.getTransform(),o.setTransform(...a);let{a:e,b:n,c:r,d:i}=t,s=TC.inverseTransform(a),c=TC.transform([e,n,r,i,0,0],s);TC.singularValueDecompose2dScale(c,uE),o.lineWidth*=Math.max(uE[0],uE[1])/u,o.stroke(this.#v(h,t,a))}else o.lineWidth/=u,o.stroke(h);o.restore()}else (d===YS.FILL||d===YS.FILL_STROKE)&&(o.fillText(t,n,r),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t))),(d===YS.STROKE||d===YS.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r,()=>o.measureText(t)).recordDependencies(e,nT.stroke),o.strokeText(t,n,r));f&&((this.pendingTextPaths||=[]).push({transform:rw(o),x:n,y:r,fontSize:u,path:h}),this.dependencyTracker?.recordCharacterBBox(e,o,c,u,n,r))}get isFontSubpixelAAEnabled(){let e=this.canvasFactory.create(10,10),t=e.context;t.scale(1.5,1),t.fillText(`I`,0,10);let n=t.getImageData(0,0,10,10).data;this.canvasFactory.destroy(e);let r=!1;for(let e=3;e<n.length;e+=4)if(n[e]>0&&n[e]<255){r=!0;break}return mC(this,`isFontSubpixelAAEnabled`,r)}showText(e,t){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,nT.showText).resetBBox(e),this.current.textRenderingMode&YS.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency(`textClip`,e).inheritPendingDependenciesAsFutureForcedDependencies());let n=this.current,r=n.font;if(r.isType3Font){let r=this.#g(n.fillAlpha);this.showType3Text(e,t),this.dependencyTracker?.recordShowTextOperation(e),this.#_(r);return}let i=n.fontSize;if(i===0){this.dependencyTracker?.recordOperation(e);return}let a=this.#g(n.fillAlpha),o=this.ctx,s=n.fontSizeScale,c=n.charSpacing,l=n.wordSpacing,u=n.fontDirection,d=n.textHScale*u,f=t.length,p=r.vertical,m=p?1:-1,h=r.defaultVMetrics,g=i*n.fontMatrix[0],_=n.textRenderingMode===YS.FILL&&!r.disableFontFace&&!n.patternFill;o.save(),n.textMatrix&&o.transform(...n.textMatrix),o.translate(n.x,n.y+n.textRise),u>0?o.scale(d,-1):o.scale(d,1);let v,y,b=n.textRenderingMode&YS.FILL_STROKE_MASK,x=b===YS.FILL||b===YS.FILL_STROKE,S=b===YS.STROKE||b===YS.FILL_STROKE,C=n.lineWidth,w=n.textMatrixScale;if(w===0||C===0?S&&(C=this.getSinglePixelWidth()):C/=w,s!==1&&(o.scale(s,s),C/=s),o.lineWidth=C,x&&n.patternFill){o.save();let t=n.fillColor.getPattern(o,this,iw(o),YT.FILL,e);v=rw(o),o.restore(),o.fillStyle=t}if(S&&n.patternStroke){o.save();let t=n.strokeColor.getPattern(o,this,iw(o),YT.STROKE,e);y=rw(o),o.restore(),o.strokeStyle=t}if(r.isInvalidPDFjsFont){let r=[],i=0;for(let e of t)r.push(e.unicode),i+=e.width;let s=r.join(``);if(o.fillText(s,0,0),this.dependencyTracker!==null){let t=o.measureText(s);this.dependencyTracker.recordBBox(e,this.ctx,-t.actualBoundingBoxLeft,t.actualBoundingBoxRight,-t.actualBoundingBoxAscent,t.actualBoundingBoxDescent).recordShowTextOperation(e)}n.x+=i*g*d,o.restore(),this.compose(),this.#_(a);return}let T=0,E;for(E=0;E<f;++E){let n=t[E];if(typeof n==`number`){T+=m*n*i/1e3;continue}let a=!1,d=(n.isSpace?l:0)+c,f=n.fontChar,b=n.accent,x,S,C=n.width;if(p){let e=n.vmetric||h,t=-(n.vmetric?e[1]:C*.5)*g,r=e[2]*g;C=e?-e[0]:C,x=t/s,S=(T+r)/s}else x=T/s,S=0;let w;if(r.remeasure&&C>0){w=o.measureText(f);let e=w.width*1e3/i*s;if(C<e&&this.isFontSubpixelAAEnabled){let t=C/e;a=!0,o.save(),o.scale(t,1),x/=t}else C!==e&&(x+=(C-e)/2e3*i/s)}if(this.contentVisible&&(n.isInFont||r.missingFile)){if(_&&!b)o.fillText(f,x,S),this.dependencyTracker?.recordCharacterBBox(e,o,w?{bbox:null}:r,i/s,x,S,()=>w??o.measureText(f));else if(this.paintChar(e,f,x,S,v,y),b){let t=x+i*b.offset.x/s,n=S-i*b.offset.y/s;this.paintChar(e,b.fontChar,t,n,v,y)}}let D=p?C*g-d*u:C*g+d*u;T+=D,a&&o.restore()}p?n.y-=T:n.x+=T*d,o.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e),this.#_(a)}showType3Text(e,t){let n=this.ctx,r=this.current,i=r.font,a=r.fontSize,o=r.fontDirection,s=i.vertical?1:-1,c=r.charSpacing,l=r.wordSpacing,u=r.textHScale*o,d=r.fontMatrix||BS,f=t.length,p=r.textRenderingMode===YS.INVISIBLE,m,h,g,_;if(p||a===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,n.save(),r.textMatrix&&n.transform(...r.textMatrix),n.translate(r.x,r.y+r.textRise),n.scale(u,o);let v=this.dependencyTracker;for(this.dependencyTracker=v?new tT(v,e):null,m=0;m<f;++m){if(h=t[m],typeof h==`number`){_=s*h*a/1e3,this.ctx.translate(_,0),r.x+=_*u;continue}let e=(h.isSpace?l:0)+c,o=i.charProcOperatorList.get(h.operatorListId);o?this.contentVisible&&(this.save(),o.fnArray[0]===eC.setCharWidth&&(r.fillAlpha=r.strokeAlpha=1,n.globalAlpha=1),n.scale(a,a),n.transform(...d),this.executeOperatorList(o),this.restore()):sC(`Type3 character "${h.operatorListId}" is not available.`);let f=[h.width,0];TC.applyTransform(f,d),g=f[0]*a+e,n.translate(g,0),r.x+=g*u}n.restore(),v&&(this.dependencyTracker=v)}setCharWidth(e,t,n){}setCharWidthAndBounds(e,t,n,r,i,a,o){let s=new Path2D;s.rect(r,i,a-r,o-i),this.ctx.clip(s),this.dependencyTracker?.recordBBox(e,this.ctx,r,a,i,o).recordClipBox(e,this.ctx,r,a,i,o),this.endPath(e)}getColorN_Pattern(t,n){let r;if(n[0]===`TilingPattern`){let t=this.baseTransform||rw(this.ctx);r=new iE(n,this.ctx,{createCanvasGraphics:(t,n)=>new e(t,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new tT(this.dependencyTracker,n,!0):null)},t)}else r=this._getPattern(t,n[1],n[2]);return r}setStrokeColorN(e,...t){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.current.strokeColor=this.getColorN_Pattern(e,t),this.current.patternStroke=!0}setFillColorN(e,...t){this.dependencyTracker?.recordSimpleData(`fillColor`,e);let n=this.current.fillColor=this.getColorN_Pattern(e,t);this.current.patternFill=!0,this.current.tilingPatternDims=n instanceof iE?[0,0,0,0]:null}setStrokeRGBColor(e,t){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.ctx.strokeStyle=this.current.strokeColor=t,this.current.patternStroke=!1}setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData(`strokeColor`,e),this.ctx.strokeStyle=this.current.strokeColor=`transparent`,this.current.patternStroke=!1}setFillRGBColor(e,t){this.dependencyTracker?.recordSimpleData(`fillColor`,e),this.ctx.fillStyle=this.current.fillColor=t,this.current.patternFill=!1,this.current.tilingPatternDims=null}setFillTransparent(e){this.dependencyTracker?.recordSimpleData(`fillColor`,e),this.ctx.fillStyle=this.current.fillColor=`transparent`,this.current.patternFill=!1,this.current.tilingPatternDims=null}_getPattern(e,t,n=null){let r=this.cachedPatterns.getOrInsertComputed(t,()=>nE(this.getObject(e,t)));return n&&(r.matrix=n),r}shadingFill(e,t){if(!this.contentVisible)return;let n=this.#g(this.current.fillAlpha),r=this.ctx;this.save(e),r.fillStyle=this._getPattern(e,t).getPattern(r,this,iw(r),YT.SHADING,e);let i=iw(r);if(i){let{width:e,height:t}=r.canvas,n=zS.slice();TC.axialAlignedBoundingBox([0,0,e,t],i,n);let[a,o,s,c]=n;this.ctx.fillRect(a,o,s-a,c-o)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,nT.transform).recordDependencies(e,nT.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e),this.#_(n)}beginInlineImage(){cC(`Should not call beginInlineImage`)}beginImageData(){cC(`Should not call beginImageData`)}paintFormXObjectBegin(e,t,n){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),t&&this.transform(e,...t),this.baseTransform=rw(this.ctx),n)){TC.axialAlignedBoundingBox(n,this.baseTransform,this.current.minMax);let[t,r,i,a]=n,o=new Path2D;o.rect(t,r,i-t,a-r),this.ctx.clip(o),this.dependencyTracker?.recordClipBox(e,this.ctx,t,i,r,a),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,t){if(!this.contentVisible)return;this.save(e);let{inSMaskMode:n}=this;n&&(this.endSMaskMode(),this.current.activeSMask=null);let r=this.ctx;if((!t.needsIsolation||!t.isolated&&!t.hasSoftMask)&&!t.knockout&&!t.isGray&&this.#t===0&&r.globalAlpha===1&&r.globalCompositeOperation===`source-over`&&!n){if(t.bbox){let e=new Path2D,[n,i,a,o]=t.bbox;if(e.rect(n,i,a-n,o-i),t.matrix){let n=new Path2D;n.addPath(e,new DOMMatrix(t.matrix)),e=n}r.clip(e)}this.groupStack.push(null),this.#u.push(null),this.groupLevel++;return}!t.isolated&&!t.knockout&&this.#t===0&&oC(`TODO: Fully support non-isolated non-knockout groups.`);let i=rw(r);t.matrix&&r.transform(...t.matrix);let a=[0,0,r.canvas.width,r.canvas.height],o;t.bbox?(o=zS.slice(),TC.axialAlignedBoundingBox(t.bbox,rw(r),o),o=TC.intersect(o,a)||[0,0,0,0]):o=a;let s=Math.floor(o[0]),c=Math.floor(o[1]),l=Math.max(Math.ceil(o[2])-s,1),u=Math.max(Math.ceil(o[3])-c,1);this.current.startNewPathAndClipBox([0,0,l,u]);let d=this.canvasFactory.create(l,u);t.smask&&this.smaskGroupCanvases.push(d);let f=d.context,p=t.knockout&&!t.isolated?r:null,m=!t.isolated&&!t.knockout&&!t.smask&&t.needsIsolation&&this.#t>0,h=t.knockout?this.canvasFactory.create(l,u):null,g=this.#t;t.knockout?this.#t++:this.#t=0,f.translate(-s,-c),f.transform(...i);let _=!t.isolated&&!t.smask&&t.needsIsolation,v=_&&!n&&g===0&&!t.knockout&&!t.isGray&&t.hasSoftMask&&r.globalAlpha===1&&r.globalCompositeOperation===`source-over`&&this.current.transferMaps===`none`;if(_&&(n||v)&&(f.save(),f.setTransform(1,0,0,1,0,0),f.drawImage(r.canvas,-s,-c),f.restore()),t.bbox){let e=new Path2D,[n,r,i,a]=t.bbox;if(e.rect(n,r,i-n,a-r),t.matrix){let n=new Path2D;n.addPath(e,new DOMMatrix(t.matrix)),e=n}f.clip(e)}t.smask&&this.smaskStack.push({canvas:d.canvas,context:f,offsetX:s,offsetY:c,subtype:t.smask.subtype,backdrop:t.smask.backdrop,transferMap:t.smask.transferMap||null}),(!t.smask||this.dependencyTracker)&&(r.setTransform(1,0,0,1,0,0),r.translate(s,c),r.save()),gE(r,f),this.ctx=f,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies([`fillAlpha`,`strokeAlpha`,`globalCompositeOperation`]).pushBaseTransform(r),this.setGState(e,[[`BM`,`source-over`],[`ca`,1],[`CA`,1],[`TR`,null]]),this.groupStack.push(r),this.#u.push({backdropCtx:p,savedKnockoutLevel:g,offsetX:s,offsetY:c,hasInnerBackdrop:m,replaceBackdrop:v,knockoutMaskEntry:h,knockoutTempEntry:null,knockoutBackdropEntry:null}),this.groupLevel++}endGroup(e,t){if(!this.contentVisible)return;this.groupLevel--;let n=this.ctx,r=this.groupStack.pop(),i=this.#u.pop();if(i&&(this.#t=i.savedKnockoutLevel),r===null){this.restore(e);return}if(t.isGray&&this.#y(n),this.ctx=r,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),t.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&(this.ctx.restore(),this.inSMaskMode&&this.ctx.setTransform(this.suspendedCtx.getTransform())),this.#b(i);else{this.ctx.restore();let t=rw(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...t);let a=zS.slice();TC.axialAlignedBoundingBox([0,0,n.canvas.width,n.canvas.height],t,a);let o=this.#u.at(-1);if(this.#t>0)if(i.hasInnerBackdrop){let{width:e,height:a}=n.canvas,o=this.canvasFactory.create(e,a),s=o.context;s.drawImage(r.canvas,i.offsetX,i.offsetY,e,a,0,0,e,a),s.globalCompositeOperation=`source-over`,s.drawImage(n.canvas,0,0);let c=this.#p(n.canvas);s.globalCompositeOperation=`destination-in`,s.drawImage(c.canvas,0,0);let l=this.ctx.globalCompositeOperation,u=this.ctx.globalAlpha,d=this.ctx.filter;this.ctx.save(),this.ctx.setTransform(...t),this.ctx.globalAlpha=1,wC.isCanvasFilterSupported&&(this.ctx.filter=`none`),this.ctx.globalCompositeOperation=`destination-out`,this.ctx.drawImage(c.canvas,0,0),this.ctx.globalCompositeOperation=l,this.ctx.globalAlpha=u,wC.isCanvasFilterSupported&&(this.ctx.filter=d??`none`),this.ctx.drawImage(o.canvas,0,0),this.ctx.restore(),this.canvasFactory.destroy(c),this.canvasFactory.destroy(o)}else{let e=o?.backdropCtx??null;this.#h(this.ctx,n.canvas,{backdropCanvas:e?.canvas??null,destTransform:t,backdropOffset:e?[o.offsetX+i.offsetX,o.offsetY+i.offsetY]:[0,0],sourceAlpha:this.ctx.globalAlpha,sourceFilter:this.ctx.filter})}else{if(i.replaceBackdrop){let e=new Path2D;e.rect(0,0,n.canvas.width,n.canvas.height),this.ctx.clip(e),this.ctx.globalCompositeOperation=`copy`}this.ctx.drawImage(n.canvas,0,0)}this.ctx.restore(),this.canvasFactory.destroy({canvas:n.canvas,context:n}),this.#b(i),this.compose(a)}}#y(e){let{canvas:t}=e,{width:n,height:r}=t;if(wC.isCanvasFilterSupported){e.save(),e.setTransform(1,0,0,1,0,0),e.filter=`grayscale(1)`,e.globalAlpha=1,e.globalCompositeOperation=`copy`,e.drawImage(t,0,0),e.restore();return}let i=e.getImageData(0,0,n,r),{data:a}=i;for(let e=0,t=a.length;e<t;e+=4){let t=a[e]*.2126+a[e+1]*.7152+a[e+2]*.0722+.5|0;a[e]=a[e+1]=a[e+2]=t}e.putImageData(i,0,0)}#b(e){e&&(e.knockoutMaskEntry&&=(this.canvasFactory.destroy(e.knockoutMaskEntry),null),e.knockoutTempEntry&&=(this.canvasFactory.destroy(e.knockoutTempEntry),null),e.knockoutBackdropEntry&&=(this.canvasFactory.destroy(e.knockoutBackdropEntry),null))}beginAnnotation(e,t,n,r,i,a,o){if(this.#d(),_E(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),n){let i=n[2]-n[0],s=n[3]-n[1];if(a&&this.annotationCanvasMap){r=r.slice(),r[4]-=n[0],r[5]-=n[1],TC.singularValueDecompose2dScale(rw(this.ctx),uE);let{viewportScale:e}=this,a=Math.ceil(i*this.outputScaleX*e),c=Math.ceil(s*this.outputScaleY*e);this.annotationCanvas=this.canvasFactory.create(a,c);let{canvas:l,context:u}=this.annotationCanvas;if(o){let e=this.annotationCanvasMap.getOrInsertComputed(t,MC);l.setAttribute(`data-canvas-name`,o);let n=e.findIndex(e=>e.getAttribute(`data-canvas-name`)===o);n===-1?e.push(l):e[n]=l}else this.annotationCanvasMap.set(t,l);this.annotationCanvas.savedCtx=this.ctx,this.ctx=u,this.ctx.save(),this.ctx.setTransform(uE[0],0,0,-uE[1],0,s*uE[1]),_E(this.ctx)}else{_E(this.ctx),this.endPath(e);let t=new Path2D;t.rect(n[0],n[1],i,s),this.ctx.clip(t)}}this.current=new pE(this.ctx.canvas.width,this.ctx.canvas.height),this.baseTransformStack.push(this.baseTransform),this.transform(e,...r),this.transform(e,...i),this.baseTransform=rw(this.ctx)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#f(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas),this.baseTransform=this.baseTransformStack.pop()}paintImageMaskXObject(e,t){if(!this.contentVisible)return;let n=t.count;t=this.getObject(e,t.data,t),t.count=n;let r=this.#g(this.current.fillAlpha),i=this.ctx,a=this._createMaskCanvas(e,t),o=a.canvas;i.save(),i.setTransform(1,0,0,1,0,0),i.drawImage(o,a.offsetX,a.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,a.offsetX,a.offsetX+o.width,a.offsetY,a.offsetY+o.height).recordOperation(e),i.restore(),a.canvasEntry&&this.canvasFactory.destroy(a.canvasEntry),this.compose(),this.#_(r)}paintImageMaskXObjectRepeat(e,t,n,r=0,i=0,a,o){if(!this.contentVisible)return;t=this.getObject(e,t.data,t);let s=this.#g(this.current.fillAlpha),c=this.ctx;c.save();let l=rw(c);c.transform(n,r,i,a,0,0);let u=this._createMaskCanvas(e,t);c.setTransform(1,0,0,1,u.offsetX-l[4],u.offsetY-l[5]),this.dependencyTracker?.resetBBox(e);for(let t=0,s=o.length;t<s;t+=2){let s=TC.transform(l,[n,r,i,a,o[t],o[t+1]]);c.drawImage(u.canvas,s[4],s[5]),this.dependencyTracker?.recordBBox(e,this.ctx,s[4],s[4]+u.canvas.width,s[5],s[5]+u.canvas.height)}c.restore(),u.canvasEntry&&this.canvasFactory.destroy(u.canvasEntry),this.compose(),this.dependencyTracker?.recordOperation(e),this.#_(s)}paintImageMaskXObjectGroup(e,t){if(!this.contentVisible)return;let n=this.#g(this.current.fillAlpha),r=this.ctx,i=this.current.fillColor,a=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,nT.transformAndFill);for(let n of t){let{data:t,width:o,height:s,transform:c}=n,l=this.canvasFactory.create(o,s),u=l.context;u.save(),hE(u,this.getObject(e,t,n)),u.globalCompositeOperation=`source-in`,u.fillStyle=a?i.getPattern(u,this,iw(r),YT.FILL,e):i,u.fillRect(0,0,o,s),u.restore(),r.save(),r.transform(...c),r.scale(1,-1),fE(r,l.canvas,0,0,o,s,0,-1,1,1),this.canvasFactory.destroy(l),this.dependencyTracker?.recordBBox(e,r,0,o,0,s),r.restore()}this.compose(),this.dependencyTracker?.recordOperation(e),this.#_(n)}paintImageXObject(e,t){if(!this.contentVisible)return;let n=this.getObject(e,t);if(!n){sC(`Dependent image isn't ready yet`);return}this.paintInlineImageXObject(e,n)}paintImageXObjectRepeat(e,t,n,r,i){if(!this.contentVisible)return;let a=this.getObject(e,t);if(!a){sC(`Dependent image isn't ready yet`);return}let o=a.width,s=a.height,c=[];for(let e=0,t=i.length;e<t;e+=2)c.push({transform:[n,0,0,r,i[e],i[e+1]],x:0,y:0,w:o,h:s});this.paintInlineImageXObjectGroup(e,a,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!==`none`&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter=`none`),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps===`none`)return{img:e.bitmap,canvasEntry:null};let{bitmap:t,width:n,height:r}=e,i=this.canvasFactory.create(n,r),a=i.context;return a.filter=this.current.transferMaps,a.drawImage(t,0,0),a.filter=`none`,{img:i.canvas,canvasEntry:i}}paintInlineImageXObject(e,t){if(!this.contentVisible)return;let n=t.width,r=t.height,i=this.#g(this.current.fillAlpha),a=this.ctx;this.save(e);let{filter:o}=a;o!==`none`&&o!==``&&(a.filter=`none`),a.scale(1/n,-1/r);let s,c=null;if(t.bitmap){let e=this.applyTransferMapsToBitmap(t);s=e.img,c=e.canvasEntry}else{let e=this.canvasFactory.create(n,r);mE(e.context,t),s=this.applyTransferMapsToCanvas(e.context),c=e}let l=this._scaleImage(s,iw(a));a.imageSmoothingEnabled=vE(rw(a),t.interpolate),this.dependencyTracker&&(this.dependencyTracker.resetBBox(e).recordBBox(e,a,0,n,-r,0).recordDependencies(e,nT.imageXObject).recordOperation(e),this.imagesTracker?.record(a,n,r,this.dependencyTracker.clipBox)),fE(a,l.img,0,0,l.paintWidth,l.paintHeight,0,-r,n,r),l.tmpCanvas&&this.canvasFactory.destroy(l.tmpCanvas),c&&this.canvasFactory.destroy(c),this.compose(),this.restore(e),this.#_(i)}paintInlineImageXObjectGroup(e,t,n){if(!this.contentVisible)return;let r=this.#g(this.current.fillAlpha),i=this.ctx,a,o=null;if(t.bitmap)a=t.bitmap;else{let e=t.width,n=t.height,r=this.canvasFactory.create(e,n);mE(r.context,t),a=this.applyTransferMapsToCanvas(r.context),o=r}this.dependencyTracker?.resetBBox(e);for(let t of n)i.save(),i.transform(...t.transform),i.scale(1,-1),fE(i,a,t.x,t.y,t.w,t.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,i,0,1,-1,0),i.restore();o&&this.canvasFactory.destroy(o),this.dependencyTracker?.recordOperation(e),this.compose(),this.#_(r)}paintSolidColorImageMask(e){if(!this.contentVisible)return;let t=this.#g(this.current.fillAlpha);this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,nT.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose(),this.#_(t)}markPoint(e,t){}markPointProps(e,t,n){}beginMarkedContent(e,t){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,t,n){this.dependencyTracker?.beginMarkedContent(e),t===`OC`?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(n)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,t,n){let r=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(n);let i=this.ctx;this.pendingClip?(r||(this.pendingClip===SE?i.clip(t,`evenodd`):i.clip(t)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency(`clipPath`,e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){let e=rw(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{let t=Math.abs(e[0]*e[3]-e[2]*e[1]),n=Math.hypot(e[0],e[2]),r=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(n,r)/t}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){let{lineWidth:e}=this.current,{a:t,b:n,c:r,d:i}=this.ctx.getTransform(),a,o;if(n===0&&r===0){let n=Math.abs(t),r=Math.abs(i);if(n===r)if(e===0)a=o=1/n;else{let t=n*e;a=o=t<1?1/t:1}else if(e===0)a=1/n,o=1/r;else{let t=n*e,i=r*e;a=t<1?1/t:1,o=i<1?1/i:1}}else{let s=Math.abs(t*i-n*r),c=Math.hypot(t,n),l=Math.hypot(r,i);if(e===0)a=l/s,o=c/s;else{let t=e*s;a=l>t?l/t:1,o=c>t?c/t:1}}this._cachedScaleForStroking[0]=a,this._cachedScaleForStroking[1]=o}return this._cachedScaleForStroking}rescaleAndStroke(t,n){let{ctx:r,current:{lineWidth:i}}=this,[a,o]=this.getScaleForStroking();if(a===o){r.lineWidth=(i||1)*a,r.stroke(t);return}let s=e.#e??=new DOMMatrix,c=r.getLineDash();n&&r.save(),r.scale(a,o),s.a=1/a,s.d=1/o;let l=new Path2D;if(l.addPath(t,s),c.length>0){let e=Math.max(a,o);r.setLineDash(c.map(t=>t/e)),r.lineDashOffset/=e}r.lineWidth=i||1,r.stroke(l),n&&r.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}};for(let e in eC)CE.prototype[e]!==void 0&&(CE.prototype[eC[e]]=CE.prototype[e]);var wE=class{#e=null;#t=null;_fullReader=null;_rangeReaders=new Set;_source=null;constructor(e,t,n){this._source=e,this.#e=t,this.#t=n}get _progressiveDataLength(){return this._fullReader?._loaded??0}getFullReader(){return lC(!this._fullReader,`BasePDFStream.getFullReader can only be called once.`),this._fullReader=new this.#e(this)}getRangeReader(e,t){if(t<=this._progressiveDataLength)return null;let n=new this.#t(this,e,t);return this._rangeReaders.add(n),n}cancelAllRequests(e){this._fullReader?.cancel(e);for(let t of new Set(this._rangeReaders))t.cancel(e)}},TE=class{onProgress=null;_contentLength=0;_filename=null;_headersCapability=Promise.withResolvers();_isRangeSupported=!1;_isStreamingSupported=!1;_loaded=0;_stream=null;constructor(e){this._stream=e}_callOnProgress(){this.onProgress?.({loaded:this._loaded,total:this._contentLength})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){cC("Abstract method `read` called")}cancel(e){cC("Abstract method `cancel` called")}},EE=class{_stream=null;constructor(e,t,n){this._stream=e}async read(){cC("Abstract method `read` called")}cancel(e){cC("Abstract method `cancel` called")}};function DE(e){let t=!0,n=r(`filename\\*`,`i`).exec(e);if(n){n=n[1];let e=s(n);return e=unescape(e),e=c(e),e=l(e),a(e)}if(n=o(e),n)return a(l(n));if(n=r(`filename`,`i`).exec(e),n){n=n[1];let e=s(n);return e=l(e),a(e)}function r(e,t){return RegExp(`(?:^|;)\\s*`+e+`\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)`,t)}function i(e,n){if(e){if(!/^[\x00-\xFF]+$/.test(n))return n;try{let r=new TextDecoder(e,{fatal:!0}),i=CC(n);n=r.decode(i),t=!1}catch{}}return n}function a(e){return t&&/[\x80-\xff]/.test(e)&&(e=i(`utf-8`,e),t&&(e=i(`iso-8859-1`,e))),e}function o(e){let t=[],n,i=r(`filename\\*((?!0\\d)\\d+)(\\*?)`,`ig`);for(;(n=i.exec(e))!==null;){let[,e,r,i]=n;if(e=parseInt(e,10),e in t){if(e===0)break;continue}t[e]=[r,i]}let a=[];for(let e=0;e<t.length&&e in t;++e){let[n,r]=t[e];r=s(r),n&&(r=unescape(r),e===0&&(r=c(r))),a.push(r)}return a.join(``)}function s(e){if(e.startsWith(`"`)){let t=e.slice(1).split(`\\"`);for(let e=0;e<t.length;++e){let n=t[e].indexOf(`"`);n!==-1&&(t[e]=t[e].slice(0,n),t.length=e+1),t[e]=t[e].replaceAll(/\\(.)/g,`$1`)}e=t.join(`"`)}return e}function c(e){let t=e.indexOf(`'`);return t===-1?e:i(e.slice(0,t),e.slice(t+1).replace(/^[^']*'/,``))}function l(e){return!e.startsWith(`=?`)||/[\x00-\x19\x80-\xff]/.test(e)?e:e.replaceAll(/=\?([\w-]*)\?([QB])\?((?:[^?]|\?(?!=))*)\?=/gi,function(e,t,n,r){if(n===`q`||n===`Q`)return r=r.replaceAll(`_`,` `),r=r.replaceAll(/=([0-9a-f]{2})/gi,function(e,t){return String.fromCharCode(parseInt(t,16))}),i(t,r);try{r=atob(r)}catch{}return i(t,r)})}return``}function OE(e,t){let n=new Headers;if(!e||!t||typeof t!=`object`)return n;for(let e in t){let r=t[e];r!==void 0&&n.append(e,r)}return n}function kE(e){let t=e.length;for(;t>0&&e[t-1]!==` `&&/\s/.test(e[t-1]);)t--;return e.slice(0,t)}function AE(e){return URL.parse(e)?.origin??null}function jE({responseHeaders:e,isHttp:t,rangeChunkSize:n,disableRange:r}){let i={contentLength:0,isRangeSupported:!1},a=parseInt(e.get(`Content-Length`),10);return!Number.isInteger(a)||(i.contentLength=a,a<=2*n)||r||!t||e.get(`Accept-Ranges`)!==`bytes`||(e.get(`Content-Encoding`)||`identity`)===`identity`&&(i.isRangeSupported=!0),i}function ME(e){let t=e.get(`Content-Disposition`);if(t){let e=DE(t);if(e.includes(`%`))try{e=decodeURIComponent(e)}catch{}if(KC(e))return e}return null}function NE(e,t){return new yC(`Unexpected server response (${e}) while retrieving PDF "${t.href}".`,e,e===404||e===0&&t.protocol===`file:`)}function PE(e,t){if(e!==t)throw Error(`Expected range response-origin "${e}" to match "${t}".`)}function FE(e,t,n,r){return fetch(e,{method:`GET`,headers:t,signal:r.signal,mode:`cors`,credentials:n?`include`:`same-origin`,redirect:`follow`})}function IE(e,t){if(e!==200&&e!==206)throw NE(e,t)}function LE(e){if(e instanceof Uint8Array)return e.buffer;if(e instanceof ArrayBuffer)return e;throw Error(`getArrayBuffer - unexpected data: ${e}`)}var RE=class extends wE{_responseOrigin=null;constructor(e){super(e,zE,BE);let{httpHeaders:t,url:n}=e;lC(/https?:/.test(n.protocol),`PDFFetchStream only supports http(s):// URLs.`),this.headers=OE(!0,t)}},zE=class extends TE{_abortController=new AbortController;_reader=null;constructor(e){super(e);let{disableRange:t,disableStream:n,rangeChunkSize:r,url:i,withCredentials:a}=e._source;this._isStreamingSupported=!n,FE(i,new Headers(e.headers),a,this._abortController).then(n=>{e._responseOrigin=AE(n.url),IE(n.status,i),this._reader=n.body.getReader();let a=n.headers,{contentLength:o,isRangeSupported:s}=jE({responseHeaders:a,isHttp:!0,rangeChunkSize:r,disableRange:t});this._contentLength=o,this._isRangeSupported=s,this._filename=ME(a),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new xC(`Streaming is disabled.`)),this._headersCapability.resolve()}).catch(this._headersCapability.reject)}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this._callOnProgress(),{value:LE(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}},BE=class extends EE{_abortController=new AbortController;_readCapability=Promise.withResolvers();_reader=null;constructor(e,t,n){super(e,t,n);let{url:r,withCredentials:i}=e._source,a=new Headers(e.headers);a.append(`Range`,`bytes=${t}-${n-1}`),FE(r,a,i,this._abortController).then(t=>{PE(AE(t.url),e._responseOrigin),IE(t.status,r),this._reader=t.body.getReader(),this._readCapability.resolve()}).catch(this._readCapability.reject)}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:{value:LE(e),done:!1}}cancel(e){this._reader?.cancel(e),this._abortController.abort()}};function VE(e){return e instanceof Uint8Array&&e.byteLength===e.buffer.byteLength?e.buffer:new Uint8Array(e).buffer}function HE(){for(let e of this._requests)e.resolve({value:void 0,done:!0});this._requests.length=0}var UE=class extends wE{_progressiveDone=!1;_queuedChunks=[];constructor(e){super(e,WE,GE);let{pdfDataRangeTransport:t}=e,{initialData:n,progressiveDone:r}=t;if(n?.length>0){let e=VE(n);this._queuedChunks.push(e)}this._progressiveDone=r,t.transportReady(e=>{switch(e.type){case`range`:case`progressiveRead`:this.#e(e.begin,e.chunk);break;case`progressiveDone`:this._fullReader?.progressiveDone(),this._progressiveDone=!0;break}})}#e(e,t){let n=VE(t);if(e===void 0)this._fullReader?this._fullReader._enqueue(n):this._queuedChunks.push(n);else{let t=this._rangeReaders.keys().find(t=>t._begin===e);lC(t,"#onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."),t._enqueue(n)}}getFullReader(){let e=super.getFullReader();return this._queuedChunks=null,e}getRangeReader(e,t){let n=super.getRangeReader(e,t);return n&&(n.onDone=()=>this._rangeReaders.delete(n),this._source.pdfDataRangeTransport.requestDataRange(e,t)),n}cancelAllRequests(e){super.cancelAllRequests(e),this._source.pdfDataRangeTransport.abort()}},WE=class extends TE{#e=HE.bind(this);_done=!1;_queuedChunks=null;_requests=[];constructor(e){super(e);let{pdfDataRangeTransport:t,disableRange:n,disableStream:r}=e._source,{length:i,contentDispositionFilename:a}=t;this._queuedChunks=e._queuedChunks||[];for(let e of this._queuedChunks)this._loaded+=e.byteLength;this._done=e._progressiveDone,this._contentLength=i,this._isStreamingSupported=!r,this._isRangeSupported=!n,KC(a)&&(this._filename=a),this._headersCapability.resolve();let o=this._loaded;Promise.resolve().then(()=>{o>0&&this._loaded===o&&this._callOnProgress()})}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength,this._callOnProgress())}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e()}progressiveDone(){this._done||=!0,this._queuedChunks.length===0&&this.#e()}},GE=class extends EE{#e=HE.bind(this);onDone=null;_begin=-1;_done=!1;_queuedChunk=null;_requests=[];constructor(e,t,n){super(e,t,n),this._begin=t}_enqueue(e){this._done||(this._requests.length===0?this._queuedChunk=e:(this._requests.shift().resolve({value:e,done:!1}),this.#e()),this._done=!0,this.onDone?.())}async read(){if(this._queuedChunk){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e(),this.onDone?.()}},KE=200,qE=206;function JE(e){return typeof e==`string`?CC(e).buffer:e}var YE=class extends wE{#e=new WeakMap;_responseOrigin=null;constructor(e){super(e,XE,ZE);let{httpHeaders:t,url:n}=e;this.url=n,this.isHttp=/https?:/.test(n.protocol),this.headers=OE(this.isHttp,t)}_request(e){let t=new XMLHttpRequest,n={validateStatus:null,onHeadersReceived:e.onHeadersReceived,onDone:e.onDone,onError:e.onError,onProgress:e.onProgress};this.#e.set(t,n),t.open(`GET`,this.url),t.withCredentials=this._source.withCredentials;for(let[e,n]of this.headers)t.setRequestHeader(e,n);return this.isHttp&&`begin`in e&&`end`in e?(t.setRequestHeader(`Range`,`bytes=${e.begin}-${e.end-1}`),n.validateStatus=e=>e===qE||e===KE):n.validateStatus=e=>e===KE,t.responseType=`arraybuffer`,lC(e.onError,"Expected `onError` callback to be provided."),t.onerror=()=>e.onError(t.status),t.onreadystatechange=this.#n.bind(this,t),t.onprogress=this.#t.bind(this,t),t.send(null),t}#t(e,t){this.#e.get(e)?.onProgress?.(t)}#n(e,t){let n=this.#e.get(e);if(!n||(e.readyState>=2&&n.onHeadersReceived&&(n.onHeadersReceived(),delete n.onHeadersReceived),e.readyState!==4)||!this.#e.has(e))return;if(this.#e.delete(e),e.status===0&&this.isHttp){n.onError(e.status);return}let r=e.status||KE;if(!n.validateStatus(r)){n.onError(e.status);return}let i=JE(e.response);if(r===qE){let t=e.getResponseHeader(`Content-Range`);/bytes \d+-\d+\/\d+/.test(t)?n.onDone(i):(sC(`Missing or invalid "Content-Range" header.`),n.onError(0))}else i?n.onDone(i):n.onError(e.status)}_abortRequest(e){this.#e.has(e)&&(this.#e.delete(e),e.abort())}getRangeReader(e,t){let n=super.getRangeReader(e,t);return n&&(n.onClosed=()=>this._rangeReaders.delete(n)),n}},XE=class extends TE{#e=HE.bind(this);_cachedChunks=[];_done=!1;_requests=[];_storedError=null;constructor(e){super(e),this._fullRequestXhr=e._request({onHeadersReceived:this.#t.bind(this),onDone:this.#n.bind(this),onError:this.#r.bind(this),onProgress:this.#i.bind(this)})}#t(){let e=this._stream,{disableRange:t,rangeChunkSize:n}=e._source,r=this._fullRequestXhr;e._responseOrigin=AE(r.responseURL);let i=r.getAllResponseHeaders(),a=new Headers(i?kE(i.trimStart()).split(/[\r\n]+/).map(e=>{let[t,...n]=e.split(`: `);return[t,n.join(`: `)]}):[]),{contentLength:o,isRangeSupported:s}=jE({responseHeaders:a,isHttp:e.isHttp,rangeChunkSize:n,disableRange:t});this._contentLength=o,this._isRangeSupported=s,this._filename=ME(a),this._isRangeSupported&&e._abortRequest(r),this._headersCapability.resolve()}#n(e){this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._cachedChunks.push(e),this._done=!0,this._cachedChunks.length===0&&this.#e()}#r(e){this._storedError=NE(e,this._stream.url),this._headersCapability.reject(this._storedError);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}#i(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e),this.#e(),this._stream._abortRequest(this._fullRequestXhr),this._fullRequestXhr=null}},ZE=class extends EE{#e=HE.bind(this);onClosed=null;_done=!1;_queuedChunk=null;_requests=[];_storedError=null;constructor(e,t,n){super(e,t,n),this._requestXhr=e._request({begin:t,end:n,onHeadersReceived:this.#t.bind(this),onDone:this.#n.bind(this),onError:this.#r.bind(this),onProgress:null})}#t(){let e=AE(this._requestXhr?.responseURL);try{PE(e,this._stream._responseOrigin)}catch(e){this._storedError=e,this.#r(0)}}#n(e){this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunk=e,this._done=!0,this.#e(),this.onClosed?.()}#r(e){this._storedError??=NE(e,this._stream.url);for(let e of this._requests)e.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){let e=this._queuedChunk;return this._queuedChunk=null,{value:e,done:!1}}if(this._done)return{value:void 0,done:!0};let e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this.#e(),this._stream._abortRequest(this._requestXhr),this.onClosed?.()}};function QE(e,t=null){let n=process.getBuiltinModule(`fs`),{Readable:r}=process.getBuiltinModule(`stream`),i=n.createReadStream(e,t);return r.toWeb(i)}var $E=class extends wE{constructor(e){super(e,eD,tD);let{url:t}=e;lC(t.protocol===`file:`,`PDFNodeStream only supports file:// URLs.`)}},eD=class extends TE{_reader=null;constructor(e){super(e);let{disableRange:t,disableStream:n,rangeChunkSize:r,url:i}=e._source;this._isStreamingSupported=!n,process.getBuiltinModule(`fs/promises`).lstat(i).then(e=>{let n=QE(i);this._reader=n.getReader();let{size:a}=e;this._contentLength=a,this._isRangeSupported=!t&&a>2*r,!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new xC(`Streaming is disabled.`)),this._headersCapability.resolve()}).catch(e=>{e.code===`ENOENT`&&(e=NE(0,i)),this._headersCapability.reject(e)})}async read(){await this._headersCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:(this._loaded+=e.byteLength,this._callOnProgress(),{value:LE(e),done:!1})}cancel(e){this._reader?.cancel(e)}},tD=class extends EE{_readCapability=Promise.withResolvers();_reader=null;constructor(e,t,n){super(e,t,n);let{url:r}=e._source;try{let e=QE(r,{start:t,end:n-1});this._reader=e.getReader(),this._readCapability.resolve()}catch(e){this._readCapability.reject(e)}}async read(){await this._readCapability.promise;let{value:e,done:t}=await this._reader.read();return t?{value:e,done:t}:{value:LE(e),done:!1}}cancel(e){this._reader?.cancel(e)}};function nD(e){return XC(e)?RE:LS?$E:YE}var rD=class{static#e=null;static#t=``;static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<`u`&&e instanceof Worker)&&e!==null)throw Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!=`string`)throw Error("Invalid `workerSrc` type.");this.#t=e}},iD=class{#e;#t;constructor({parsedData:e,rawData:t}){this.#e=e,this.#t=t}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}[Symbol.iterator](){return this.#e.entries()}},aD=Symbol(`INTERNAL`),oD=class{#e=!1;#t=!1;#n=!1;#r=!0;constructor(e,{name:t,intent:n,usage:r,rbGroups:i}){this.#e=!!(e&HS.DISPLAY),this.#t=!!(e&HS.PRINT),this.name=t,this.intent=n,this.usage=r,this.rbGroups=i}get visible(){if(this.#n)return this.#r;if(!this.#r)return!1;let{print:e,view:t}=this.usage;return this.#e?t?.viewState!==`OFF`:this.#t?e?.printState!==`OFF`:!0}_setVisible(e,t,n=!1){e!==aD&&cC("Internal method `_setVisible` called."),this.#n=n,this.#r=t}get serializable(){return{userSet:this.#n,visible:this.#r}}},sD=class e{#e=null;#t=new Map;#n=null;#r=null;#i;creator=null;name=null;constructor(e,t=HS.DISPLAY,n=null){if(this.#i=e,this.renderingIntent=t,e!==null){this.name=e.name,this.creator=e.creator,this.#r=e.order;for(let n of e.groups)this.#t.set(n.id,new oD(t,n));if(n){n.size!==this.#t.size&&cC(`Incorrect serialized groupState.`);for(let[e,t]of n)this.#t.get(e)._setVisible(aD,t.visible,t.userSet)}else{if(e.baseState===`OFF`)for(let e of this.#t.values())e._setVisible(aD,!1);for(let t of e.on)this.#t.get(t)._setVisible(aD,!0);for(let t of e.off)this.#t.get(t)._setVisible(aD,!1)}this.#n=this.getHash()}}#a(e){let t=e.length;if(t<2)return!0;let n=e[0];for(let r=1;r<t;r++){let t=e[r],i;if(Array.isArray(t))i=this.#a(t);else if(this.#t.has(t))i=this.#t.get(t).visible;else return sC(`Optional content group not found: ${t}`),!0;switch(n){case`And`:if(!i)return!1;break;case`Or`:if(i)return!0;break;case`Not`:return!i;default:return!0}}return n===`And`}isVisible(e){if(this.#t.size===0)return!0;if(!e)return oC(`Optional content group not defined.`),!0;if(e.type===`OCG`)return this.#t.has(e.id)?this.#t.get(e.id).visible:(sC(`Optional content group not found: ${e.id}`),!0);if(e.type===`OCMD`){if(e.expression)return this.#a(e.expression);if(!e.policy||e.policy===`AnyOn`){for(let t of e.ids){if(!this.#t.has(t))return sC(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!0}return!1}else if(e.policy===`AllOn`){for(let t of e.ids){if(!this.#t.has(t))return sC(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!1}return!0}else if(e.policy===`AnyOff`){for(let t of e.ids){if(!this.#t.has(t))return sC(`Optional content group not found: ${t}`),!0;if(!this.#t.get(t).visible)return!0}return!1}else if(e.policy===`AllOff`){for(let t of e.ids){if(!this.#t.has(t))return sC(`Optional content group not found: ${t}`),!0;if(this.#t.get(t).visible)return!1}return!0}return sC(`Unknown optional content policy ${e.policy}.`),!0}return sC(`Unknown group type ${e.type}.`),!0}setVisibility(e,t=!0,n=!0){let r=this.#t.get(e);if(!r){sC(`Optional content group not found: ${e}`);return}if(n&&t&&r.rbGroups.length)for(let t of r.rbGroups)for(let n of t)n!==e&&this.#t.get(n)?._setVisible(aD,!1,!0);r._setVisible(aD,!!t,!0),this.#e=null}setOCGState({state:e,preserveRB:t}){let n;for(let r of e){switch(r){case`ON`:case`OFF`:case`Toggle`:n=r;continue}let e=this.#t.get(r);if(e)switch(n){case`ON`:this.setVisibility(r,!0,t);break;case`OFF`:this.setVisibility(r,!1,t);break;case`Toggle`:this.setVisibility(r,!e.visible,t);break}}this.#e=null}get hasInitialVisibility(){return this.#n===null||this.getHash()===this.#n}getOrder(){return this.#t.size?this.#r?this.#r.slice():[...this.#t.keys()]:null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;let e=new Vw;for(let[t,n]of this.#t)e.update(`${t}:${n.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}get serializable(){let e=new Map;for(let[t,n]of this.#t)e.set(t,n.serializable);return{data:this.#i,renderingIntent:this.renderingIntent,groupState:e}}static fromSerializable({data:t,renderingIntent:n,groupState:r}){return new e(t,n,r)}},cD=class{#e=null;#t=null;#n=0;#r=null;#i=null;get pagesNumber(){return this.#n}set pagesNumber(e){this.#n!==e&&(this.#n=e,this.#e=null,this.#t=null)}#a(){if(this.#e)return;let e=this.#n,t=this.#e=new Uint32Array(e);for(let n=0;n<e;n++)t[n]=n+1;this.#t=new Int32Array(t)}#o(){let e=new Map,t=this.#e;for(let n=0,r=this.#n;n<r;n++){let r=t[n],i=e.get(r);i?i.push(n+1):e.set(r,[n+1])}return e}movePages(e,t,n){this.#a();let r=this.#e,i=t.length,a=new Uint32Array(i),o=0;for(let e=0;e<i;e++){let i=t[e]-1;a[e]=r[i],i<n&&o++}let s=this.#n,c=s-i,l=new Int32Array(s),u=IC(n-o,0,c);for(let t=0,n=0;t<s;t++)e.has(t+1)||(r[n]=r[t],l[n++]=t+1);r.copyWithin(u+i,u,c),r.set(a,u),l.copyWithin(u+i,u,c),l.set(t,u),this.#t=l,r.every((e,t)=>e===t+1)&&(this.#e=null)}deletePages(e){this.#a();let t=this.#e,n=this.#o();this.#i={pageNumberToId:t.slice(),pagesNumber:this.#n,prevPageNumbers:this.#t.slice()};let r=this.#n-e.length;this.#n=r;let i=this.#e=new Uint32Array(r);this.#t=new Int32Array(r);let a=0,o=0;for(let n of e){let e=n-1;e!==a&&(i.set(t.subarray(a,e),o),o+=e-a),a=e+1}a<t.length&&i.set(t.subarray(a),o),this.#s(n,new Set(e))}cancelDelete(){this.#i&&=(this.#e=this.#i.pageNumberToId,this.#n=this.#i.pagesNumber,this.#t=this.#i.prevPageNumbers,null)}cleanSavedData(){this.#i=null}copyPages(e){this.#a(),this.#r={pageNumbers:e,pageIds:e.map(e=>this.#e[e-1])}}cancelCopy(){this.#r=null}pastePages(e){this.#a();let t=this.#e,n=this.#o(),{pageNumbers:r,pageIds:i}=this.#r,a=this.#n+r.length;this.#n=a;let o=this.#e=new Uint32Array(a);this.#t=new Int32Array(a),o.set(t.subarray(0,e),0),o.set(i,e),o.set(t.subarray(e),e+r.length),this.#s(n,null,e,r),this.#r=null}#s(e,t=null,n=-1,r=null){let i=this.#t,a=this.#e,o=n+(r?.length??0),s=new Map;for(let c=0,l=this.#n;c<l;c++){if(c>=n&&c<o){i[c]=-r[c-n];continue}let l=a[c],u=e.get(l),d=s.get(l)||0;if(t&&u)for(;d<u.length&&t.has(u[d]);)d++;i[c]=u?.[d],s.set(l,d+1)}}hasBeenAltered(){return this.#e!==null}#c(e=null){if(!this.#e)return null;let t=new Int32Array(this.#n).fill(-1),n=new Map;if(e)for(let r of e){let e=this.getPageId(r),i=n.get(e)??0;n.set(e,i+1),t[r-1]=i}else for(let e=0,r=this.#n;e<r;e++){let r=this.#e[e],i=n.get(r)??0;n.set(r,i+1),t[e]=i}return t}getPageMappingForSaving(e=null,t=this.#c()){e??=this.#o();let n=0;for(let t of e.values())n=Math.max(n,t.length);let r=Array(n);for(let e=0;e<n;e++)r[e]={document:null,pageIndices:[],includePages:[]};for(let[t,n]of e)for(let e=0,i=n.length;e<i;e++)r[e].includePages.push([t-1,n[e]-1]);for(let{includePages:e,pageIndices:t}of r){e.sort((e,t)=>e[0]-t[0]);for(let n=0,r=e.length;n<r;n++)t.push(e[n][1]),e[n]=e[n][0]}return{pageInfos:r,copyLevels:t}}extractPages(e){e=Array.from(e).sort((e,t)=>e-t);let t=new Map;for(let n=0,r=e.length;n<r;n++){let r=this.getPageId(e[n]);t.getOrInsertComputed(r,MC).push(n+1)}return this.getPageMappingForSaving(t,this.#c(e))}getPrevPageNumber(e){return this.#t?.[e-1]??0}getPageNumber(e){if(!this.#e)return e;let t=this.#e;for(let n=0,r=this.#n;n<r;n++)if(t[n]===e)return n+1;return 0}getPageId(e){return this.#e?.[e-1]??e}getMapping(){return this.#e?.subarray(0,this.pagesNumber)}},lD=Symbol(`INITIAL_DATA`),uD=()=>({...Promise.withResolvers(),data:lD}),dD=class{#e=new Map;get(e,t=null){if(t){let n=this.#e.getOrInsertComputed(e,uD);return n.promise.then(()=>t(n.data)),null}let n=this.#e.get(e);if(!n||n.data===lD)throw Error(`Requesting object that isn't resolved yet ${e}.`);return n.data}has(e){let t=this.#e.get(e);return!!t&&t.data!==lD}delete(e){let t=this.#e.get(e);return!t||t.data===lD?!1:(this.#e.delete(e),!0)}resolve(e,t=null){let n=this.#e.getOrInsertComputed(e,uD);if(n.data!==lD)throw Error(`Object already resolved ${e}.`);n.data=t,n.resolve()}clear(){for(let{data:e}of this.#e.values())e?.bitmap?.close();this.#e.clear()}*[Symbol.iterator](){for(let[e,{data:t}]of this.#e)t!==lD&&(yield[e,t])}},fD=1e5,pD=30,mD=class e{#e=Promise.withResolvers();#t=null;#n=!1;#r=!!globalThis.FontInspector?.enabled;#i=null;#a=null;#o=null;#s=0;#c=0;#l=null;#u=null;#d=0;#f=0;#p=Object.create(null);#m=[];#h=null;#g=[];#_=new WeakMap;#v=null;static#y=new Map;static#b=new Map;static#x=new WeakMap;static#S=null;static#C=new Set;constructor({textContentSource:t,images:n,container:r,viewport:i}){if(t instanceof ReadableStream)this.#h=t;else if(typeof t==`object`)this.#h=new ReadableStream({start(e){e.enqueue(t),e.close()}});else throw Error(`No "textContentSource" parameter specified.`);this.#t=this.#u=r,this.#i=n,this.#f=i.scale*ow.pixelRatio,this.#d=i.rotation,this.#o={div:null,properties:null,ctx:null};let{pageWidth:a,pageHeight:o,pageX:s,pageY:c}=i.rawDims;this.#v=[1,0,0,-1,-s,c+o],this.#c=a,this.#s=o,e.#k(),r.style.setProperty(`--min-font-size`,e.#S),aw(r,i),this.#e.promise.finally(()=>{e.#C.delete(this),this.#o=null,this.#p=null}).catch(()=>{})}static get fontFamilyMap(){let{isWindows:e,isFirefox:t}=wC.platform;return mC(this,`fontFamilyMap`,new Map([[`sans-serif`,`${e&&t?`Calibri, `:``}sans-serif`],[`monospace`,`${e&&t?`Lucida Console, `:``}monospace`]]))}render(){this.#i&&this.#t.append(this.#i.render());let t=()=>{this.#l.read().then(({value:e,done:n})=>{if(n){this.#e.resolve();return}this.#a??=e.lang,Object.assign(this.#p,e.styles),this.#w(e.items),t()},this.#e.reject)};return this.#l=this.#h.getReader(),e.#C.add(this),t(),this.#e.promise}update({viewport:t,onBefore:n=null}){let r=t.scale*ow.pixelRatio,i=t.rotation;if(i!==this.#d&&(n?.(),this.#d=i,aw(this.#u,{rotation:i})),r!==this.#f){n?.(),this.#f=r;let t={div:null,properties:null,ctx:e.#D(this.#a)};for(let e of this.#g)t.properties=this.#_.get(e),t.div=e,this.#E(t)}}cancel(){let e=new xC(`TextLayer task cancelled.`);this.#l?.cancel(e).catch(()=>{}),this.#l=null,this.#e.reject(e)}get textDivs(){return this.#g}get textContentItemsStr(){return this.#m}#w(t){if(this.#n)return;this.#o.ctx??=e.#D(this.#a);let n=this.#g,r=this.#m;for(let e of t){if(n.length>fD){sC(`Ignoring additional textDivs for performance reasons.`),this.#n=!0;return}if(e.str===void 0){if(e.type===`beginMarkedContentProps`||e.type===`beginMarkedContent`){let t=this.#t;this.#t=document.createElement(`span`),this.#t.classList.add(`markedContent`),e.id&&this.#t.setAttribute(`id`,e.id),e.tag===`Artifact`&&(this.#t.ariaHidden=!0),t.append(this.#t)}else e.type===`endMarkedContent`&&(this.#t=this.#t.parentNode);continue}r.push(e.str),this.#T(e)}}#T(t){let n=document.createElement(`span`),r={angle:0,canvasWidth:0,hasText:t.str!==``,hasEOL:t.hasEOL,fontSize:0};this.#g.push(n);let i=TC.transform(this.#v,t.transform),a=Math.atan2(i[1],i[0]),o=this.#p[t.fontName];o.vertical&&(a+=Math.PI/2);let s=this.#r&&o.fontSubstitution||o.fontFamily;s=e.fontFamilyMap.get(s)||s;let c=Math.hypot(i[2],i[3]),l=c*e.#A(s,o,this.#a),u,d;a===0?(u=i[4],d=i[5]-l):(u=i[4]+l*Math.sin(a),d=i[5]-l*Math.cos(a));let f=n.style;f.left=`${(100*u/this.#c).toFixed(2)}%`,f.top=`${(100*d/this.#s).toFixed(2)}%`,f.setProperty(`--font-height`,`${c.toFixed(2)}px`),f.fontFamily=s,r.fontSize=c,n.setAttribute(`role`,`presentation`),n.textContent=t.str,n.dir=t.dir,this.#r&&(n.dataset.fontName=o.fontSubstitutionLoadedName||t.fontName),a!==0&&(r.angle=180/Math.PI*a);let p=!1;if(t.str.length>1)p=!0;else if(t.str!==` `&&t.transform[0]!==t.transform[3]){let e=Math.abs(t.transform[0]),n=Math.abs(t.transform[3]);e!==n&&Math.max(e,n)/Math.min(e,n)>1.5&&(p=!0)}if(p&&(r.canvasWidth=o.vertical?t.height:t.width),this.#_.set(n,r),this.#o.div=n,this.#o.properties=r,this.#E(this.#o),r.hasText&&this.#t.append(n),r.hasEOL){let e=document.createElement(`br`);e.setAttribute(`role`,`presentation`),this.#t.append(e)}}#E(t){let{div:n,properties:r,ctx:i}=t,{style:a}=n;if(r.canvasWidth!==0&&r.hasText){let{fontFamily:t}=a,{canvasWidth:o,fontSize:s}=r;e.#O(i,s*this.#f,t);let{width:c}=i.measureText(n.textContent);c>0&&a.setProperty(`--scale-x`,o*this.#f/c)}r.angle!==0&&a.setProperty(`--rotate`,`${r.angle}deg`)}static cleanup(){if(!(this.#C.size>0)){this.#y.clear();for(let{canvas:e}of this.#b.values())e.remove();this.#b.clear()}}static#D(e=null){let t=this.#b.get(e||=``);if(!t){let n=document.createElement(`canvas`);n.style.cssText=`position:absolute;top:0;left:0;width:0;height:0;display:none;letter-spacing:normal;word-spacing:normal`,n.lang=e,document.body.append(n),t=n.getContext(`2d`,{alpha:!1,willReadFrequently:!0}),this.#b.set(e,t),this.#x.set(t,{size:0,family:``})}return t}static#O(e,t,n){let r=this.#x.get(e);t===r.size&&n===r.family||(e.font=`${t}px ${n}`,r.size=t,r.family=n)}static#k(){if(this.#S!==null)return;let e=document.createElement(`div`);e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize=`1px`,e.style.position=`absolute`,e.textContent=`X`,document.body.append(e),this.#S=e.getBoundingClientRect().height,e.remove()}static#A(e,t,n){let r=this.#y.get(e);if(r)return r;let i=this.#D(n);i.canvas.width=i.canvas.height=pD,this.#O(i,pD,e);let a=i.measureText(``),o=a.fontBoundingBoxAscent,s=Math.abs(a.fontBoundingBoxDescent);i.canvas.width=i.canvas.height=0;let c=.8;return o?c=o/(o+s):(wC.platform.isFirefox&&sC("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),t.ascent?c=t.ascent:t.descent&&(c=1+t.descent)),this.#y.set(e,c),c}},hD=100;function gD(e={}){let t=new _D,{docId:n}=t,r=e.url?yT(e.url):null,i=e.data?bT(e.data):null,a=e.httpHeaders||null,o=e.withCredentials===!0,s=e.password??null,c=e.range instanceof vD?e.range:null,l=Number.isInteger(e.rangeChunkSize)&&e.rangeChunkSize>0?e.rangeChunkSize:2**16,u=e.worker instanceof xD?e.worker:null,d=e.verbosity,f=typeof e.docBaseUrl==`string`&&!GC(e.docBaseUrl)?e.docBaseUrl:null,p=xT(e.cMapUrl),m=e.cMapPacked!==!1,h=xT(e.iccUrl),g=xT(e.standardFontDataUrl),_=xT(e.wasmUrl),v=e.stopAtErrors!==!0,y=Number.isInteger(e.maxImageSize)&&e.maxImageSize>-1?e.maxImageSize:-1,b=typeof e.isOffscreenCanvasSupported==`boolean`?e.isOffscreenCanvasSupported:!LS,x=typeof e.isImageDecoderSupported==`boolean`?e.isImageDecoderSupported:!LS,S=Number.isInteger(e.canvasMaxAreaInBytes)?e.canvasMaxAreaInBytes:-1,C=typeof e.disableFontFace==`boolean`?e.disableFontFace:LS,w=e.fontExtraProperties===!0,T=e.enableXfa===!0,E=e.ownerDocument||globalThis.document,D=e.disableRange===!0,O=e.disableStream===!0,k=e.disableAutoFetch===!0,A=e.pdfBug===!0,j=e.CanvasFactory||(LS?zT:NT),M=e.FilterFactory||(LS?RT:FT),N=e.BinaryDataFactory||(LS?BT:jT),P=e.enableHWA===!0,F=e.enableWebGPU===!0?GT():Promise.resolve(!1),I=e.useWasm!==!1,L=e.pagesMapper||new cD,R=typeof e.useSystemFonts==`boolean`?e.useSystemFonts:!LS&&!C,ee=typeof e.useWorkerFetch==`boolean`?e.useWorkerFetch:!!(N===jT&&p&&m&&g&&_&&XC(p,document.baseURI)&&XC(g,document.baseURI)&&XC(_,document.baseURI));iC(d);let te={canvasFactory:new j({ownerDocument:E,enableHWA:P}),filterFactory:new M({docId:n,ownerDocument:E}),binaryDataFactory:ee?null:new N({cMapUrl:p,standardFontDataUrl:g,wasmUrl:_})};u||(u=xD.create({verbosity:d,port:rD.workerPort}),t._worker=u);let ne={docId:n,apiVersion:`6.3.289`,data:i,password:s,disableAutoFetch:k,rangeChunkSize:l,docBaseUrl:f,enableXfa:T,evaluatorOptions:{maxImageSize:y,disableFontFace:C,ignoreErrors:v,isOffscreenCanvasSupported:b,isImageDecoderSupported:x,canvasMaxAreaInBytes:S,fontExtraProperties:w,useSystemFonts:R,useWasm:I,useWorkerFetch:ee,cMapUrl:p,cMapPacked:m,iccUrl:h,standardFontDataUrl:g,wasmUrl:_,hasGPU:!1}},re={ownerDocument:E,pdfBug:A,styleElement:null,enableHWA:P,loadingParams:{disableAutoFetch:k,enableXfa:T}};return Promise.all([u.promise,F]).then(function([,e]){if(u.destroyed)throw Error(`Worker was destroyed`);ne.evaluatorOptions.hasGPU=e;let s=u.messageHandler.sendWithPromise(`GetDocRequest`,ne,i?[i.buffer]:null),d;if(!i)if(c)d=new UE({pdfDataRangeTransport:c,disableRange:D,disableStream:O});else if(r)d=new(nD(r))({url:r,httpHeaders:a,withCredentials:o,rangeChunkSize:l,disableRange:D,disableStream:O});else throw Error("getDocument - expected either `data`, `range`, or `url` parameter.");return s.then(e=>{if(u.destroyed)throw Error(`Worker was destroyed`);let r=new kT(n,e,u.port);if(t._transport=new SD(r,t,d,re,te,L),t.destroyed)throw Error(`Loading aborted`);r.send(`Ready`,null)})}).catch(t._capability.reject).finally(t._setupCapability.resolve),t}var _D=class e{static#e=0;_capability=Promise.withResolvers();_setupCapability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${e.#e++}`;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0,this._capability.promise.catch(()=>{});try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._setupCapability.promise,await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}},vD=class{#e=Promise.withResolvers();#t=null;constructor(e,t,n=!1,r=null){this.length=e,this.initialData=t,this.progressiveDone=n,this.contentDispositionFilename=r}onDataRange(e,t){this.#t({type:`range`,begin:e,chunk:t})}onDataProgressiveRead(e){this.#e.promise.then(()=>{this.#t({type:`progressiveRead`,chunk:e})})}onDataProgressiveDone(){this.#e.promise.then(()=>{this.#t({type:`progressiveDone`})})}transportReady(e){this.#t=e,this.#e.resolve()}requestDataRange(e,t){cC(`Abstract method PDFDataRangeTransport.requestDataRange`)}abort(){}},yD=class{constructor(e,t){this._pdfInfo=e,this._transport=t}get pagesMapper(){return this._transport.pagesMapper}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return mC(this,`isPureXfa`,!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAttachmentContent(e){return this._transport.getAttachmentContent(e)}getAnnotationsByType(e,t){return this._transport.getAnnotationsByType(e,t)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e=`display`}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(t)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}extractPages(e,t=null){return this._transport.extractPages(e,t)}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}getSignatures(){return this._transport.getSignatures()}getSignatureData(e){return this._transport.getSignatureData(e)}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}},bD=class e{#e=!1;#t=null;constructor(e,t,n,r,i=!1){this._pageIndex=e,this._pageInfo=t,this._transport=n,this._stats=i?new YC:null,this._pdfBug=i,this.commonObjs=n.commonObjs,this.objs=new dD,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null,this.#t=r,this.imageCoordinates=null}clone(t){let n=new e(t,this._pageInfo,this._transport,this.#t,this._pdfBug);return n.clonedFromIndex=this.clonedFromIndex??this._pageIndex,this._transport.updatePage(n),n}get pageNumber(){return this._pageIndex+1}set pageNumber(e){this._pageIndex=e-1,this._transport.updatePage(this)}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:t=this.rotate,offsetX:n=0,offsetY:r=0,dontFlip:i=!1}={}){return new LC({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:t,offsetX:n,offsetY:r,dontFlip:i})}getAnnotations({intent:e=`display`}={}){let{renderingIntent:t}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,t)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return mC(this,`isPureXfa`,!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:t=e.canvas,viewport:n,intent:r=`display`,annotationMode:i=US.ENABLE,transform:a=null,background:o=null,optionalContentConfigPromise:s=null,annotationCanvasMap:c=null,pageColors:l=null,printAnnotationStorage:u=null,isEditing:d=!1,recordImages:f=!1,recordOperations:p=!1,operationsFilter:m=null}){this._stats?.time(`Overall`);let h=this._transport.getRenderingIntent(r,i,u,d),{renderingIntent:g,cacheKey:_}=h;this.#e=!1,s||=this._transport.getOptionalContentConfig(g);let v=this._intentStates.getOrInsertComputed(_,PC);v.streamReaderCancelTimeout&&=(clearTimeout(v.streamReaderCancelTimeout),null);let y=!!(g&HS.PRINT);v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(h));let b=!!(this._pdfBug&&globalThis.StepperManager?.enabled),x=!!t&&!this.recordedBBoxes&&(p||b),S=!!t&&!this.imageCoordinates&&f,C=e=>{if(v.renderTasks.delete(E),x){let e=E.gfx?.dependencyTracker.take();e&&(E.stepper?.setOperatorBBoxes(e,E.gfx.dependencyTracker.takeDebugMetadata()),p&&(this.recordedBBoxes=e))}S&&!e&&(this.imageCoordinates=E.gfx?.imagesTracker.take()),y&&(this.#e=!0),this.#n(),e?(E.capability.reject(e),this._abortOperatorList({intentState:v,reason:e instanceof Error?e:Error(e)})):E.capability.resolve(),this._stats&&(this._stats.timeEnd(`Rendering`),this._stats.timeEnd(`Overall`),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},w=null,T=null;(x||S)&&(T=new $w(t,v.operatorList.length)),x&&(w=new eT(T,b));let E=new wD({callback:C,params:{canvas:t,canvasContext:e,dependencyTracker:w??T,imagesTracker:S?new rT(t):null,viewport:n,transform:a,background:o},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:l,enableHWA:this._transport.enableHWA,operationsFilter:m});(v.renderTasks||=new Set).add(E);let D=E.task;return Promise.all([v.displayReadyCapability.promise,s]).then(([e,t])=>{if(this.destroyed){C();return}if(this._stats?.time(`Rendering`),!(t.renderingIntent&g))throw Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");E.initializeGraphics({transparency:e,optionalContentConfig:t}),E.operatorListChanged()}).catch(C),D}getOperatorList({intent:e=`display`,annotationMode:t=US.ENABLE,printAnnotationStorage:n=null,isEditing:r=!1}={}){function i(){o.operatorList.lastChunk&&(o.opListReadCapability.resolve(o.operatorList),o.renderTasks.delete(s))}let a=this._transport.getRenderingIntent(e,t,n,r,!0),o=this._intentStates.getOrInsertComputed(a.cacheKey,PC),s;return o.opListReadCapability||(s=Object.create(null),s.operatorListChanged=i,o.opListReadCapability=Promise.withResolvers(),(o.renderTasks||=new Set).add(s),o.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time(`Page Request`),this._pumpOperatorList(a)),o.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:t=!1}={}){return this._transport.messageHandler.sendWithStream(`GetTextContent`,{pageId:this.#t.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:t===!0},{highWaterMark:100,size(e){return e.items.length}})}async getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(e=>RC.textContent(e));let t=this.streamTextContent(e),n={items:[],styles:Object.create(null),lang:null};for await(let e of t)n.lang??=e.lang,Object.assign(n.styles,e.styles),n.items.push(...e.items);return n}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;let e=[];for(let t of this._intentStates.values())if(this._abortOperatorList({intentState:t,reason:Error(`Page was destroyed.`),force:!0}),!t.opListReadCapability)for(let n of t.renderTasks)e.push(n.completed),n.cancel();return this.objs.clear(),this.#e=!1,Promise.all(e)}cleanup(e=!1){this.#e=!0;let t=this.#n();return e&&t&&(this._stats&&=new YC),t}#n(){if(!this.#e||this.destroyed)return!1;for(let{renderTasks:e,operatorList:t}of this._intentStates.values())if(e.size>0||!t.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}_startRenderPage(e,t){let n=this._intentStates.get(t);n&&(this._stats?.timeEnd(`Page Request`),n.displayReadyCapability?.resolve(e))}_renderPageChunk(e,t){for(let n=0,r=e.length;n<r;n++)t.operatorList.fnArray.push(e.fnArray[n]),t.operatorList.argsArray.push(e.argsArray[n]);t.operatorList.lastChunk=e.lastChunk,t.operatorList.separateAnnots=e.separateAnnots;for(let e of t.renderTasks)e.operatorListChanged();e.lastChunk&&this.#n()}_pumpOperatorList({renderingIntent:e,cacheKey:t,annotationStorageSerializable:n,modifiedIds:r}){let{map:i,transfer:a}=n,o=this._transport.messageHandler.sendWithStream(`GetOperatorList`,{pageId:this.#t.getPageId(this._pageIndex+1)-1,pageIndex:this._pageIndex,intent:e,cacheKey:t,annotationStorage:i,modifiedIds:r},void 0,a).getReader(),s=this._intentStates.get(t);s.streamReader=o;let c=()=>{o.read().then(({value:e,done:t})=>{if(t){s.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(e,s),c())},e=>{if(s.streamReader=null,!this._transport.destroyed){if(s.operatorList){s.operatorList.lastChunk=!0;for(let e of s.renderTasks)e.operatorListChanged();this.#n()}if(s.displayReadyCapability)s.displayReadyCapability.reject(e);else if(s.opListReadCapability)s.opListReadCapability.reject(e);else throw e}})};c()}_abortOperatorList({intentState:e,reason:t,force:n=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&=(clearTimeout(e.streamReaderCancelTimeout),null),!n){if(e.renderTasks.size>0)return;if(t instanceof WC){let n=hD;t.extraDelay>0&&t.extraDelay<1e3&&(n+=t.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:t,force:!0})},n);return}}if(e.streamReader.cancel(new xC(t.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(let[t,n]of this._intentStates)if(n===e){this._intentStates.delete(t);break}this.cleanup()}}}get stats(){return this._stats}},xD=class e{#e=Promise.withResolvers();#t=null;#n=null;#r=null;static#i=0;static#a=!1;static#o=new WeakMap;static{LS&&(this.#a=!0,rD.workerSrc||=`./pdf.worker.mjs`),this._isSameOrigin=(e,t)=>{let n=URL.parse(e);if(!n?.origin||n.origin===`null`)return!1;let r=new URL(t,n);return n.origin===r.origin},this._createCDNWrapper=e=>{let t=`await import("${e}");`;return URL.createObjectURL(new Blob([t],{type:`text/javascript`}))}}constructor({name:t=null,port:n=null,verbosity:r=aC()}={}){if(this.name=t,this.destroyed=!1,this.verbosity=r,n){if(e.#o.has(n))throw Error(`Cannot use more than one PDFWorker per port.`);e.#o.set(n,this),this.#c(n)}else this.#l()}get promise(){return this.#e.promise}#s(){this.#e.resolve(),this.#t.send(`configure`,{verbosity:this.verbosity})}get port(){return this.#n}get messageHandler(){return this.#t}#c(e){this.#n=e,this.#t=new kT(`main`,`worker`,e),this.#t.on(`ready`,()=>{}),this.#s()}#l(){if(e.#a||e.#d){this.#u();return}let{workerSrc:t}=e;try{e._isSameOrigin(window.location,t)||(t=e._createCDNWrapper(new URL(t,window.location).href));let n=new Worker(t,{type:`module`}),r=new kT(`main`,`worker`,n),i=()=>{a.abort(),r.destroy(),n.terminate(),this.destroyed?this.#e.reject(Error(`Worker was destroyed`)):this.#u()},a=new AbortController;n.addEventListener(`error`,()=>{this.#r||i()},{signal:a.signal}),r.on(`test`,e=>{if(a.abort(),this.destroyed||!e){i();return}this.#t=r,this.#n=n,this.#r=n,this.#s()}),r.on(`ready`,e=>{if(a.abort(),this.destroyed){i();return}try{o()}catch{this.#u()}});let o=()=>{let e=new Uint8Array;r.send(`test`,e,[e.buffer])};o();return}catch{oC(`The worker has been disabled.`)}this.#u()}#u(){e.#a||=(sC(`Setting up fake worker.`),!0),e._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){this.#e.reject(Error(`Worker was destroyed`));return}let n=new wT;this.#n=n;let r=`fake${e.#i++}`,i=new kT(r+`_worker`,r,n);t.setup(i,n),this.#t=new kT(r,r+`_worker`,n),this.#s()}).catch(e=>{this.#e.reject(Error(`Setting up fake worker failed: "${e.message}".`))})}destroy(){this.destroyed=!0,this.#r?.terminate(),this.#r=null,e.#o.delete(this.#n),this.#n=null,this.#t?.destroy(),this.#t=null}static create(t){let n=this.#o.get(t?.port);if(n){if(n._pendingDestroy)throw Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return n}return new e(t)}static get workerSrc(){if(rD.workerSrc)return rD.workerSrc;throw Error(`No "GlobalWorkerOptions.workerSrc" specified.`)}static get#d(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}}static get _setupFakeWorkerGlobal(){return mC(this,`_setupFakeWorkerGlobal`,(async()=>this.#d?this.#d:(await C(()=>import(this.workerSrc),[])).WorkerMessageHandler)())}},SD=class{downloadInfoCapability=Promise.withResolvers();#e=null;#t=new Map;#n=null;#r=new Map;#i=new Map;#a=new Map;#o=null;constructor(e,t,n,r,i,a){this.messageHandler=e,this.loadingTask=t,this.#n=n,this.commonObjs=new dD,this.fontLoader=new sT({ownerDocument:r.ownerDocument,styleElement:r.styleElement}),this.enableHWA=r.enableHWA,this.loadingParams=r.loadingParams,this._params=r,this.canvasFactory=i.canvasFactory,this.filterFactory=i.filterFactory,this.binaryDataFactory=i.binaryDataFactory,this.pagesMapper=a,this.destroyed=!1,this.destroyCapability=null,this.setupMessageHandler()}updatePage(e){let{_pageIndex:t}=e;this.#r.set(t,e),this.#i.set(t,Promise.resolve(e))}#s(e,t=null){return this.#t.getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,t))}#c({loaded:e,total:t}){this.loadingTask.onProgress?.({loaded:e,total:t,percent:t?IC(Math.round(e/t*100),0,100):NaN})}get annotationStorage(){return mC(this,`annotationStorage`,new Uw)}getRenderingIntent(e,t=US.ENABLE,n=null,r=!1,i=!1){let a=HS.DISPLAY,o=Hw;switch(e){case`any`:a=HS.ANY;break;case`display`:break;case`print`:a=HS.PRINT;break;default:sC(`getRenderingIntent - invalid intent: ${e}`)}let s=a&HS.PRINT&&n instanceof Ww?n:this.annotationStorage;switch(t){case US.DISABLE:a+=HS.ANNOTATIONS_DISABLE;break;case US.ENABLE:break;case US.ENABLE_FORMS:a+=HS.ANNOTATIONS_FORMS;break;case US.ENABLE_STORAGE:a+=HS.ANNOTATIONS_STORAGE,o=s.serializable;break;default:sC(`getRenderingIntent - invalid annotationMode: ${t}`)}r&&(a+=HS.IS_EDITING),i&&(a+=HS.OPLIST);let{ids:c,hash:l}=s.modifiedIds,u=[a,o.hash,l];return{renderingIntent:a,cacheKey:u.join(`_`),annotationStorageSerializable:o,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#o?.reject(Error(`Worker was destroyed during onPassword callback`));let e=[];for(let t of this.#r.values())e.push(t._destroy());this.#r.clear(),this.#i.clear(),this.#a.clear(),Object.hasOwn(this,`annotationStorage`)&&this.annotationStorage.resetModified();let t=this.messageHandler.sendWithPromise(`Terminate`,null);return e.push(t),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(),mD.cleanup(),this.#n?.cancelAllRequests(new xC(`Worker was terminated.`)),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){let{messageHandler:e,loadingTask:t}=this;e.on(`GetReader`,(e,t)=>{lC(this.#n,"GetReader - no `BasePDFStream` instance available."),this.#e=this.#n.getFullReader(),this.#e.onProgress=e=>this.#c(e),t.onPull=()=>{this.#e.read().then(function({value:e,done:n}){if(n){t.close();return}lC(e instanceof ArrayBuffer,`GetReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e])}).catch(e=>{t.error(e)})},t.onCancel=e=>{this.#e.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on(`ReaderHeadersReady`,async e=>{await this.#e.headersReady;let{isStreamingSupported:t,isRangeSupported:n,contentLength:r}=this.#e;return t&&n&&(this.#e.onProgress=null),{isStreamingSupported:t,isRangeSupported:n,contentLength:r}}),e.on(`GetRangeReader`,(e,t)=>{lC(this.#n,"GetRangeReader - no `BasePDFStream` instance available.");let n=this.#n.getRangeReader(e.begin,e.end);if(!n){t.close();return}t.onPull=()=>{n.read().then(function({value:e,done:n}){if(n){t.close();return}lC(e instanceof ArrayBuffer,`GetRangeReader - expected an ArrayBuffer.`),t.enqueue(new Uint8Array(e),1,[e])}).catch(e=>{t.error(e)})},t.onCancel=e=>{n.cancel(e),t.ready.catch(e=>{if(!this.destroyed)throw e})}}),e.on(`GetDoc`,({pdfInfo:e})=>{this.pagesMapper.pagesNumber=e.numPages,this._numPages=e.numPages,this._htmlForXfa=e.htmlForXfa,delete e.htmlForXfa,t._capability.resolve(new yD(e,this))}),e.on(`DocException`,e=>{t._capability.reject(OT(e))}),e.on(`PasswordRequest`,e=>{this.#o=Promise.withResolvers();try{if(!t.onPassword)throw OT(e);t.onPassword(e=>{e instanceof Error?this.#o.reject(e):this.#o.resolve({password:e})},e.code)}catch(e){this.#o.reject(e)}return this.#o.promise}),e.on(`DataLoaded`,e=>{this.#c({loaded:e.length,total:e.length}),this.downloadInfoCapability.resolve(e)}),e.on(`StartRenderPage`,e=>{this.destroyed||this.#r.get(e.pageIndex)._startRenderPage(e.transparency,e.cacheKey)}),e.on(`commonobj`,([t,n,r])=>{if(this.destroyed||this.commonObjs.has(t))return null;switch(n){case`Font`:if(`error`in r){let e=r.error;sC(`Error during font loading: ${e}`),this.commonObjs.resolve(t,e);break}let i=new cT(new gT(r),this._params.pdfBug&&globalThis.FontInspector?.enabled?(e,t)=>globalThis.FontInspector.fontAdded(e,t):null,r.charProcOperatorList,r.extra);this.fontLoader.bind(i).catch(()=>e.sendWithPromise(`FontFallback`,{id:t})).finally(()=>{i.fontExtraProperties||i.clearData(),this.commonObjs.resolve(t,i)});break;case`CopyLocalImage`:let{imageRef:a}=r;lC(a,`The imageRef must be defined.`);for(let e of this.#r.values())for(let[,n]of e.objs){if(n?.ref!==a)continue;if(!n.dataLen)return null;let e=structuredClone(n);return this.commonObjs.resolve(t,e),n.dataLen}break;case`FontPath`:this.commonObjs.resolve(t,new vT(r));break;case`Image`:this.commonObjs.resolve(t,r);break;case`Pattern`:let o=new _T(r);this.commonObjs.resolve(t,o.getIR());break;default:throw Error(`Got unknown common object type ${n}`)}return null}),e.on(`obj`,([e,t,n,r])=>{if(this.destroyed)return;let i=this.#r.get(t);if(!i.objs.has(e)){if(i._intentStates.size===0){r?.bitmap?.close();return}switch(n){case`Image`:case`Pattern`:i.objs.resolve(e,r);break;default:throw Error(`Got unknown object type ${n}`)}}}),e.on(`DocProgress`,e=>{this.destroyed||this.#c(e)}),e.on(`FetchBinaryData`,async e=>{if(this.destroyed)throw Error(`Worker was destroyed.`);if(!this.binaryDataFactory)throw Error("`BinaryDataFactory` not initialized, see the `useWorkerFetch` parameter.");return this.binaryDataFactory.fetch(e)})}getData(){return this.messageHandler.sendWithPromise(`GetData`,null)}saveDocument(){this.annotationStorage.size<=0&&sC("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");let{map:e,transfer:t}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise(`SaveDocument`,{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this.#e?.filename??null},t).finally(()=>{this.annotationStorage.resetModified()})}extractPages(e,t=null){let n={pageInfos:e},r,i=globalThis.ImageBitmap;if(typeof i==`function`){let t=Array.isArray(e)?e:[e];for(let e of t)e?.image instanceof i&&(r||=[]).push(e.image)}if(this.annotationStorage.size>0){let e=this.annotationStorage.serializable,{map:i}=e;e.transfer?.length&&(r?r.push(...e.transfer):r=e.transfer);let a=this.pagesMapper.getMapping();if(a){let e=new Map;for(let[n,r]of i){if(r?.pageIndex!==void 0&&r.pageIndex>=0&&r.pageIndex<a.length){let i=t?.[r.pageIndex]??0,o=a[r.pageIndex]-1;if(o!==r.pageIndex||i!==0){e.set(n,{...r,pageIndex:o,copyLevel:i});continue}}e.set(n,r)}i=e}n.annotationStorage=i}return this.messageHandler.sendWithPromise(`ExtractPages`,n,r).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this.pagesMapper.pagesNumber)return Promise.reject(Error(`Invalid page request.`));let t=e-1,n=this.pagesMapper.getPageId(e)-1,r=this.#i.get(t);if(r)return r;let i=this.messageHandler.sendWithPromise(`GetPage`,{pageIndex:n}).then(e=>{if(this.destroyed)throw Error(`Transport destroyed`);e.refStr&&this.#a.set(e.refStr,n);let r=new bD(t,e,this,this.pagesMapper,this._params.pdfBug);return this.#r.set(t,r),r});return this.#i.set(t,i),i}async getPageIndex(e){if(!ST(e))throw Error(`Invalid pageIndex request.`);let t=await this.messageHandler.sendWithPromise(`GetPageIndex`,{num:e.num,gen:e.gen}),n=this.pagesMapper.getPageNumber(t+1);if(n===0)throw Error(`GetPageIndex: page has been removed.`);return n-1}getAnnotations(e,t){return this.messageHandler.sendWithPromise(`GetAnnotations`,{pageIndex:this.pagesMapper.getPageId(e+1)-1,intent:t})}getFieldObjects(){return this.#s(`GetFieldObjects`)}getSignatures(){return this.#s(`GetSignatures`)}getSignatureData(e){return this.messageHandler.sendWithPromise(`GetSignatureData`,e)}hasJSActions(){return this.#s(`HasJSActions`)}getCalculationOrderIds(){return this.messageHandler.sendWithPromise(`GetCalculationOrderIds`,null)}getDestinations(){return this.messageHandler.sendWithPromise(`GetDestinations`,null)}getDestination(e){return typeof e==`string`?this.messageHandler.sendWithPromise(`GetDestination`,{id:e}):Promise.reject(Error(`Invalid destination request.`))}getPageLabels(){return this.messageHandler.sendWithPromise(`GetPageLabels`,null)}getPageLayout(){return this.messageHandler.sendWithPromise(`GetPageLayout`,null)}getPageMode(){return this.messageHandler.sendWithPromise(`GetPageMode`,null)}getViewerPreferences(){return this.messageHandler.sendWithPromise(`GetViewerPreferences`,null)}getOpenAction(){return this.messageHandler.sendWithPromise(`GetOpenAction`,null)}getAttachments(){return this.messageHandler.sendWithPromise(`GetAttachments`,null)}getAttachmentContent(e){return this.messageHandler.sendWithPromise(`GetAttachmentContent`,e)}getAnnotationsByType(e,t){return this.messageHandler.sendWithPromise(`GetAnnotationsByType`,{types:e,pageIndexesToSkip:t})}getDocJSActions(){return this.#s(`GetDocJSActions`)}getPageJSActions(e){return this.messageHandler.sendWithPromise(`GetPageJSActions`,{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getStructTree(e){return this.messageHandler.sendWithPromise(`GetStructTree`,{pageIndex:this.pagesMapper.getPageId(e+1)-1})}getOutline(){return this.messageHandler.sendWithPromise(`GetOutline`,null)}getOptionalContentConfig(e){return this.#s(`GetOptionalContentConfig`).then(t=>new sD(t,e))}getPermissions(){return this.messageHandler.sendWithPromise(`GetPermissions`,null)}getMetadata(){let e=`GetMetadata`;return this.#t.getOrInsertComputed(e,()=>this.messageHandler.sendWithPromise(e,null).then(e=>({info:e[0],metadata:e[1]?new iD(e[1]):null,contentDispositionFilename:this.#e?.filename??null,contentLength:this.#e?.contentLength??null,hasStructTree:e[2]})))}getMarkInfo(){return this.messageHandler.sendWithPromise(`GetMarkInfo`,null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise(`Cleanup`,null);for(let e of this.#r.values())if(!e.cleanup())throw Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#t.clear(),this.filterFactory.destroy(!0),mD.cleanup()}}cachedPageNumber(e){if(!ST(e))return null;let t=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`,n=this.#a.get(t);if(n>=0){let e=this.pagesMapper.getPageNumber(n+1);if(e!==0)return e}return null}},CD=class{_internalRenderTask=null;onContinue=null;onError=null;constructor(e){this._internalRenderTask=e}get promise(){return this._internalRenderTask.capability.promise}cancel(e=0){this._internalRenderTask.cancel(null,e)}get separateAnnots(){let{separateAnnots:e}=this._internalRenderTask.operatorList;if(!e)return!1;let{annotationCanvasMap:t}=this._internalRenderTask;return e.form||e.canvas&&t?.size>0}get imageCoordinates(){return this._internalRenderTask.imageCoordinates||null}},wD=class e{#e=null;static#t=new WeakSet;constructor({callback:e,params:t,objs:n,commonObjs:r,annotationCanvasMap:i,operatorList:a,pageIndex:o,canvasFactory:s,filterFactory:c,useRequestAnimationFrame:l=!1,pdfBug:u=!1,pageColors:d=null,enableHWA:f=!1,operationsFilter:p=null}){this.callback=e,this.params=t,this.objs=n,this.commonObjs=r,this.annotationCanvasMap=i,this.operatorListIdx=null,this.operatorList=a,this._pageIndex=o,this.canvasFactory=s,this.filterFactory=c,this._pdfBug=u,this.pageColors=d,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=l===!0&&typeof window<`u`,this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new CD(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=t.canvas,this._canvasContext=t.canvas?null:t.canvasContext,this._enableHWA=f,this._dependencyTracker=t.dependencyTracker,this._imagesTracker=t.imagesTracker,this._operationsFilter=p}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:t=!1,optionalContentConfig:n}){if(this.cancelled)return;if(this._canvas){if(e.#t.has(this._canvas))throw Error(`Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.`);e.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());let{viewport:r,transform:i,background:a,dependencyTracker:o,imagesTracker:s}=this.params,c=this._canvasContext||this._canvas.getContext(`2d`,{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new CE(c,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:n},this.annotationCanvasMap,this.pageColors,o,s),this.gfx.beginDrawing({transform:i,viewport:r,transparency:t,background:a}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(t=null,n=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&=(window.cancelAnimationFrame(this.#e),null),e.#t.delete(this._canvas),t||=new WC(`Rendering cancelled, page ${this._pageIndex+1}`,n),this.callback(t),this.task.onError?.(t)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),e.#t.delete(this._canvas),this.callback())))}},TD=`6.3.289`,ED=`1c8020a7d`,DD=class e{#e=null;#t=null;#n;#r=null;#i=!1;#a=!1;#o=null;#s;#c=null;#l=null;static#u=null;static get _keyboardManager(){return mC(this,`_keyboardManager`,new Dw([[[`Escape`],e.prototype._hideDropdownFromKeyboard],[[`Space`],e.prototype._colorSelectFromKeyboard],[[`ArrowDown`,`ArrowRight`],e.prototype._moveToNext],[[`ArrowUp`,`ArrowLeft`],e.prototype._moveToPrevious],[[`Home`],e.prototype._moveToBeginning],[[`End`],e.prototype._moveToEnd]]))}constructor({editor:t=null,uiManager:n=null}){t?(this.#a=!1,this.#o=t):this.#a=!0,this.#l=t?._uiManager||n,this.#s=this.#l._eventBus,this.#n=t?.color?.toUpperCase()||this.#l?.highlightColors.values().next().value||`#FFFF98`,e.#u||=Object.freeze({blue:`pdfjs-editor-colorpicker-blue`,green:`pdfjs-editor-colorpicker-green`,pink:`pdfjs-editor-colorpicker-pink`,red:`pdfjs-editor-colorpicker-red`,yellow:`pdfjs-editor-colorpicker-yellow`})}renderButton(){let e=this.#e=document.createElement(`button`);e.className=`colorPicker`,e.tabIndex=`0`,e.setAttribute(`data-l10n-id`,`pdfjs-editor-colorpicker-button`),e.ariaHasPopup=`true`,this.#o&&(e.ariaControls=`${this.#o.id}_colorpicker_dropdown`);let t=this.#l._signal;e.addEventListener(`click`,this.#m.bind(this),{signal:t}),e.addEventListener(`keydown`,this.#p.bind(this),{signal:t});let n=this.#t=document.createElement(`span`);return n.className=`swatch`,n.ariaHidden=`true`,n.style.backgroundColor=this.#n,e.append(n),e}renderMainDropdown(){let e=this.#r=this.#d();return e.ariaOrientation=`horizontal`,e.ariaLabelledBy=`highlightColorPickerLabel`,e}#d(){let t=document.createElement(`div`),n=this.#l._signal;t.addEventListener(`contextmenu`,ZC,{signal:n}),t.className=`dropdown`,t.role=`listbox`,t.ariaMultiSelectable=`false`,t.ariaOrientation=`vertical`,t.setAttribute(`data-l10n-id`,`pdfjs-editor-colorpicker-dropdown`),this.#o&&(t.id=`${this.#o.id}_colorpicker_dropdown`);for(let[r,i]of this.#l.highlightColors){let a=document.createElement(`button`);a.tabIndex=`0`,a.role=`option`,a.setAttribute(`data-color`,i),a.title=r,a.setAttribute(`data-l10n-id`,e.#u[r]);let o=document.createElement(`span`);a.append(o),o.className=`swatch`,o.style.backgroundColor=i,a.ariaSelected=i===this.#n,a.addEventListener(`click`,this.#f.bind(this,i),{signal:n}),t.append(a)}return t.addEventListener(`keydown`,this.#p.bind(this),{signal:n}),t}#f(e,t){t.stopPropagation(),this.#s.dispatch(`switchannotationeditorparams`,{source:this,type:qS.HIGHLIGHT_COLOR,value:e}),this.update(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#m(e);return}let t=e.target.getAttribute(`data-color`);t&&this.#f(t,e)}_moveToNext(e){if(!this.#g){this.#m(e);return}if(e.target===this.#e){this.#r.firstElementChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===this.#r?.firstElementChild||e.target===this.#e){this.#g&&this._hideDropdownFromKeyboard();return}this.#g||this.#m(e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!this.#g){this.#m(e);return}this.#r.firstElementChild?.focus()}_moveToEnd(e){if(!this.#g){this.#m(e);return}this.#r.lastElementChild?.focus()}#p(t){e._keyboardManager.exec(this,t)}#m(e){if(this.#g){this.hideDropdown();return}if(this.#i=e.detail===0,this.#c||(this.#c=new AbortController,window.addEventListener(`pointerdown`,this.#h.bind(this),{signal:this.#l.combinedSignal(this.#c)})),this.#e.ariaExpanded=`true`,this.#r){this.#r.classList.remove(`hidden`);return}let t=this.#r=this.#d();this.#e.append(t)}#h(e){this.#r?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#r?.classList.add(`hidden`),this.#e.ariaExpanded=`false`,this.#c?.abort(),this.#c=null}get#g(){return this.#r&&!this.#r.classList.contains(`hidden`)}_hideDropdownFromKeyboard(){if(!this.#a){if(!this.#g){this.#o?.unselect();return}this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#i})}}update(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#r)return;let t=this.#l.highlightColors.values();for(let n of this.#r.children)n.ariaSelected=t.next().value===e.toUpperCase()}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#r?.remove(),this.#r=null}},OD=class e{#e=null;#t=!1;#n=null;#r=null;static#i=null;constructor(t){this.#n=t,this.#r=t._uiManager,e.#i||=Object.freeze({freetext:`pdfjs-editor-color-picker-free-text-input`,ink:`pdfjs-editor-color-picker-ink-input`})}renderButton(){if(this.#e)return this.#e;let{editorType:t,colorType:n,colorAndOpacityType:r,opacityType:i,color:a,opacity:o}=this.#n,s=this.#t=wC.isAlphaColorInputSupported&&i!==void 0,c=this.#e=document.createElement(`input`);if(c.type=`color`,s){c.setAttribute(`alpha`,``);let e=TC.hexNums[Math.round((o??1)*255)];c.value=(a||`#000000`)+e}else c.value=a||`#000000`;return c.className=`basicColorPicker`,c.tabIndex=0,c.setAttribute(`data-l10n-id`,e.#i[t]),c.addEventListener(`input`,()=>{if(s){let e=ew(c.value);if(!e)return;let[t,a,o,s]=e,l=TC.makeHexColor(t,a,o);r===void 0?(this.#r.updateParams(n,l),this.#r.updateParams(i,s)):this.#r.updateParams(r,{color:l,opacity:s})}else this.#r.updateParams(n,c.value)},{signal:this.#r._signal}),c}update(e){if(this.#e)if(this.#t){let t=TC.hexNums[Math.round(this.#n.opacity*255)];this.#e.value=e+t}else this.#e.value=e}updateOpacity(e){if(!this.#e||!this.#t)return;let t=TC.hexNums[Math.round(e*255)];this.#e.value=this.#n.color+t}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}};function kD(e){return Math.floor(IC(e,0,1)*255).toString(16).padStart(2,`0`)}function AD(e){return IC(e,0,1)*255}var jD=class{static CMYK_G([e,t,n,r]){return[`G`,1-Math.min(1,.3*e+.59*n+.11*t+r)]}static G_CMYK([e]){return[`CMYK`,0,0,0,1-e]}static G_RGB([e]){return[`RGB`,e,e,e]}static G_rgb([e]){return e=AD(e),[e,e,e]}static G_HTML([e]){let t=kD(e);return`#${t}${t}${t}`}static RGB_G([e,t,n]){return[`G`,.3*e+.59*t+.11*n]}static RGB_rgb(e){return e.map(AD)}static RGB_HTML(e){return`#${e.map(kD).join(``)}`}static T_HTML(){return`#00000000`}static T_rgb(){return[null]}static CMYK_RGB([e,t,n,r]){return[`RGB`,1-Math.min(1,e+r),1-Math.min(1,n+r),1-Math.min(1,t+r)]}static CMYK_rgb([e,t,n,r]){return[AD(1-Math.min(1,e+r)),AD(1-Math.min(1,n+r)),AD(1-Math.min(1,t+r))]}static CMYK_HTML(e){let t=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(t)}static RGB_CMYK([e,t,n]){let r=1-e,i=1-t,a=1-n;return[`CMYK`,r,i,a,Math.min(r,i,a)]}},MD=class{create(e,t,n=!1){if(e<=0||t<=0)throw Error(`Invalid SVG dimensions`);let r=this._createSVG(`svg:svg`);return r.setAttribute(`version`,`1.1`),n||(r.setAttribute(`width`,`${e}px`),r.setAttribute(`height`,`${t}px`)),r.setAttribute(`preserveAspectRatio`,`none`),r.setAttribute(`viewBox`,`0 0 ${e} ${t}`),r}createElement(e){if(typeof e!=`string`)throw Error(`Invalid SVG element type`);return this._createSVG(e)}_createSVG(e){cC("Abstract method `_createSVG` called.")}},ND=class extends MD{_createSVG(e){return document.createElementNS(VS,e)}},PD=9,FD=new WeakSet,ID=new Date().getTimezoneOffset()*60*1e3,LD=class{static create(e){switch(e.data.annotationType){case ZS.LINK:return new BD(e);case ZS.TEXT:return new VD(e);case ZS.WIDGET:switch(e.data.fieldType){case`Tx`:return new UD(e);case`Btn`:return e.data.radioButton?new KD(e):e.data.checkBox?new GD(e):new qD(e);case`Ch`:return new JD(e);case`Sig`:return new WD(e)}return new HD(e);case ZS.POPUP:return new YD(e);case ZS.FREETEXT:return new ZD(e);case ZS.LINE:return new QD(e);case ZS.SQUARE:return new $D(e);case ZS.CIRCLE:return new eO(e);case ZS.POLYLINE:return new tO(e);case ZS.CARET:return new rO(e);case ZS.INK:return new iO(e);case ZS.POLYGON:return new nO(e);case ZS.HIGHLIGHT:return new aO(e);case ZS.UNDERLINE:return new oO(e);case ZS.SQUIGGLY:return new sO(e);case ZS.STRIKEOUT:return new cO(e);case ZS.STAMP:return new lO(e);case ZS.FILEATTACHMENT:return new uO(e);case ZS.RICHMEDIA:case ZS.SCREEN:case ZS.SOUND:return new dO(e);default:return new RD(e)}}},RD=class e{#e=null;#t=!1;#n=null;constructor(e,{isRenderable:t=!1,ignoreBorder:n=!1,createQuadrilaterals:r=!1}={}){this.isRenderable=t,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,t&&(this.contentElement=this.container=this._createContainer(n)),r&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:t}){return!!(e?.str||t?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return e._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){let{data:e}=this,t=this.annotationStorage?.getEditor(e.id);return t?t.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){let e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;let{quadPoints:t,inkLists:n,rect:r}=this.data,i=-1/0,a=-1/0;if(t?.length>=8){for(let e=0;e<t.length;e+=8)t[e+1]>a?(a=t[e+1],i=t[e+2]):t[e+1]===a&&(i=Math.max(i,t[e+2]));return[i,a]}if(n?.length>=1){for(let e of n)for(let t=0,n=e.length;t<n;t+=2)e[t+1]>a?(a=e[t+1],i=e[t]):e[t+1]===a&&(i=Math.max(i,e[t]));if(i!==1/0)return[i,a]}return r?[r[2],r[3]]:null}_normalizePoint(e){let{page:{view:t},viewport:{rawDims:{pageWidth:n,pageHeight:r,pageX:i,pageY:a}}}=this.parent;return e[1]=t[3]-e[1]+t[1],e[0]=100*(e[0]-i)/n,e[1]=100*(e[1]-a)/r,e}get commentText(){let{data:e}=this;return this.annotationStorage.getRawValue(`${GS}${e.id}`)?.popup?.contents||e.contentsObj?.str||``}set commentText(e){let{data:t}=this,n={deleted:!e,contents:e||``};this.annotationStorage.updateEditor(t.id,{popup:n})||this.annotationStorage.setValue(`${GS}${t.id}`,{id:t.id,annotationType:t.annotationType,page:this.parent.page,popup:n,popupRef:t.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(this.#n?.popup||this.popup)?.remove(),this.#n=this.popup=null}updateEdited(e){if(!this.container)return;e.rect&&(this.#e||={rect:this.data.rect.slice(0)});let{rect:t,popup:n}=e;t&&this.#r(t);let r=this.#n?.popup||this.popup;!r&&n?.text&&(this._createPopup(n),r=this.#n.popup),r&&(r.updateEdited(e),n?.deleted&&(r.remove(),this.#n=null,this.popup=null))}resetEdited(){this.#e&&=(this.#r(this.#e.rect),this.#n?.popup.resetEdited(),null)}#r(e){let{container:{style:t},data:{rect:n,rotation:r},parent:{viewport:{rawDims:{pageWidth:i,pageHeight:a,pageX:o,pageY:s}}}}=this;n?.splice(0,4,...e),t.left=`${100*(e[0]-o)/i}%`,t.top=`${100*(a-e[3]+s)/a}%`,r===0?(t.width=`${100*(e[2]-e[0])/i}%`,t.height=`${100*(e[3]-e[1])/a}%`):this.setRotation(r)}_createContainer(e){let{data:t,parent:{page:n,viewport:r}}=this,i=document.createElement(`section`);i.setAttribute(`data-annotation-id`,t.id),!(this instanceof HD)&&!(this instanceof BD)&&!(this instanceof dO)&&(i.tabIndex=0);let{style:a}=i;if(a.zIndex=this.parent.zIndex,this.parent.zIndex+=2,t.alternativeText&&(i.title=t.alternativeText),t.noRotate&&i.classList.add(`norotate`),!t.rect||this instanceof YD){let{rotation:e}=t;return!t.hasOwnCanvas&&e!==0&&this.setRotation(e,i),i}let{width:o,height:s}=this;if(!e&&t.borderStyle.width>0){a.borderWidth=`${t.borderStyle.width}px`;let e=t.borderStyle.horizontalCornerRadius,n=t.borderStyle.verticalCornerRadius;switch((e>0||n>0)&&(a.borderRadius=`calc(${e}px * var(--total-scale-factor)) / calc(${n}px * var(--total-scale-factor))`),t.borderStyle.style){case QS.SOLID:a.borderStyle=`solid`;break;case QS.DASHED:a.borderStyle=`dashed`;break;case QS.BEVELED:sC(`Unimplemented border style: beveled`);break;case QS.INSET:sC(`Unimplemented border style: inset`);break;case QS.UNDERLINE:a.borderBottomStyle=`solid`;break;default:break}let r=t.borderColor||null;r?(this.#t=!0,a.borderColor=TC.makeHexColor(...r)):a.borderWidth=0}let c=TC.normalizeRect([t.rect[0],n.view[3]-t.rect[1]+n.view[1],t.rect[2],n.view[3]-t.rect[3]+n.view[1]]),{pageWidth:l,pageHeight:u,pageX:d,pageY:f}=r.rawDims;a.left=`${100*(c[0]-d)/l}%`,a.top=`${100*(c[1]-f)/u}%`;let{rotation:p}=t;return t.hasOwnCanvas||p===0?(a.width=`${100*o/l}%`,a.height=`${100*s/u}%`):this.setRotation(p,i),i}setRotation(e,t=this.container){if(!this.data.rect)return;let{pageWidth:n,pageHeight:r}=this.parent.viewport.rawDims,{width:i,height:a}=this;e%180!=0&&([i,a]=[a,i]),t.style.width=`${100*i/n}%`,t.style.height=`${100*a/r}%`,t.setAttribute(`data-main-rotation`,(360-e)%360)}get _commonActions(){let e=(e,t,n)=>{let r=n.detail[e],i=r[0],a=r.slice(1);n.target.style[t]=jD[`${i}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[t]:jD[`${i}_rgb`](a)})};return mC(this,`_commonActions`,{display:e=>{let{display:t}=e.detail,n=t%2==1;this.container.style.visibility=n?`hidden`:`visible`,this.annotationStorage.setValue(this.data.id,{noView:n,noPrint:t===1||t===2})},print:e=>{this.annotationStorage.setValue(this.data.id,{noPrint:!e.detail.print})},hidden:e=>{let{hidden:t}=e.detail;this.container.style.visibility=t?`hidden`:`visible`,this.annotationStorage.setValue(this.data.id,{noPrint:t,noView:t})},focus:e=>{setTimeout(()=>e.target.focus({preventScroll:!1}),0)},userName:e=>{e.target.title=e.detail.userName},readonly:e=>{e.target.disabled=e.detail.readonly},required:e=>{this._setRequired(e.target,e.detail.required)},bgColor:t=>{e(`bgColor`,`backgroundColor`,t)},fillColor:t=>{e(`fillColor`,`backgroundColor`,t)},fgColor:t=>{e(`fgColor`,`color`,t)},textColor:t=>{e(`textColor`,`color`,t)},borderColor:t=>{e(`borderColor`,`borderColor`,t)},strokeColor:t=>{e(`strokeColor`,`borderColor`,t)},rotation:e=>{let t=e.detail.rotation;this.setRotation(t),this.annotationStorage.setValue(this.data.id,{rotation:t})}})}_dispatchEventFromSandbox(e,t){let n=this._commonActions;for(let r of Object.keys(t.detail))(e[r]||n[r])?.(t)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;let t=this.annotationStorage.getRawValue(this.data.id);if(!t)return;let n=this._commonActions;for(let[r,i]of Object.entries(t)){let a=n[r];a&&(a({detail:{[r]:i},target:e}),delete t[r])}}_createQuadrilaterals(){if(!this.container)return;let{quadPoints:e}=this.data;if(!e)return;let[t,n,r,i]=this.data.rect.map(Math.fround);if(e.length===8){let[a,o,s,c]=e.subarray(2,6);if(r===a&&i===o&&t===s&&n===c)return}let{style:a}=this.container,o;if(this.#t){let{borderColor:e,borderWidth:t}=a;a.borderWidth=0,o=[`url('data:image/svg+xml;utf8,`,`<svg xmlns="${VS}" preserveAspectRatio="none" viewBox="0 0 1 1">`,`<g fill="transparent" stroke="${e}" stroke-width="${t}">`],this.container.classList.add(`hasBorder`)}let s=r-t,c=i-n,{svgFactory:l}=this,u=l.createElement(`svg`);u.classList.add(`quadrilateralsContainer`),u.setAttribute(`width`,0),u.setAttribute(`height`,0),u.role=`none`;let d=l.createElement(`defs`);u.append(d);let f=l.createElement(`clipPath`),p=`clippath_${this.data.id}`;f.setAttribute(`id`,p),f.setAttribute(`clipPathUnits`,`objectBoundingBox`),d.append(f);for(let n=2,r=e.length;n<r;n+=8){let r=e[n],a=e[n+1],u=e[n+2],d=e[n+3],p=l.createElement(`rect`),m=(u-t)/s,h=(i-a)/c,g=(r-u)/s,_=(a-d)/c;p.setAttribute(`x`,m),p.setAttribute(`y`,h),p.setAttribute(`width`,g),p.setAttribute(`height`,_),f.append(p),o?.push(`<rect vector-effect="non-scaling-stroke" x="${m}" y="${h}" width="${g}" height="${_}"/>`)}this.#t&&(o.push(`</g></svg>')`),a.backgroundImage=o.join(``)),this.container.append(u),this.container.style.clipPath=`url(#${p})`}_createPopup(e=null){let{data:t}=this,n,r;e?(n={str:e.text},r=e.date):(n=t.contentsObj,r=t.modificationDate),this.#n=new YD({data:{color:t.color,titleObj:t.titleObj,modificationDate:r,contentsObj:n,richText:t.richText,parentRect:t.rect,borderStyle:0,id:`popup_${t.id}`,rotation:t.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#n||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#n}render(){cC("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,t=null){let n=[];if(this._fieldObjects){let r=this._fieldObjects.get(e)||[];for(let{page:e,id:i,exportValues:a}of r){if(e===-1||i===t)continue;let r=typeof a==`string`?a:null,o=document.querySelector(`[data-element-id="${i}"]`);if(o&&!FD.has(o)){sC(`_getElementsByName - element not allowed: ${i}`);continue}n.push({id:i,exportValue:r,domElement:o})}return n}for(let r of document.getElementsByName(e)){let{exportValue:e}=r,i=r.getAttribute(`data-element-id`);i!==t&&FD.has(r)&&n.push({id:i,exportValue:e,domElement:r})}return n}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){let e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(let t of e)t.classList.add(`highlightArea`);else e.classList.add(`highlightArea`)}_editOnDoubleClick(){if(!this._isEditable)return;let{annotationEditorType:e,data:{id:t}}=this;this.container.addEventListener(`dblclick`,()=>{this.linkService.eventBus?.dispatch(`switchannotationeditormode`,{source:this,mode:e,editId:t,mustEnterInEditMode:!0})})}updateOC(e){!this.data.oc||!e||(e.isVisible(this.data.oc)?this.show():this.hide())}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}_setBackgroundColor(e){let t=this.data.backgroundColor||null;e.style.backgroundColor=t===null?`transparent`:TC.makeHexColor(...t)}},zD=class extends RD{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className=`editorAnnotation`,this.container}createOrUpdatePopup(){let{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}},BD=class extends RD{constructor(e,t=null){super(e,{isRenderable:!0,ignoreBorder:!!t?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){let{data:e,linkService:t}=this,n=document.createElement(`a`);n.setAttribute(`data-element-id`,e.id);let r=!1;return e.url?(t.addLinkAttributes(n,e.url,e.newWindow),r=!0):e.action?(this._bindNamedAction(n,e.action,e.overlaidText),r=!0):e.attachment?(this.#t(n,e.attachmentId,e.attachment,e.overlaidText,e.attachmentDest),r=!0):e.setOCGState?(this.#n(n,e.setOCGState,e.overlaidText),r=!0):e.dest?(this._bindLink(n,e.dest,e.overlaidText),r=!0):(e.actions&&(e.actions.has(`Action`)||e.actions.has(`Mouse Up`)||e.actions.has(`Mouse Down`))&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(n,e),r=!0),e.resetForm?(this._bindResetFormAction(n,e.resetForm),r=!0):this.isTooltipOnly&&!r&&(this._bindLink(n,``),r=!0)),this.container.classList.add(`linkAnnotation`),r&&(this.contentElement=n,this.container.append(n)),this.container}#e(){this.container.setAttribute(`data-internal-link`,``)}_bindLink(e,t,n=``){e.href=this.linkService.getDestinationHash(t),e.onclick=()=>(t&&this.linkService.goToDestination(t),!1),(t||t===``)&&this.#e(),n&&(e.title=n)}_bindNamedAction(e,t,n=``){e.href=this.linkService.getAnchorUrl(``),e.onclick=()=>(this.linkService.executeNamedAction(t),!1),n&&(e.title=n),this.#e()}#t(e,t,n,r=``,i=null){e.href=this.linkService.getAnchorUrl(``),n.description?e.title=n.description:r&&(e.title=r);let a=async()=>{let e=await this.linkService.getAttachmentContent(t);e&&this.downloadManager?.openOrDownloadData(e,n.filename,i)};e.onclick=()=>(a(),!1),this.#e()}#n(e,t,n=``){e.href=this.linkService.getAnchorUrl(``),e.onclick=()=>(this.linkService.executeSetOCGState(t),!1),n&&(e.title=n),this.#e()}_bindJSAction(e,{actions:t,id:n,overlaidText:r}){e.href=this.linkService.getAnchorUrl(``);let i=new Map([[`Action`,`onclick`],[`Mouse Up`,`onmouseup`],[`Mouse Down`,`onmousedown`]]);for(let r of t.keys()){let t=i.get(r);t&&(e[t]=()=>(this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:n,name:r}}),!1))}r&&(e.title=r),e.onclick||=()=>!1,this.#e()}_bindResetFormAction(e,t){let n=e.onclick;if(n||(e.href=this.linkService.getAnchorUrl(``)),this.#e(),!this._fieldObjects){sC('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),n||(e.onclick=()=>!1);return}e.onclick=()=>{n?.();let{fields:e,refs:r,include:i}=t,a=[];if(e.length!==0||r.length!==0){let t=new Set(r);for(let n of e){let e=this._fieldObjects.get(n)||[];for(let{id:n}of e)t.add(n)}for(let e of this._fieldObjects.values())for(let n of e)t.has(n.id)===i&&a.push(n)}else for(let e of this._fieldObjects.values())a.push(...e);let o=this.annotationStorage,s=[];for(let e of a){let{id:t}=e;switch(s.push(t),e.type){case`text`:{let n=e.defaultValue||``;o.setValue(t,{value:n});break}case`checkbox`:case`radiobutton`:{let n=e.defaultValue===e.exportValues;o.setValue(t,{value:n});break}case`combobox`:case`listbox`:{let n=e.defaultValue||``;o.setValue(t,{value:n});break}default:continue}let n=document.querySelector(`[data-element-id="${t}"]`);if(n){if(!FD.has(n)){sC(`_bindResetFormAction - element not allowed: ${t}`);continue}n.dispatchEvent(new Event(`resetform`))}}return this.enableScripting&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:`app`,ids:s,name:`ResetForm`}}),!1}}},VD=class extends RD{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add(`textAnnotation`);let e=document.createElement(`img`);return e.src=this.imageResourcesPath+`annotation-`+this.data.name.toLowerCase()+`.svg`,e.setAttribute(`data-l10n-id`,`pdfjs-text-annotation-type`),e.setAttribute(`data-l10n-args`,JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}},HD=class extends RD{render(){return this.container}_getKeyModifier(e){return wC.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,t,n,r,i){n.includes(`mouse`)?e.addEventListener(n,e=>{this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:this.data.id,name:r,value:i(e),shift:e.shiftKey,modifier:this._getKeyModifier(e)}})}):e.addEventListener(n,e=>{if(n===`blur`){if(!t.focused||!e.relatedTarget)return;t.focused=!1}else if(n===`focus`){if(t.focused)return;t.focused=!0}i&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:this.data.id,name:r,value:i(e)}})})}_setEventListeners(e,t,n,r){let{actions:i}=this.data;for(let[a,o]of n)(o===`Action`||i?.has(o))&&((o===`Focus`||o===`Blur`)&&(t||={focused:!1}),this._setEventListener(e,t,a,o,r),o===`Focus`&&!i?.has(`Blur`)?this._setEventListener(e,t,`blur`,`Blur`,null):o===`Blur`&&!i?.has(`Focus`)&&this._setEventListener(e,t,`focus`,`Focus`,null))}_setTextStyle(e){let t=[`left`,`center`,`right`],{fontColor:n}=this.data.defaultAppearanceData,r=this.data.defaultAppearanceData.fontSize||PD,i=e.style,a,o=e=>Math.round(10*e)/10;if(this.data.multiLine){let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2),t=e/(Math.round(e/(1.35*r))||1);a=Math.min(r,o(t/1.35))}else{let e=Math.abs(this.data.rect[3]-this.data.rect[1]-2);a=Math.min(r,o(e/1.35))}i.fontSize=`calc(${a}px * var(--total-scale-factor))`,i.color=TC.makeHexColor(...n),this.data.textAlignment!==null&&!this.data.comb&&(i.textAlign=t[this.data.textAlignment])}_setRequired(e,t){t?e.setAttribute(`required`,!0):e.removeAttribute(`required`),e.setAttribute(`aria-required`,t)}},UD=class extends HD{constructor(e){let t=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:t})}setPropertyOnSiblings(e,t,n,r){let i=this.annotationStorage;for(let a of this._getElementsByName(e.name,e.id))a.domElement&&(a.domElement[t]=n),i.setValue(a.id,{[r]:n})}render(){let e=this.annotationStorage,t=this.data.id;this.container.classList.add(`textWidgetAnnotation`);let n=null;if(this.renderForms){let r=e.getValue(t,{value:this.data.fieldValue}),i=r.value||``,a=e.getValue(t,{charLimit:this.data.maxLen}).charLimit;a&&i.length>a&&(i=i.slice(0,a));let o=r.formattedValue||this.data.textContent?.join(`
|
|
123
|
+
`)||null;o&&this.data.comb&&(o=o.replaceAll(/\s+/g,``));let s={userValue:i,formattedValue:o,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(n=document.createElement(`textarea`),n.textContent=o??i,this.data.doNotScroll&&(n.style.overflowY=`hidden`)):(n=document.createElement(`input`),n.type=this.data.password?`password`:`text`,n.setAttribute(`value`,o??i),this.data.doNotScroll&&(n.style.overflowX=`hidden`)),this.data.hasOwnCanvas&&(this.container.classList.add(`hasOwnCanvas`),e.has(t)&&this.container.classList.add(`sandboxModified`)),FD.add(n),this.contentElement=n,n.setAttribute(`data-element-id`,t),n.disabled=this.data.readOnly,n.name=this.data.fieldName,n.tabIndex=0;let{datetimeFormat:c,datetimeType:l,timeStep:u}=this.data,d=!!l&&this.enableScripting;c&&(n.title=c),this._setRequired(n,this.data.required),a&&(n.maxLength=a),n.addEventListener(`input`,r=>{e.setValue(t,{value:r.target.value}),this.setPropertyOnSiblings(n,`value`,r.target.value,`value`),s.formattedValue=null}),n.addEventListener(`resetform`,e=>{let t=this.data.defaultFieldValue??``;n.value=s.userValue=t,s.formattedValue=null});let f=e=>{let{formattedValue:t}=s;t!=null&&(e.target.value=t),e.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){n.addEventListener(`focus`,e=>{if(s.focused)return;let{target:t}=e;if(d&&(t.type=l,u&&(t.step=u)),s.userValue){let e=s.userValue;if(d)if(l===`time`){let n=new Date(e);t.value=[n.getHours(),n.getMinutes(),n.getSeconds()].map(e=>e.toString().padStart(2,`0`)).join(`:`)}else t.value=new Date(e-ID).toISOString().split(l===`date`?`T`:`.`,1)[0];else t.value=e}s.lastCommittedValue=t.value,s.commitKey=1,this.data.actions?.has(`Focus`)||(s.focused=!0)}),n.addEventListener(`updatefromsandbox`,n=>{this.container.classList.add(`sandboxModified`),this._dispatchEventFromSandbox({value(n){s.userValue=n.detail.value??``,d||e.setValue(t,{value:s.userValue.toString()}),n.target.value=s.userValue},formattedValue(n){let{formattedValue:r}=n.detail;s.formattedValue=r,r!=null&&n.target!==document.activeElement&&(n.target.value=r);let i={formattedValue:r};d&&(i.value=r),e.setValue(t,i)},selRange(e){e.target.setSelectionRange(...e.detail.selRange)},charLimit:n=>{let{charLimit:r}=n.detail,{target:i}=n;if(r===0){i.removeAttribute(`maxLength`);return}i.setAttribute(`maxLength`,r);let a=s.userValue;!a||a.length<=r||(a=a.slice(0,r),i.value=s.userValue=a,e.setValue(t,{value:a}),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:a,willCommit:!0,commitKey:1,selStart:i.selectionStart,selEnd:i.selectionEnd}}))}},n)}),n.addEventListener(`keydown`,e=>{s.commitKey=1;let n=-1;if(e.key===`Escape`?n=0:e.key===`Enter`&&!this.data.multiLine?n=2:e.key===`Tab`&&(s.commitKey=3),n===-1)return;let{value:r}=e.target;s.lastCommittedValue!==r&&(s.lastCommittedValue=r,s.userValue=r,this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:r,willCommit:!0,commitKey:n,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}))});let r=f;f=null,n.addEventListener(`blur`,e=>{if(!s.focused||!e.relatedTarget)return;this.data.actions?.has(`Blur`)||(s.focused=!1);let{target:n}=e,{value:i}=n;if(d){if(i&&l===`time`){let e=i.split(`:`).map(e=>parseInt(e,10));i=new Date(2e3,0,1,e[0],e[1],e[2]||0).valueOf(),n.step=``}else i.includes(`T`)||(i=`${i}T00:00`),i=new Date(i).valueOf();n.type=`text`}s.userValue=i,s.lastCommittedValue!==i&&this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:i,willCommit:!0,commitKey:s.commitKey,selStart:e.target.selectionStart,selEnd:e.target.selectionEnd}}),r(e)}),this.data.actions?.has(`Keystroke`)&&n.addEventListener(`beforeinput`,e=>{s.lastCommittedValue=null;let{data:n,target:r}=e,{value:i,selectionStart:a,selectionEnd:o}=r,c=a,l=o;switch(e.inputType){case`deleteWordBackward`:{let e=/\w/;for(;c>0&&!e.test(i[c-1]);)c--;for(;c>0&&e.test(i[c-1]);)c--;break}case`deleteWordForward`:{let e=i.substring(a).match(/^\W*\w*/);e&&(l+=e[0].length);break}case`deleteContentBackward`:a===o&&--c;break;case`deleteContentForward`:a===o&&(l+=1);break}e.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:i,change:n||``,willCommit:!1,selStart:c,selEnd:l}})}),this._setEventListeners(n,s,[[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.value)}if(f&&n.addEventListener(`blur`,f),this.data.comb){let e=(this.data.rect[2]-this.data.rect[0])/a;n.classList.add(`comb`),n.style.setProperty(`--comb-width`,`calc(${e}px * var(--total-scale-factor))`);let t=this.data.textAlignment;if(t===1||t===2){let e=()=>{let e=a-n.value.length;n.style.setProperty(`--comb-offset`,`${t===1?e>>1:e}`)};e();for(let t of[`input`,`blur`,`resetform`,`updatefromsandbox`])n.addEventListener(t,e)}}}else n=document.createElement(`div`),n.textContent=this.data.fieldValue,n.style.verticalAlign=`middle`,n.style.display=`table-cell`,this.data.hasOwnCanvas&&(n.hidden=!0);return this._setTextStyle(n),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}},WD=class extends HD{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}},GD=class extends HD{constructor(e){super(e,{isRenderable:e.renderForms})}render(){let e=this.annotationStorage,t=this.data,n=t.id,r=e.getValue(n,{value:t.exportValue===t.fieldValue}).value;typeof r==`string`&&(r=r!==`Off`,e.setValue(n,{value:r})),this.container.classList.add(`buttonWidgetAnnotation`,`checkBox`);let i=document.createElement(`input`);return FD.add(i),i.setAttribute(`data-element-id`,n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type=`checkbox`,i.name=t.fieldName,r&&i.setAttribute(`checked`,!0),i.setAttribute(`exportValue`,t.exportValue),i.tabIndex=0,i.addEventListener(`change`,r=>{let{name:i,checked:a}=r.target;for(let r of this._getElementsByName(i,n)){let n=a&&r.exportValue===t.exportValue;r.domElement&&(r.domElement.checked=n),e.setValue(r.id,{value:n})}e.setValue(n,{value:a})}),i.addEventListener(`resetform`,e=>{let n=t.defaultFieldValue||`Off`;e.target.checked=n===t.exportValue}),this.enableScripting&&this.hasJSActions&&(i.addEventListener(`updatefromsandbox`,t=>{this._dispatchEventFromSandbox({value(t){t.target.checked=t.detail.value!==`Off`,e.setValue(n,{value:t.target.checked})}},t)}),this._setEventListeners(i,null,[[`change`,`Validate`],[`change`,`Action`],[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.checked)),this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},KD=class extends HD{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add(`buttonWidgetAnnotation`,`radioButton`);let e=this.annotationStorage,t=this.data,n=t.id,r=e.getValue(n,{value:t.buttonValue!==null&&t.fieldValue===t.buttonValue}).value;if(typeof r==`string`&&(r=r!==t.buttonValue,e.setValue(n,{value:r})),r)for(let r of this._getElementsByName(t.fieldName,n))e.setValue(r.id,{value:!1});let i=document.createElement(`input`);if(FD.add(i),i.setAttribute(`data-element-id`,n),i.disabled=t.readOnly,this._setRequired(i,this.data.required),i.type=`radio`,i.name=t.fieldName,r&&i.setAttribute(`checked`,!0),i.tabIndex=0,i.addEventListener(`change`,t=>{let{name:r,checked:i}=t.target;for(let t of this._getElementsByName(r,n))e.setValue(t.id,{value:!1});e.setValue(n,{value:i})}),i.addEventListener(`resetform`,e=>{let n=t.defaultFieldValue;e.target.checked=n!=null&&n===t.buttonValue}),this.enableScripting&&this.hasJSActions){let r=t.buttonValue;i.addEventListener(`updatefromsandbox`,t=>{this._dispatchEventFromSandbox({value:t=>{let i=r===t.detail.value;for(let r of this._getElementsByName(t.target.name)){let t=i&&r.id===n;r.domElement&&(r.domElement.checked=t),e.setValue(r.id,{value:t})}}},t)}),this._setEventListeners(i,null,[[`change`,`Validate`],[`change`,`Action`],[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`]],e=>e.target.checked)}return this._setDefaultPropertiesFromJS(i),this.container.append(i),this.container}},qD=class extends BD{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){let e=super.render();e.classList.add(`buttonWidgetAnnotation`,`pushButton`);let t=e.lastChild;return this.enableScripting&&this.hasJSActions&&t&&(this._setDefaultPropertiesFromJS(t),t.addEventListener(`updatefromsandbox`,e=>{this._dispatchEventFromSandbox({},e)})),e}},JD=class extends HD{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add(`choiceWidgetAnnotation`);let e=this.annotationStorage,t=this.data.id,n=e.getValue(t,{value:this.data.fieldValue}),r=document.createElement(`select`);FD.add(r),r.setAttribute(`data-element-id`,t),r.disabled=this.data.readOnly,this._setRequired(r,this.data.required),r.name=this.data.fieldName,r.tabIndex=0;let i=this.data.combo&&this.data.options.length>0;this.data.combo||(r.size=this.data.options.length,this.data.multiSelect&&(r.multiple=!0)),r.addEventListener(`resetform`,e=>{let t=this.data.defaultFieldValue;for(let e of r.options)e.selected=e.value===t});let a=(e,t)=>{let n=t.replaceAll(` `,`\xA0`);e.textContent=n,n!==t&&e.setAttribute(`display-value`,t)};for(let e of this.data.options){let t=document.createElement(`option`);a(t,e.displayValue),t.value=e.exportValue,n.value.includes(e.exportValue)&&(t.setAttribute(`selected`,!0),i=!1),r.append(t)}let o=null;if(i){let e=document.createElement(`option`);e.value=` `,e.setAttribute(`hidden`,!0),e.setAttribute(`selected`,!0),r.prepend(e),o=()=>{e.remove(),r.removeEventListener(`input`,o),o=null},r.addEventListener(`input`,o)}let s=e=>{let t=e?`value`:`textContent`,{options:n,multiple:i}=r;return i?Array.prototype.filter.call(n,e=>e.selected).map(e=>e[t]):n.selectedIndex===-1?null:n[n.selectedIndex][t]},c=s(!1),l=e=>{let t=e.target.options;return Array.prototype.map.call(t,e=>({displayValue:e.getAttribute(`display-value`)||e.textContent,exportValue:e.value}))};return this.enableScripting&&this.hasJSActions?(r.addEventListener(`updatefromsandbox`,n=>{this._dispatchEventFromSandbox({value(n){o?.();let i=n.detail.value,a=new Set(Array.isArray(i)?i:[i]);for(let e of r.options)e.selected=a.has(e.value);e.setValue(t,{value:s(!0)}),c=s(!1)},multipleSelection(e){r.multiple=!0},remove(n){let i=r.options,a=n.detail.remove;i[a].selected=!1,r.remove(a),i.length>0&&Array.prototype.findIndex.call(i,e=>e.selected)===-1&&(i[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},clear(n){for(;r.length!==0;)r.remove(0);e.setValue(t,{value:null,items:[]}),c=s(!1)},insert(n){let{index:i,displayValue:o,exportValue:u}=n.detail.insert,d=r.children[i],f=document.createElement(`option`);a(f,o),f.value=u,d?d.before(f):r.append(f),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},items(n){let{items:i}=n.detail;for(;r.length!==0;)r.remove(0);for(let e of i){let{displayValue:t,exportValue:n}=e,i=document.createElement(`option`);a(i,t),i.value=n,r.append(i)}r.options.length>0&&(r.options[0].selected=!0),e.setValue(t,{value:s(!0),items:l(n)}),c=s(!1)},indices(n){let r=new Set(n.detail.indices);for(let e of n.target.options)e.selected=r.has(e.index);e.setValue(t,{value:s(!0)}),c=s(!1)},editable(e){e.target.disabled=!e.detail.editable}},n)}),r.addEventListener(`input`,n=>{let r=s(!0),i=s(!1);e.setValue(t,{value:r}),n.preventDefault(),this.linkService.eventBus?.dispatch(`dispatcheventinsandbox`,{source:this,detail:{id:t,name:`Keystroke`,value:c,change:i,changeEx:r,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(r,null,[[`focus`,`Focus`],[`blur`,`Blur`],[`mousedown`,`Mouse Down`],[`mouseenter`,`Mouse Enter`],[`mouseleave`,`Mouse Exit`],[`mouseup`,`Mouse Up`],[`input`,`Action`],[`input`,`Validate`]],e=>e.target.value)):r.addEventListener(`input`,function(n){e.setValue(t,{value:s(!0)})}),this.data.combo&&this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}},YD=class extends RD{constructor(e){let{data:t,elements:n,parent:r}=e,i=!!r._commentManager;if(super(e,{isRenderable:!i&&RD._hasPopupData(t)}),this.elements=n,i&&RD._hasPopupData(t)){let e=this.popup=this.#e();for(let t of n)t.popup=e}else this.popup=null}#e(){return new XD({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}render(){let{container:e}=this;e.classList.add(`popupAnnotation`),e.role=`comment`;let t=this.popup=this.#e(),n=[];for(let e of this.elements)e.popup=t,e.container.ariaHasPopup=`dialog`,n.push(e.data.id),e.addHighlightArea();return this.container.setAttribute(`aria-controls`,n.map(e=>`${WS}${e}`).join(`,`)),this.container}},XD=class{#e=null;#t=this.#P.bind(this);#n=this.#R.bind(this);#r=this.#L.bind(this);#i=this.#I.bind(this);#a=null;#o=null;#s=null;#c=null;#l=null;#u=null;#d=null;#f=!1;#p=null;#m=null;#h=null;#g=null;#_=null;#v=null;#y=null;#b=null;#x=null;#S=null;#C=!1;#w=null;#T=null;constructor({container:e,color:t,elements:n,titleObj:r,modificationDate:i,contentsObj:a,richText:o,parent:s,rect:c,parentRect:l,open:u,commentManager:d=null}){this.#o=e,this.#x=r,this.#s=a,this.#b=o,this.#u=s,this.#a=t,this.#y=c,this.#d=l,this.#l=n,this.#e=d,this.#w=n[0],this.#c=$C.toDateObject(i),this.trigger=n.flatMap(e=>e.getElementsToTriggerPopup()),d||(this.#E(),this.#o.hidden=!0,u&&this.#I())}#E(){if(this.#m)return;this.#m=new AbortController;let{signal:e}=this.#m;for(let t of this.trigger)t.addEventListener(`click`,this.#i,{signal:e}),t.addEventListener(`pointerenter`,this.#r,{signal:e}),t.addEventListener(`pointerleave`,this.#n,{signal:e}),t.classList.add(`popupTriggerArea`);for(let t of this.#l)t.container?.addEventListener(`keydown`,this.#t,{signal:e})}#D(){let e=this.#l.find(e=>e.hasCommentButton);e&&(this.#_=e._normalizePoint(e.commentButtonPosition))}renderCommentButton(){if(this.#g){this.#g.parentNode||this.#w.container.after(this.#g);return}if(this.#_||this.#D(),!this.#_)return;let{signal:e}=this.#m=new AbortController,t=this.#w.hasOwnCommentButton,n=()=>{this.#e.toggleCommentPopup(this,!0,void 0,!t)},r=()=>{this.#e.toggleCommentPopup(this,!1,!0,!t)},i=()=>{this.#e.toggleCommentPopup(this,!1,!1)};if(t){this.#g=this.#w.container;for(let t of this.trigger)t.ariaHasPopup=`dialog`,t.ariaControls=`commentPopup`,t.addEventListener(`keydown`,this.#t,{signal:e}),t.addEventListener(`click`,n,{signal:e}),t.addEventListener(`pointerenter`,r,{signal:e}),t.addEventListener(`pointerleave`,i,{signal:e}),t.classList.add(`popupTriggerArea`)}else{let t=this.#g=document.createElement(`button`);t.className=`annotationCommentButton`;let a=this.#w.container;t.style.zIndex=parseInt(a.style.zIndex,10)+1,t.tabIndex=0,t.ariaHasPopup=`dialog`,t.ariaControls=`commentPopup`,t.setAttribute(`data-l10n-id`,`pdfjs-show-comment-button`),this.#k(),this.#O(),t.addEventListener(`keydown`,this.#t,{signal:e}),t.addEventListener(`click`,n,{signal:e}),t.addEventListener(`pointerenter`,r,{signal:e}),t.addEventListener(`pointerleave`,i,{signal:e}),a.after(t)}}#O(){if(this.#w.extraPopupElement&&!this.#w.editor)return;this.#g||this.renderCommentButton();let[e,t]=this.#_,{style:n}=this.#g;n.left=`calc(${e}%)`,n.top=`calc(${t}% - var(--comment-button-dim))`}#k(){this.#w.extraPopupElement||(this.#g||this.renderCommentButton(),this.#g.style.backgroundColor=this.commentButtonColor||``)}get commentButtonColor(){let{color:e,opacity:t}=this.#w.commentData;return e?this.#u._commentManager.makeCommentColor(e,t):null}focusCommentButton(){setTimeout(()=>{this.#g?.focus()},0)}getData(){let{richText:e,color:t,opacity:n,creationDate:r,modificationDate:i}=this.#w.commentData;return{contentsObj:{str:this.comment},richText:e,color:t,opacity:n,creationDate:r,modificationDate:i}}get elementBeforePopup(){return this.#g}get comment(){return this.#T||=this.#w.commentText,this.#T}set comment(e){e!==this.comment&&(this.#w.commentText=this.#T=e)}focus(){this.#w.container?.focus()}get parentBoundingClientRect(){return this.#w.layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:t}){this.#g&&(this.#g.classList.toggle(`selected`,e),this.#g.ariaExpanded=t)}setSelectedCommentButton(e){this.#g.classList.toggle(`selected`,e)}get commentPopupPosition(){if(this.#v)return this.#v;let{x:e,y:t,height:n}=this.#g.getBoundingClientRect(),{x:r,y:i,width:a,height:o}=this.#w.layer.getBoundingClientRect();return[(e-r)/a,(t+n-i)/o]}set commentPopupPosition(e){this.#v=e}hasDefaultPopupPosition(){return this.#v===null}get commentButtonPosition(){return this.#_}get commentButtonWidth(){return this.#g.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){let[t,n]=this.#v||this.commentButtonPosition.map(e=>e/100),r=this.parentBoundingClientRect,{x:i,y:a,width:o,height:s}=r;this.#e.showDialog(null,this,i+t*o,a+n*s,{...e,parentDimensions:r})}render(){if(this.#p)return;let e=this.#p=document.createElement(`div`);if(e.className=`popup`,this.#a){let t=e.style.outlineColor=TC.makeHexColor(...this.#a);e.style.backgroundColor=`color-mix(in srgb, ${t} 30%, white)`}let t=document.createElement(`span`);if(t.className=`header`,this.#x?.str){let e=document.createElement(`span`);e.className=`title`,t.append(e),{dir:e.dir,str:e.textContent}=this.#x}if(e.append(t),this.#c){let e=document.createElement(`time`);e.className=`popupDate`,e.setAttribute(`data-l10n-id`,`pdfjs-annotation-date-time-string`),e.setAttribute(`data-l10n-args`,JSON.stringify({dateObj:this.#c.valueOf()})),e.dateTime=this.#c.toISOString(),t.append(e)}_w({html:this.#A||this.#s.str,dir:this.#s?.dir,className:`popupContent`},e),this.#o.append(e)}get#A(){let e=this.#b,t=this.#s;return e?.str&&(!t?.str||t.str===e.str)&&this.#b.html||null}get#j(){return this.#A?.attributes?.style?.fontSize||0}get#M(){return this.#A?.attributes?.style?.color||null}#N(e){let t=[],n={str:e,html:{name:`div`,attributes:{dir:`auto`},children:[{name:`p`,children:t}]}},r={style:{color:this.#M,fontSize:this.#j?`calc(${this.#j}px * var(--total-scale-factor))`:``}};for(let n of e.split(`
|
|
124
|
+
`))t.push({name:`span`,value:n,attributes:r});return n}#P(e){e.altKey||e.shiftKey||e.ctrlKey||e.metaKey||(e.key===`Enter`||e.key===`Escape`&&this.#f)&&this.#I()}updateEdited({rect:e,popup:t,deleted:n}){if(this.#e){n?(this.remove(),this.#T=null):t&&(t.deleted?this.remove():(this.#k(),this.#T=t.text)),e&&(this.#_=null,this.#D(),this.#O());return}if(n||t?.deleted){this.remove();return}this.#E(),this.#S||={contentsObj:this.#s,richText:this.#b},e&&(this.#h=null),t&&t.text&&(this.#b=this.#N(t.text),this.#c=$C.toDateObject(t.date),this.#s=null),this.#p?.remove(),this.#p=null}resetEdited(){this.#S&&({contentsObj:this.#s,richText:this.#b}=this.#S,this.#S=null,this.#p?.remove(),this.#p=null,this.#h=null)}remove(){if(this.#m?.abort(),this.#m=null,this.#p?.remove(),this.#p=null,this.#C=!1,this.#f=!1,this.#g?.remove(),this.#g=null,this.trigger)for(let e of this.trigger)e.classList.remove(`popupTriggerArea`)}#F(){if(this.#h!==null)return;let{page:{view:e},viewport:{rawDims:{pageWidth:t,pageHeight:n,pageX:r,pageY:i}}}=this.#u,a=!!this.#d,o=a?this.#d:this.#y;for(let e of this.#l)if(!o||TC.intersect(e.data.rect,o)!==null){o=e.data.rect,a=!0;break}let s=TC.normalizeRect([o[0],e[3]-o[1]+e[1],o[2],e[3]-o[3]+e[1]]),c=a?o[2]-o[0]+5:0,l=s[0]+c,u=s[1];this.#h=[100*(l-r)/t,100*(u-i)/n];let{style:d}=this.#o;d.left=`${this.#h[0]}%`,d.top=`${this.#h[1]}%`}#I(){if(this.#e){this.#e.toggleCommentPopup(this,!1);return}this.#f=!this.#f,this.#f?(this.#L(),this.#o.addEventListener(`click`,this.#i),this.#o.addEventListener(`keydown`,this.#t)):(this.#R(),this.#o.removeEventListener(`click`,this.#i),this.#o.removeEventListener(`keydown`,this.#t))}#L(){this.#p||this.render(),this.isVisible?this.#f&&this.#o.classList.add(`focused`):(this.#F(),this.#o.hidden=!1,this.#o.style.zIndex=parseInt(this.#o.style.zIndex,10)+1e3)}#R(){this.#o.classList.remove(`focused`),!(this.#f||!this.isVisible)&&(this.#o.hidden=!0,this.#o.style.zIndex=parseInt(this.#o.style.zIndex,10)-1e3)}forceHide(){this.#C=this.isVisible,this.#C&&(this.#o.hidden=!0)}maybeShow(){this.#e||(this.#E(),this.#C&&(this.#p||this.#L(),this.#C=!1,this.#o.hidden=!1))}get isVisible(){return!this.#e&&this.#o.hidden===!1}},ZD=class extends RD{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.textContent=e.data.textContent,this.textPosition=e.data.textPosition,this.annotationEditorType=KS.FREETEXT}render(){if(this.container.classList.add(`freeTextAnnotation`),this.textContent){let e=this.contentElement=document.createElement(`div`);e.classList.add(`annotationTextContent`),e.setAttribute(`role`,`comment`);for(let t of this.textContent){let n=document.createElement(`span`);n.textContent=t,e.append(n)}this.container.append(e)}return!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},QD=class extends RD{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`lineAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=this.#e=this.svgFactory.createElement(`svg:line`);return i.setAttribute(`x1`,e.rect[2]-e.lineCoordinates[0]),i.setAttribute(`y1`,e.rect[3]-e.lineCoordinates[1]),i.setAttribute(`x2`,e.rect[2]-e.lineCoordinates[2]),i.setAttribute(`y2`,e.rect[3]-e.lineCoordinates[3]),i.setAttribute(`stroke-width`,e.borderStyle.width||1),i.setAttribute(`stroke`,`transparent`),i.setAttribute(`fill`,`transparent`),r.append(i),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},$D=class extends RD{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`squareAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,a=this.#e=this.svgFactory.createElement(`svg:rect`);return a.setAttribute(`x`,i/2),a.setAttribute(`y`,i/2),a.setAttribute(`width`,t-i),a.setAttribute(`height`,n-i),a.setAttribute(`stroke-width`,i||1),a.setAttribute(`stroke`,`transparent`),a.setAttribute(`fill`,`transparent`),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},eO=class extends RD{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){this.container.classList.add(`circleAnnotation`);let{data:e,width:t,height:n}=this,r=this.svgFactory.create(t,n,!0),i=e.borderStyle.width,a=this.#e=this.svgFactory.createElement(`svg:ellipse`);return a.setAttribute(`cx`,t/2),a.setAttribute(`cy`,n/2),a.setAttribute(`rx`,t/2-i/2),a.setAttribute(`ry`,n/2-i/2),a.setAttribute(`stroke-width`,i||1),a.setAttribute(`stroke`,`transparent`),a.setAttribute(`fill`,`transparent`),r.append(a),this.container.append(r),!e.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},tO=class extends RD{#e=null;constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`polylineAnnotation`,this.svgElementName=`svg:polyline`}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,vertices:t,borderStyle:n,popupRef:r},width:i,height:a}=this;if(!t)return this.container;let o=this.svgFactory.create(i,a,!0),s=[];for(let n=0,r=t.length;n<r;n+=2){let r=t[n]-e[0],i=e[3]-t[n+1];s.push(`${r},${i}`)}s=s.join(` `);let c=this.#e=this.svgFactory.createElement(this.svgElementName);return c.setAttribute(`points`,s),c.setAttribute(`stroke-width`,n.width||1),c.setAttribute(`stroke`,`transparent`),c.setAttribute(`fill`,`transparent`),o.append(c),this.container.append(o),!r&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}},nO=class extends tO{constructor(e){super(e),this.containerClassName=`polygonAnnotation`,this.svgElementName=`svg:polygon`}},rO=class extends RD{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0})}render(){return this.container.classList.add(`caretAnnotation`),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container}},iO=class extends RD{#e=null;#t=[];constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.containerClassName=`inkAnnotation`,this.svgElementName=`svg:polyline`,this.annotationEditorType=this.data.it===`InkHighlight`?KS.HIGHLIGHT:KS.INK}#n(e,t){switch(e){case 90:return{transform:`rotate(90) translate(${-t[0]},${t[1]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};case 180:return{transform:`rotate(180) translate(${-t[2]},${t[1]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]};case 270:return{transform:`rotate(270) translate(${-t[2]},${t[3]}) scale(1,-1)`,width:t[3]-t[1],height:t[2]-t[0]};default:return{transform:`translate(${-t[0]},${t[3]}) scale(1,-1)`,width:t[2]-t[0],height:t[3]-t[1]}}}render(){this.container.classList.add(this.containerClassName);let{data:{rect:e,rotation:t,inkLists:n,borderStyle:r,popupRef:i}}=this,{transform:a,width:o,height:s}=this.#n(t,e),c=this.svgFactory.create(o,s,!0),l=this.#e=this.svgFactory.createElement(`svg:g`);c.append(l),l.setAttribute(`stroke-width`,r.width||1),l.setAttribute(`stroke-linecap`,`round`),l.setAttribute(`stroke-linejoin`,`round`),l.setAttribute(`stroke-miterlimit`,10),l.setAttribute(`stroke`,`transparent`),l.setAttribute(`fill`,`transparent`),l.setAttribute(`transform`,a);for(let e of n){let t=this.svgFactory.createElement(this.svgElementName);this.#t.push(t),t.setAttribute(`points`,e.join(`,`)),l.append(t)}return!i&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(c),this._editOnDoubleClick(),this.container}updateEdited(e){super.updateEdited(e);let{thickness:t,points:n,rect:r}=e,i=this.#e;if(t>=0&&i.setAttribute(`stroke-width`,t||1),n)for(let e=0,t=this.#t.length;e<t;e++)this.#t[e].setAttribute(`points`,n[e].join(`,`));if(r){let{transform:e,width:t,height:n}=this.#n(this.data.rotation,r);i.parentElement.setAttribute(`viewBox`,`0 0 ${t} ${n}`),i.setAttribute(`transform`,e)}}getElementsToTriggerPopup(){return this.#t}addHighlightArea(){this.container.classList.add(`highlightArea`)}},aO=class extends RD{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0}),this.annotationEditorType=KS.HIGHLIGHT}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`highlightAnnotation`),this._editOnDoubleClick(),e){let t=document.createElement(`mark`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},oO=class extends RD{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`underlineAnnotation`),e){let t=document.createElement(`u`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},sO=class extends RD{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`squigglyAnnotation`),e){let t=document.createElement(`u`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},cO=class extends RD{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0,createQuadrilaterals:!0})}render(){let{data:{overlaidText:e,popupRef:t}}=this;if(!t&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.classList.add(`strikeoutAnnotation`),e){let t=document.createElement(`s`);t.classList.add(`overlaidText`),t.textContent=e,this.container.append(t)}return this.container}},lO=class extends RD{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.annotationEditorType=KS.STAMP}render(){return this.container.classList.add(`stampAnnotation`),this.container.setAttribute(`role`,`img`),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this._editOnDoubleClick(),this.container}},uO=class extends RD{#e=null;constructor(e){super(e,{isRenderable:!0});let{fileId:t,file:n}=this.data;this.filename=n.filename,this.content=n.content,this.fileId=t,this.linkService.eventBus?.dispatch(`fileattachmentannotation`,{source:this,attachmentId:this.fileId,...n})}render(){this.container.classList.add(`fileAttachmentAnnotation`);let{container:e,data:t}=this,n;t.hasAppearance||t.fillAlpha===0?n=document.createElement(`div`):(n=document.createElement(`img`),n.src=`${this.imageResourcesPath}annotation-${/paperclip/i.test(t.name)?`paperclip`:`pushpin`}.svg`,t.fillAlpha&&t.fillAlpha<1&&(n.style=`filter: opacity(${Math.round(t.fillAlpha*100)}%);`)),n.addEventListener(`dblclick`,this.#t.bind(this)),this.#e=n;let{isMac:r}=wC.platform;return e.addEventListener(`keydown`,e=>{e.key===`Enter`&&(r?e.metaKey:e.ctrlKey)&&this.#t()}),!t.popupRef&&this.hasPopupData?(this.hasOwnCommentButton=!0,this._createPopup()):n.classList.add(`popupTriggerArea`),e.append(n),e}getElementsToTriggerPopup(){return this.#e}addHighlightArea(){this.container.classList.add(`highlightArea`)}async#t(){let{fileId:e,filename:t,content:n}=this,r=await this.linkService.getAttachmentContent(e)||n;r&&this.downloadManager?.openOrDownloadData(r,t)}},dO=class extends RD{#e=new AbortController;#t=null;#n=null;constructor(e){super(e,{isRenderable:!!e.data.richMedia})}render(){this.container.classList.add(`mediaAnnotation`);let{filename:e}=this.data.richMedia,t=document.createElement(`button`);return t.className=`mediaPlayButton`,t.type=`button`,t.title=t.ariaLabel=e,t.addEventListener(`click`,()=>this.#r(t),{signal:this.#e.signal}),this.container.append(t),this.container}async#r(e){let{fileId:t,filename:n,contentType:r}=this.data.richMedia;e.disabled=!0;let i;try{i=await this.linkService.getAttachmentContent(t)}catch{return}finally{e.disabled=!1}if(!i||!e.isConnected)return;let{signal:a}=this.#e,o=URL.createObjectURL(new Blob([i],{type:r}));this.#t=o;let s=r.startsWith(`audio/`),c=document.createElement(s?`audio`:`video`);if(this.#n=c,c.className=`mediaContent`,this._setBackgroundColor(c),c.src=o,c.title=n,c.controls=!0,c.autoplay=!0,c.tabIndex=0,s){let e=!1,t=!1,n=()=>{c.controls=e||t};this.container.addEventListener(`pointerenter`,()=>{e=!0,n()},{signal:a}),this.container.addEventListener(`pointerleave`,()=>{e=!1,n()},{signal:a}),this.container.addEventListener(`focusin`,()=>{t=!0,n()},{signal:a}),this.container.addEventListener(`focusout`,()=>{t=!1,n()},{signal:a})}c.addEventListener(`emptied`,()=>this.#i(o),{once:!0,signal:a}),e.replaceWith(c),c.play().catch(()=>{})}#i(e=this.#t){e&&e===this.#t&&(URL.revokeObjectURL(e),this.#t=null)}destroy(){this.#e.abort(),this.#n&&=(this.#n.pause(),this.#n.removeAttribute(`src`),this.#n.load(),null),this.#i()}},fO=class e{#e=null;#t=null;#n=null;#r=new Map;#i=null;#a=null;#o=[];#s=!1;zIndex=0;constructor({div:e,accessibilityManager:t,annotationCanvasMap:n,annotationEditorUIManager:r,page:i,viewport:a,structTreeLayer:o,commentManager:s,linkService:c,annotationStorage:l}){this.div=e,this.#e=t,this.#t=n,this.#i=o||null,this.#a=c||null,this.#n=l||new Uw,this.page=i,this.viewport=a,this._annotationEditorUIManager=r,this._commentManager=s||null}hasEditableAnnotations(){return this.#r.size>0}async render(e){let{annotations:t,optionalContentConfig:n}=e,r=this.div;aw(r,this.viewport);let i=new Map,a=[],o={data:null,layer:r,linkService:this.#a,downloadManager:e.downloadManager,imageResourcesPath:e.imageResourcesPath||``,renderForms:e.renderForms!==!1,svgFactory:new ND,annotationStorage:this.#n,enableComment:e.enableComment===!0,enableScripting:e.enableScripting===!0,hasJSActions:e.hasJSActions,fieldObjects:e.fieldObjects,parent:this,elements:null};for(let e of t){if(e.noHTML)continue;let t=e.annotationType===ZS.POPUP;if(t){let t=i.get(e.id);if(!t)continue;if(!this._commentManager){a.push(e);continue}o.elements=t}else if(e.rect[2]===e.rect[0]||e.rect[3]===e.rect[1])continue;o.data=e;let r=LD.create(o);if(!r.isRenderable)continue;t||(this.#o.push(r),e.popupRef&&i.getOrInsertComputed(e.popupRef,MC).push(r));let s=r.render();e.hidden&&(s.style.visibility=`hidden`),r.updateOC(n),r._isEditable&&(this.#r.set(r.data.id,r),this._annotationEditorUIManager?.renderAnnotationElement(r))}await this.#c();for(let e of a){let t=o.elements=i.get(e.id);o.data=e;let n=LD.create(o);if(!n.isRenderable)continue;let r=n.render();n.contentElement.id=`${WS}${e.id}`,e.hidden&&(r.style.visibility=`hidden`),t.at(-1).container.after(r)}this.#l()}async#c(){if(this.#o.length===0)return;this.div.replaceChildren();let e=[];if(!this.#s){this.#s=!0;for(let{contentElement:t,data:{hidden:n,id:r,oc:i}}of this.#o){let a=t.id=`${WS}${r}`,o=t.localName===`a`&&!n&&!i;e.push(this.#i?.getAriaAttributes(a,{enableLinkOwnership:o}).then(e=>{if(e)for(let[n,r]of e)t.setAttribute(n,r)}))}}this.#o.sort(({data:{rect:[e,t,n,r]}},{data:{rect:[i,a,o,s]}})=>{if(e===n&&t===r)return 1;if(i===o&&a===s)return-1;let c=r,l=t,u=(t+r)/2,d=s,f=a,p=(a+s)/2;return u>=d&&p<=l?-1:p>=c&&u<=f?1:(e+n)/2-(i+o)/2});let t=document.createDocumentFragment();for(let e of this.#o)t.append(e.container),this._commentManager?(e.extraPopupElement?.popup||e.popup)?.renderCommentButton():e.extraPopupElement&&t.append(e.extraPopupElement.render());if(this.div.append(t),await Promise.all(e),this.#e){let e=await this.#i?.getAnnotationIds();for(let{contentElement:t}of this.#o)e?.has(t.id)||this.#e.addPointerInTextLayer(t,!1)}}async addLinkAnnotations(t){let n={data:null,layer:this.div,linkService:this.#a,svgFactory:new ND,parent:this};for(let r of t){r.borderStyle||=e._defaultBorderStyle,n.data=r;let t=LD.create(n);t.isRenderable&&(t.render(),t.contentElement.id=`${WS}${r.id}`,this.#o.push(t))}await this.#c()}update({viewport:e,optionalContentConfig:t}){let n=this.div;this.viewport=e,aw(n,{rotation:e.rotation});for(let e of this.#o)e.updateOC(t);this.#l(),n.hidden=!1}destroy(){for(let e of this.#o)e.destroy?.(),this.#e?.removePointerInTextLayer(e.contentElement);this.#o.length=0,this.#r.clear(),this.div.replaceChildren()}#l(){if(!this.#t)return;let e=this.div;for(let[t,n]of this.#t){let r=e.querySelector(`[data-annotation-id="${t}"]`);if(!r)continue;if(Array.isArray(n))for(let e of n)e.className=`annotationContent`,e.ariaHidden=!0;else n.className=`annotationContent`,n.ariaHidden=!0;let i=[];for(let e of r.children)e.nodeName===`CANVAS`&&i.push(e);for(let e of i)e.remove();let a=Array.isArray(n)?n[0]:n,{firstChild:o}=r;if(o?o.classList.contains(`annotationContent`)?o.after(a):o.before(a):r.append(a),Array.isArray(n)){let e=a;for(let t=1,r=n.length;t<r;t++)e.after(n[t]),e=n[t]}this.#t.delete(t);let s=this.#r.get(t);s&&(s._hasNoCanvas?(this._annotationEditorUIManager?.setMissingCanvas(t,r.id,n),s._hasNoCanvas=!1):s.canvas=n)}}refreshCanvases(){this.#l()}getEditableAnnotations(){return this.#r.values()}getEditableAnnotation(e){return this.#r.get(e)}addFakeAnnotation(e){let{div:t}=this,{id:n,rotation:r}=e,i=new zD({data:{id:n,rect:e.getPDFRect(),rotation:r},editor:e,layer:t,parent:this,enableComment:!!this._commentManager,linkService:this.#a,annotationStorage:this.#n});return i.render(),i.contentElement.id=`${WS}${n}`,i.createOrUpdatePopup(),this.#o.push(i),i}removeAnnotation(e){let t=this.#o.findIndex(t=>t.data.id===e);if(t<0)return;let[n]=this.#o.splice(t,1);this.#e?.removePointerInTextLayer(n.contentElement)}updateFakeAnnotations(e){if(e.length!==0){for(let t of e)t.updateFakeAnnotationElement(this);this.#c()}}togglePointerEvents(e=!1){this.div.classList.toggle(`disabled`,!e)}static get _defaultBorderStyle(){return mC(this,`_defaultBorderStyle`,Object.freeze({width:1,rawWidth:1,style:QS.SOLID,dashArray:[3],horizontalCornerRadius:0,verticalCornerRadius:0}))}},pO=/\r\n?|\n/g,mO=class e extends Iw{#e=``;#t=`${this.id}-editor`;#n=null;#r;_colorPicker=null;static _freeTextDefaultContent=``;static _internalPadding=0;static _defaultColor=null;static _defaultFontSize=10;static get _keyboardManager(){let t=e.prototype,n=e=>e.isEmpty(),r=kw.TRANSLATE_SMALL,i=kw.TRANSLATE_BIG;return mC(this,`_keyboardManager`,new Dw([[[`ctrl+s`,`mac+meta+s`,`ctrl+p`,`mac+meta+p`],t.commitOrRemove,{bubbles:!0}],[[`ctrl+Enter`,`mac+meta+Enter`],t.commitOrRemove],[[`Escape`],t.commitOrRemove],[[`ArrowLeft`],t._translateEmpty,{args:[-r,0],checker:n}],[[`ctrl+ArrowLeft`,`mac+shift+ArrowLeft`],t._translateEmpty,{args:[-i,0],checker:n}],[[`ArrowRight`],t._translateEmpty,{args:[r,0],checker:n}],[[`ctrl+ArrowRight`,`mac+shift+ArrowRight`],t._translateEmpty,{args:[i,0],checker:n}],[[`ArrowUp`],t._translateEmpty,{args:[0,-r],checker:n}],[[`ctrl+ArrowUp`,`mac+shift+ArrowUp`],t._translateEmpty,{args:[0,-i],checker:n}],[[`ArrowDown`],t._translateEmpty,{args:[0,r],checker:n}],[[`ctrl+ArrowDown`,`mac+shift+ArrowDown`],t._translateEmpty,{args:[0,i],checker:n}]]))}static _type=`freetext`;static _editorType=KS.FREETEXT;constructor(t){super({...t,name:`freeTextEditor`}),this.color=t.color||e._defaultColor||Iw._defaultLineColor,this.#r=t.fontSize||e._defaultFontSize,this.annotationElementId||this._uiManager.a11yAlert(Iw._l10nAlert.freetext),this.canAddComment=!1}static initialize(e,t){Iw.initialize(e,t);let n=getComputedStyle(document.documentElement);this._internalPadding=parseFloat(n.getPropertyValue(`--freetext-padding`))}static updateDefaultParams(t,n){switch(t){case qS.FREETEXT_SIZE:e._defaultFontSize=n;break;case qS.FREETEXT_COLOR:e._defaultColor=n;break}}updateParams(e,t){switch(e){case qS.FREETEXT_SIZE:this.#i(t);break;case qS.FREETEXT_COLOR:this.#a(t);break}}static get defaultPropertiesToUpdate(){return[[qS.FREETEXT_SIZE,e._defaultFontSize],[qS.FREETEXT_COLOR,e._defaultColor||Iw._defaultLineColor]]}get propertiesToUpdate(){return[[qS.FREETEXT_SIZE,this.#r],[qS.FREETEXT_COLOR,this.color]]}get toolbarButtons(){return this._colorPicker||=new OD(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return qS.FREETEXT_COLOR}#i(e){let t=e=>{this.editorDiv.style.fontSize=`calc(${e}px * var(--total-scale-factor))`,this.translate(0,-(e-this.#r)*this.parentScale),this.#r=e,this.#s()},n=this.#r;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:qS.FREETEXT_SIZE,overwriteIfSameType:!0,keepUndo:!0})}onUpdatedColor(){this.editorDiv.style.color=this.color,this._colorPicker?.update(this.color),super.onUpdatedColor()}#a(e){let t=e=>{this.color=e,this.onUpdatedColor()},n=this.color;this.addCommands({cmd:t.bind(this,e),undo:t.bind(this,n),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:qS.FREETEXT_COLOR,overwriteIfSameType:!0,keepUndo:!0})}_translateEmpty(e,t){this._uiManager.translateSelectedEditors(e,t,!0)}getInitialTranslation(){let t=this.parentScale;return[-e._internalPadding*t,-(e._internalPadding+this.#r)*t]}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.isAttachedToDOM||this.parent.add(this)))}enableEditMode(){if(!super.enableEditMode())return!1;this.overlayDiv.classList.remove(`enabled`),this.editorDiv.contentEditable=!0,this._isDraggable=!1,this.div.removeAttribute(`aria-activedescendant`),this.#n=new AbortController;let e=this._uiManager.combinedSignal(this.#n);return this.editorDiv.addEventListener(`keydown`,this.editorDivKeydown.bind(this),{signal:e}),this.editorDiv.addEventListener(`focus`,this.editorDivFocus.bind(this),{signal:e}),this.editorDiv.addEventListener(`blur`,this.editorDivBlur.bind(this),{signal:e}),this.editorDiv.addEventListener(`input`,this.editorDivInput.bind(this),{signal:e}),this.editorDiv.addEventListener(`paste`,this.editorDivPaste.bind(this),{signal:e}),!0}disableEditMode(){return super.disableEditMode()?(this.overlayDiv.classList.add(`enabled`),this.editorDiv.contentEditable=!1,this.div.setAttribute(`aria-activedescendant`,this.#t),this._isDraggable=!0,this.#n?.abort(),this.#n=null,this.div.focus({preventScroll:!0}),this.isEditing=!1,this.parent.div.classList.add(`freetextEditing`),!0):!1}focusin(e){this._focusEventsAllowed&&(super.focusin(e),e.target!==this.editorDiv&&this.editorDiv.focus())}onceAdded(e){this.width||(this.enableEditMode(),e&&this.editorDiv.focus(),this._initialOptions?.isCentered&&this.center(),this._initialOptions=null)}isEmpty(){return!this.editorDiv||this.editorDiv.innerText.trim()===``}remove(){this.isEditing=!1,this.parent&&(this.parent.setEditingState(!0),this.parent.div.classList.add(`freetextEditing`)),super.remove()}#o(){let t=[];this.editorDiv.normalize();let n=null;for(let r of this.editorDiv.childNodes)n?.nodeType===Node.TEXT_NODE&&r.nodeName===`BR`||(t.push(e.#c(r)),n=r);return t.join(`
|
|
125
|
+
`)}#s(){let[e,t]=this.parentDimensions,n;if(this.isAttachedToDOM)n=this.div.getBoundingClientRect();else{let{currentLayer:e,div:t}=this,r=t.style.display,i=t.classList.contains(`hidden`);t.classList.remove(`hidden`),t.style.display=`hidden`,e.div.append(this.div),n=t.getBoundingClientRect(),t.remove(),t.style.display=r,t.classList.toggle(`hidden`,i)}this.rotation%180==this.parentRotation%180?(this.width=n.width/e,this.height=n.height/t):(this.width=n.height/e,this.height=n.width/t),this.fixAndSetPosition()}commit(){if(!this.isInEditMode())return;super.commit(),this.disableEditMode();let e=this.#e,t=this.#e=this.#o().trimEnd();if(e===t)return;let n=e=>{if(this.#e=e,!e){this.remove();return}this.#l(),this._uiManager.rebuild(this),this.#s()};this.addCommands({cmd:()=>{n(t)},undo:()=>{n(e)},mustExec:!1}),this.#s()}shouldGetKeyboardEvents(){return this.isInEditMode()}enterInEditMode(){this.enableEditMode(),this.editorDiv.focus()}keydown(e){e.target===this.div&&e.key===`Enter`&&(this.enterInEditMode(),e.preventDefault())}editorDivKeydown(t){e._keyboardManager.exec(this,t)}editorDivFocus(e){this.isEditing=!0}editorDivBlur(e){this.isEditing=!1}editorDivInput(e){this.parent.div.classList.toggle(`freetextEditing`,this.isEmpty())}disableEditing(){this.editorDiv.setAttribute(`role`,`comment`),this.editorDiv.removeAttribute(`aria-multiline`)}enableEditing(){this.editorDiv.setAttribute(`role`,`textbox`),this.editorDiv.setAttribute(`aria-multiline`,!0)}get canChangeContent(){return!0}render(){if(this.div)return this.div;let e,t;(this._isCopy||this.annotationElementId)&&(e=this.x,t=this.y),super.render(),this.editorDiv=document.createElement(`div`),this.editorDiv.className=`internal`,this.editorDiv.setAttribute(`id`,this.#t),this.editorDiv.setAttribute(`data-l10n-id`,`pdfjs-free-text2`),this.editorDiv.setAttribute(`data-l10n-attrs`,`default-content`),this.enableEditing(),this.editorDiv.contentEditable=!0;let{style:n}=this.editorDiv;if(n.fontSize=`calc(${this.#r}px * var(--total-scale-factor))`,n.color=this.color,this.div.append(this.editorDiv),this.overlayDiv=document.createElement(`div`),this.overlayDiv.classList.add(`overlay`,`enabled`),this.div.append(this.overlayDiv),this._isCopy||this.annotationElementId){let[n,r]=this.parentDimensions;if(this.annotationElementId){let{position:i}=this._initialData,[a,o]=this.getInitialTranslation();[a,o]=this.pageTranslationToScreen(a,o);let[s,c]=this.pageDimensions,[l,u]=this.pageTranslation,d,f;switch(this.rotation){case 0:d=e+(i[0]-l)/s,f=t+this.height-(i[1]-u)/c;break;case 90:d=e+(i[0]-l)/s,f=t-(i[1]-u)/c,[a,o]=[o,-a];break;case 180:d=e-this.width+(i[0]-l)/s,f=t-(i[1]-u)/c,[a,o]=[-a,-o];break;case 270:d=e+(i[0]-l-this.height*c)/s,f=t+(i[1]-u-this.width*s)/c,[a,o]=[-o,a];break}this.setAt(d*n,f*r,a,o)}else this._moveAfterPaste(e,t);this.#l(),this._isDraggable=!0,this.editorDiv.contentEditable=!1}else this._isDraggable=!1,this.editorDiv.contentEditable=!0;return this.div}static#c(e){return(e.nodeType===Node.TEXT_NODE?e.nodeValue:e.innerText).replaceAll(pO,``)}editorDivPaste(t){let n=t.clipboardData||window.clipboardData,{types:r}=n;if(r.length===1&&r[0]===`text/plain`)return;t.preventDefault();let i=e.#d(n.getData(`text`)||``).replaceAll(pO,`
|
|
126
|
+
`);if(!i)return;let a=window.getSelection();if(!a.rangeCount)return;this.editorDiv.normalize(),a.deleteFromDocument();let o=a.getRangeAt(0);if(!i.includes(`
|
|
127
|
+
`)){o.insertNode(document.createTextNode(i)),this.editorDiv.normalize(),a.collapseToStart();return}let{startContainer:s,startOffset:c}=o,l=[],u=[];if(s.nodeType===Node.TEXT_NODE){let t=s.parentElement;if(u.push(s.nodeValue.slice(c).replaceAll(pO,``)),t!==this.editorDiv){let n=l;for(let r of this.editorDiv.childNodes){if(r===t){n=u;continue}n.push(e.#c(r))}}l.push(s.nodeValue.slice(0,c).replaceAll(pO,``))}else if(s===this.editorDiv){let t=l,n=0;for(let r of this.editorDiv.childNodes)n++===c&&(t=u),t.push(e.#c(r))}this.#e=`${l.join(`
|
|
128
|
+
`)}${i}${u.join(`
|
|
129
|
+
`)}`,this.#l();let d=new Range,f=Math.sumPrecise(l.map(e=>e.length));for(let{firstChild:e}of this.editorDiv.childNodes)if(e.nodeType===Node.TEXT_NODE){let t=e.nodeValue.length;if(f<=t){d.setStart(e,f),d.setEnd(e,f);break}f-=t}a.removeAllRanges(),a.addRange(d)}#l(){if(this.editorDiv.replaceChildren(),this.#e)for(let e of this.#e.split(`
|
|
130
|
+
`)){let t=document.createElement(`div`);t.append(e?document.createTextNode(e):document.createElement(`br`)),this.editorDiv.append(t)}}#u(){return this.#e.replaceAll(`\xA0`,` `)}static#d(e){return e.replaceAll(` `,`\xA0`)}get contentDiv(){return this.editorDiv}getPDFRect(){let t=e._internalPadding*this.parentScale;return this.getRect(t,t)}static async deserialize(t,n,r){let i=null;if(t instanceof ZD){let{data:{defaultAppearanceData:{fontSize:e,fontColor:n},rect:r,rotation:a,id:o,popupRef:s,richText:c,contentsObj:l,creationDate:u,modificationDate:d},textContent:f,textPosition:p,parent:{page:{pageNumber:m}}}=t;if(!f?.length)return null;i=t={annotationType:KS.FREETEXT,color:Array.from(n),fontSize:e,value:f.join(`
|
|
131
|
+
`),position:p,pageIndex:m-1,rect:r.slice(0),rotation:a,annotationElementId:o,id:o,deleted:!1,popupRef:s,comment:l?.str||null,richText:c,creationDate:u,modificationDate:d}}let a=await super.deserialize(t,n,r);return a.#r=t.fontSize,a.color=TC.makeHexColor(...t.color),a.#e=e.#d(t.value),a._initialData=i,t.comment&&a.setCommentData(t),a}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let t=Iw._colorManager.convert(this.isAttachedToDOM?getComputedStyle(this.editorDiv).color:this.color),n=Object.assign(super.serialize(e),{color:t,fontSize:this.#r,value:this.#u()});return this.addComment(n),e?(n.isCopy=!0,n):this.annotationElementId&&!this.#f(n)?null:(n.id=this.annotationElementId,n)}#f(e){let{value:t,fontSize:n,color:r,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||e.value!==t||e.fontSize!==n||e.color.some((e,t)=>e!==r[t])||e.pageIndex!==i}renderAnnotationElement(e){let t=super.renderAnnotationElement(e);if(!t)return null;let{style:n}=t;n.fontSize=`calc(${this.#r}px * var(--total-scale-factor))`,n.color=this.color,t.replaceChildren();for(let e of this.#e.split(`
|
|
132
|
+
`)){let n=document.createElement(`div`);n.append(e?document.createTextNode(e):document.createElement(`br`)),t.append(n)}return e.updateEdited({rect:this.getPDFRect(),popup:this._uiManager.hasCommentManager()||this.hasEditedComment?this.comment:{text:this.#e}}),t}resetAnnotationElement(e){super.resetAnnotationElement(e),e.resetEdited()}},hO=class{#e=Object.create(null);updateProperty(e,t){this[e]=t,this.updateSVGProperty(e,t)}updateProperties(e){if(e)for(let[t,n]of Object.entries(e))t.startsWith(`_`)||this.updateProperty(t,n)}updateSVGProperty(e,t){this.#e[e]=t}toSVGProperties(){let e=this.#e;return this.#e=Object.create(null),{root:e}}reset(){this.#e=Object.create(null)}updateAll(e=this){this.updateProperties(e)}clone(){cC(`Not implemented`)}},gO=class e extends Iw{#e=null;#t;_clipPathId=null;_colorPicker=null;_drawId=null;_drawOutlines=null;_focusDrawId=null;static _currentDrawId=-1;static _currentParent=null;static#n=null;static#r=null;static#i=null;static#a=null;static _INNER_MARGIN=3;constructor(e){super(e),this.#t=e.mustBeCommitted||!1,this._addOutlines(e)}onUpdatedColor(){this._colorPicker?.update(this.color),super.onUpdatedColor()}onUpdatedOpacity(){this._colorPicker?.updateOpacity?.(this.opacity)}_addOutlines(e){e.drawOutlines&&(this.#o(e),this.#m())}#o({drawOutlines:e,drawId:t,drawingOptions:n,clipPathId:r}){this._drawOutlines=e,this._drawingOptions||=n,this.annotationElementId||this._uiManager.a11yAlert(Iw._l10nAlert[this.editorType]),t>=0?(this._drawId=t,this._clipPathId=r??null,this.parent.drawLayer.finalizeDraw(t,e.defaultProperties),this.#c(this.parent)):this._drawId=this.#s(e,this.parent),this.#_(e.box)}#s(t,n){let{id:r,clipPathId:i}=n.drawLayer.draw(e._mergeSVGProperties(this._drawingOptions.toSVGProperties(),t.defaultSVGProperties),!1,this.constructor._hasClipPath);return this.constructor._hasClipPath&&(this._clipPathId=i),this.#c(n),r}#c(e){let t=this._drawOutlines.getFocusSVGProperties(this.#f);t&&(this._focusDrawId=e.drawLayer.drawOutline(t,this._drawOutlines.focusMustRemoveSelfIntersections))}#l(e=this.#f){this._focusDrawId!==null&&this.parent?.drawLayer.updateProperties(this._focusDrawId,this._drawOutlines.getFocusSVGProperties(e))}#u(e){this._focusDrawId!==null&&this.parent?.drawLayer.updateProperties(this._focusDrawId,{rootClass:e})}#d(){let{parent:e,_drawId:t,_focusDrawId:n,_isVisible:r}=this;if(!e||t===null)return;let i={hidden:!r};e.drawLayer.updateProperties(t,{rootClass:i}),n!==null&&e.drawLayer.updateProperties(n,{rootClass:i})}static _mergeSVGProperties(e,t){let n=new Set(Object.keys(e));for(let[r,i]of Object.entries(t))n.has(r)?Object.assign(e[r],i):e[r]=i;return e}static getDefaultDrawingOptions(e){cC(`Not implemented`)}static get typesMap(){cC(`Not implemented`)}static get isDrawer(){return!0}static get _hasClipPath(){return!1}static get _hasDrawClass(){return!0}static get supportMultipleDrawings(){return!1}get _drawRotation(){return this.rotation}get _opacityName(){return this.constructor.typesMap.get(this.opacityType)}get#f(){return(this.parentRotation-this._drawRotation+360)%360}static updateDefaultParams(t,n){let r=this.typesMap.get(t);r&&this._defaultDrawingOptions.updateProperty(r,n),this._currentParent&&(e.#n.updateProperty(r,n),this._currentParent.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}updateParams(e,t){let n=this.constructor.typesMap.get(e);n&&this._updateProperty(e,n,t)}static get defaultPropertiesToUpdate(){let e=[],t=this._defaultDrawingOptions;for(let[n,r]of this.typesMap)e.push([n,t[r]]);return e}get propertiesToUpdate(){let e=[],{_drawingOptions:t}=this;for(let[n,r]of this.constructor.typesMap)e.push([n,t[r]]);return e}_updateProperty(e,t,n){let r=this._drawingOptions,i=r[t],a=n=>{r.updateProperty(t,n);let i=this._drawOutlines.updateProperty(t,n);i&&this.#_(i),this.parent?.drawLayer.updateProperties(this._drawId,r.toSVGProperties()),e===this.colorType?this.onUpdatedColor():e===this.opacityType&&this.onUpdatedOpacity()};this.addCommands({cmd:a.bind(this,n),undo:a.bind(this,i),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:e,overwriteIfSameType:!0,keepUndo:!0})}_updateColorAndOpacity(e,t,n=this.colorAndOpacityType){let r=this.constructor.typesMap.get(this.colorType),i=this._opacityName,a=this._drawingOptions,o=a[r],s=a[i],c=(e,t)=>{a.updateProperty(r,e),a.updateProperty(i,t),this._drawOutlines.updateProperty(r,e),this._drawOutlines.updateProperty(i,t),this.parent?.drawLayer.updateProperties(this._drawId,a.toSVGProperties()),this.onUpdatedColor(),this.onUpdatedOpacity()};this.addCommands({cmd:c.bind(this,e,t),undo:c.bind(this,o,s),post:this._uiManager.updateUI.bind(this._uiManager,this),mustExec:!0,type:n,overwriteIfSameType:!0,keepUndo:!0})}_onResizing(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this._drawOutlines.getPathResizingSVGProperties(this.#g()),{bbox:this.#v()}))}_onResized(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this._drawOutlines.getPathResizedSVGProperties(this.#g()),{bbox:this.#v()})),this.#l()}_onTranslating(e,t){this.parent?.drawLayer.updateProperties(this._drawId,{bbox:this.#v()})}_onTranslated(){this.parent?.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties(this._drawOutlines.getPathTranslatedSVGProperties(this.#g(),this.parentDimensions),{bbox:this.#v()}))}_onStartDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!0}})}_onStopDragging(){this.parent?.drawLayer.updateProperties(this._drawId,{rootClass:{moving:!1}})}get _mustBeDisabledOnCommit(){return!0}commit(){super.commit(),this._mustBeDisabledOnCommit&&(this.disableEditMode(),this.disableEditing())}disableEditing(){super.disableEditing(),this.div.classList.toggle(`disabled`,!0)}enableEditing(){super.enableEditing(),this.div.classList.toggle(`disabled`,!1)}getBaseTranslation(){return[0,0]}get isResizable(){return!0}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),this._isDraggable=!0,this.#t&&(this.#t=!1,this.commit(),this.parent.setSelected(this),e&&this.isOnScreen&&this.div.focus())}remove(){this._uiManager.removeShouldRescale(this),this.#p(),super.remove()}rebuild(){this.parent&&(super.rebuild(),this.div!==null&&(this.#m(),this.#_(this._drawOutlines.box),this.isAttachedToDOM||this.parent.add(this)))}setParent(e){let t=!1;this.parent&&!e?(this._uiManager.removeShouldRescale(this),this.#p()):e&&(this._uiManager.addShouldRescale(this),this.#m(e),t=!this.parent&&this.div?.classList.contains(`selectedEditor`)),super.setParent(e),this.#d(),t&&this.select()}#p(){if(this._drawId===null||!this.parent)return;let{drawLayer:e}=this.parent;e.remove(this._drawId),this._drawId=null,this._focusDrawId!==null&&(e.remove(this._focusDrawId),this._focusDrawId=null),this._drawingOptions.reset()}#m(e=this.parent){if(!(this._drawId!==null&&this.parent===e)){if(this._drawId!==null){let{drawLayer:t}=this.parent;t.updateParent(this._drawId,e.drawLayer),this._focusDrawId!==null&&t.updateParent(this._focusDrawId,e.drawLayer);return}this._drawingOptions.updateAll(),this._drawId=this.#s(this._drawOutlines,e),this._clipPathId&&this.#e&&(this.#e.style.clipPath=this._clipPathId)}}#h([e,t,n,r]){let{parentDimensions:[i,a],_drawRotation:o}=this;switch(o){case 90:return[t,1-e,a/i*n,i/a*r];case 180:return[1-e,1-t,n,r];case 270:return[1-t,e,a/i*n,i/a*r];default:return[e,t,n,r]}}#g(){let{x:e,y:t,width:n,height:r,parentDimensions:[i,a],_drawRotation:o}=this;switch(o){case 90:return[1-t,e,i/a*n,a/i*r];case 180:return[1-e,1-t,n,r];case 270:return[t,1-e,i/a*n,a/i*r];default:return[e,t,n,r]}}#_(e){[this.x,this.y,this.width,this.height]=this.#h(e),this.div&&(this.fixAndSetPosition(),this.setDims()),this._onResized()}#v(e=this.parentRotation){let{x:t,y:n,width:r,height:i,_drawRotation:a,parentDimensions:[o,s]}=this;switch((a*4+e)/90){case 1:return[1-n-i,t,i,r];case 2:return[1-t-r,1-n-i,r,i];case 3:return[n,1-t-r,i,r];case 4:return[t,n-o/s*r,s/o*i,o/s*r];case 5:return[1-n,t,o/s*r,s/o*i];case 6:return[1-t-s/o*i,1-n,s/o*i,o/s*r];case 7:return[n-o/s*r,1-t-s/o*i,o/s*r,s/o*i];case 8:return[t-r,n-i,r,i];case 9:return[1-n,t-r,i,r];case 10:return[1-t,1-n,r,i];case 11:return[n-i,1-t,i,r];case 12:return[t-s/o*i,n,s/o*i,o/s*r];case 13:return[1-n-o/s*r,t-s/o*i,o/s*r,s/o*i];case 14:return[1-t,1-n-o/s*r,s/o*i,o/s*r];case 15:return[n,1-t,o/s*r,s/o*i];default:return[t,n,r,i]}}rotate(t=this.parentRotation){if(!this.parent||this._drawId===null)return;let n=(t-this._drawRotation+360)%360;this.parent.drawLayer.updateProperties(this._drawId,e._mergeSVGProperties({bbox:this.#v(t)},this._drawOutlines.updateRotation(n))),this.#l(n)}show(e=this._isVisible){super.show(e),this.#d()}select(){super.select(),this.#u({hovered:!1,selected:!0})}unselect(){super.unselect(),this.#u({selected:!1})}pointerover(){this.isSelected||this.#u({hovered:!0})}pointerleave(){this.isSelected||this.#u({hovered:!1})}onScaleChanging(){if(!this.parent)return;let e=this._drawOutlines.updateParentDimensions(this.parentDimensions,this.parent.scale);e&&this.#_(e)}static onScaleChangingWhenDrawing(){}render(){if(this.div)return this.div;let e,t;this._isCopy&&(e=this.x,t=this.y);let n=super.render();this.constructor._hasDrawClass&&n.classList.add(`draw`);let r=this.#e=document.createElement(`div`);return n.append(r),r.setAttribute(`aria-hidden`,`true`),r.className=`internal`,this._clipPathId&&(r.style.clipPath=this._clipPathId),Sw(this,r,[`pointerover`,`pointerleave`]),this.setDims(),this._uiManager.addShouldRescale(this),this.disableEditing(),this._isCopy&&this._moveAfterPaste(e,t),n}static createDrawerInstance(e){cC(`Not implemented`)}static _getDrawingTarget(e,{target:t}){return t}static _getPointerCoords({offsetX:e,offsetY:t,clientX:n,clientY:r},i=null){if(!i)return[e,t];let a=n-i.clientX,o=r-i.clientY;switch(this._currentParent.viewport.rotation){case 90:[a,o]=[o,-a];break;case 180:[a,o]=[-a,-o];break;case 270:[a,o]=[-o,a];break}return[i.offsetX+a,i.offsetY+o]}static _addDrawingListeners(e,t){}static _endDrawingSession(e=!1){return this._currentParent.endDrawingSession(e)}static startDrawing(t,n,r,i){let{pointerId:a,pointerType:o}=i;if(Cw.isInitializedAndDifferentPointerType(o))return;let s=this._getDrawingTarget(t,i),[c,l]=this._getPointerCoords(i),{viewport:{rotation:u}}=t,{x:d,y:f,width:p,height:m}=s.getBoundingClientRect(),h=e.#r=new AbortController,g=t.combinedSignal(h);if(Cw.setPointer(o,a),window.addEventListener(`pointerup`,e=>{Cw.isSamePointerIdOrRemove(e.pointerId)&&this._endDraw(e)},{signal:g}),window.addEventListener(`pointercancel`,e=>{Cw.isSamePointerIdOrRemove(e.pointerId)&&this._endDrawingSession()},{signal:g}),window.addEventListener(`pointerdown`,t=>{Cw.isSamePointerType(t.pointerType)&&(Cw.initializeAndAddPointerId(t.pointerId),e.#n.isCancellable()&&(e.#n.removeLastElement(),e.#n.isEmpty()?this._endDrawingSession(!0):this._endDraw(null)))},{capture:!0,passive:!1,signal:g}),window.addEventListener(`contextmenu`,ZC,{signal:g}),s.addEventListener(`pointermove`,this._drawMove.bind(this),{signal:g}),s.addEventListener(`touchmove`,e=>{Cw.isSameTimeStamp(e.timeStamp)&&QC(e)},{signal:g}),this._addDrawingListeners(s,g),t.toggleDrawing(),n._editorUndoBar?.hide(),e.#n){t.drawLayer.updateProperties(this._currentDrawId,e.#n.startNew(c,l,p,m,u));return}n.updateUIForDefaultProperties(this),e.#n=this.createDrawerInstance({x:c,y:l,box:[d,f,p,m],rotation:u,parent:t,isLTR:r}),e.#i=this.getDefaultDrawingOptions(),this._currentParent=t;let{id:_,clipPathId:v}=t.drawLayer.draw(this._mergeSVGProperties(e.#i.toSVGProperties(),e.#n.defaultSVGProperties),!0,this._hasClipPath);this._currentDrawId=_,e.#a=this._hasClipPath?v:null}static _drawMove(t){if(Cw.isSameTimeStamp(t.timeStamp),!e.#n||!Cw.isSamePointerId(t.pointerId))return;if(Cw.isUsingMultiplePointers()){this._endDraw(t);return}let n,r=t.getCoalescedEvents?.();if(r?.length){let i=[];for(let e of r)i.push(...this._getPointerCoords(e,t));n=e.#n.addPoints(i)}else n=e.#n.add(...this._getPointerCoords(t));this._currentParent.drawLayer.updateProperties(this._currentDrawId,n),Cw.setTimeStamp(t.timeStamp),QC(t)}static _cleanup(t){t&&(this._currentDrawId=-1,this._currentParent=null,e.#n=null,e.#i=null,e.#a=null,Cw.clearTimeStamp()),e.#r&&(e.#r.abort(),e.#r=null,Cw.clearPointerIds())}static _endDraw(t){let n=this._currentParent;if(n){if(n.toggleDrawing(!0),this._cleanup(!1),n.drawLayer.updateProperties(this._currentDrawId,t?.target===n.div?e.#n.end(...this._getPointerCoords(t)):e.#n.end()),this.supportMultipleDrawings){let t=e.#n,r=this._currentDrawId,i=t.getLastElement();n.addCommands({cmd:()=>{n.drawLayer.updateProperties(r,t.setLastElement(i))},undo:()=>{n.drawLayer.updateProperties(r,t.removeLastElement())},mustExec:!1,type:qS.DRAW_STEP});return}this.endDrawing(!1)}}static endDrawing(t){let n=this._currentParent;if(!n)return null;if(n.toggleDrawing(!0),n.cleanUndoStack(qS.DRAW_STEP),!e.#n.isEmpty()){let{pageDimensions:[r,i],scale:a}=n,o=n.createAndAddNewEditor({offsetX:0,offsetY:0},!1,{drawId:this._currentDrawId,clipPathId:e.#a,drawOutlines:e.#n.getOutlines(r*a,i*a,a,this._INNER_MARGIN),drawingOptions:e.#i,mustBeCommitted:!t});return this._cleanup(!0),o}return n.drawLayer.remove(this._currentDrawId),this._cleanup(!0),null}createDrawingOptions(e){}static deserializeDraw(e,t,n,r,i,a,o){cC(`Not implemented`)}static async deserialize(e,t,n){let{rawDims:{pageWidth:r,pageHeight:i,pageX:a,pageY:o}}=t.viewport,s=this.deserializeDraw(a,o,r,i,this._INNER_MARGIN,e,n),c=await super.deserialize(e,t,n);return c.createDrawingOptions(e),c.#o({drawOutlines:s}),c.#m(),c.onScaleChanging(),c.rotate(),c}serializeDraw(e){let[t,n]=this.pageTranslation,[r,i]=this.pageDimensions;return this._drawOutlines.serialize([t,n,r,i],e)}renderAnnotationElement(e){return e.updateEdited({rect:this.getPDFRect()}),null}static canCreateNewEmptyEditor(){return!1}},_O=class{static PRECISION=1e-4;focusOutline=null;toSVGPath(){cC("Abstract method `toSVGPath` must be implemented.")}get box(){cC("Abstract getter `box` must be implemented.")}serialize(e,t){cC("Abstract method `serialize` must be implemented.")}get defaultSVGProperties(){cC("Abstract getter `defaultSVGProperties` must be implemented.")}get defaultProperties(){return this.defaultSVGProperties}getFocusSVGProperties(e){return null}get focusMustRemoveSelfIntersections(){return!1}updateProperty(e,t){return null}updateParentDimensions(e,t){return null}serializeQuadPoints(e,t){return null}updateRotation(e){return{}}getPathResizingSVGProperties(e){return{}}getPathResizedSVGProperties(e){return{}}getPathTranslatedSVGProperties(e,t){return{}}static _rotateBox([e,t,n,r],i){switch(i){case 90:return[1-t-r,e,r,n];case 180:return[1-e-n,1-t-r,n,r];case 270:return[t,1-e-n,r,n]}return[e,t,n,r]}static _rescale(e,t,n,r,i,a){a||=new Float32Array(e.length);for(let o=0,s=e.length;o<s;o+=2)a[o]=t+e[o]*r,a[o+1]=n+e[o+1]*i;return a}static _rescaleAndSwap(e,t,n,r,i,a){a||=new Float32Array(e.length);for(let o=0,s=e.length;o<s;o+=2)a[o]=t+e[o+1]*r,a[o+1]=n+e[o]*i;return a}static _translate(e,t,n,r){r||=new Float32Array(e.length);for(let i=0,a=e.length;i<a;i+=2)r[i]=t+e[i],r[i+1]=n+e[i+1];return r}static svgRound(e){return Math.round(e*1e4)}static _normalizePoint(e,t,n,r,i){switch(i){case 90:return[1-t/n,e/r];case 180:return[1-e/n,1-t/r];case 270:return[t/n,1-e/r];default:return[e/n,t/r]}}static createBezierPoints(e,t,n,r,i,a){return[(e+5*n)/6,(t+5*r)/6,(5*n+i)/6,(5*r+a)/6,(n+i)/2,(r+a)/2]}},vO=class e{#e;#t=[];#n;#r;#i=[];#a=new Float32Array(18);#o;#s;#c;#l;#u;#d;#f=[];static#p=8;static#m=2;static#h=e.#p+e.#m;constructor(t,n,r,i,a,o,s=0){this.#e=r,this.#d=a*i,this.#r=o,this.#a.set([NaN,NaN,NaN,NaN,t,n],6),this.#n=s,this.#l=e.#p*i,this.#c=e.#h*i,this.#u=i,this.#f.push(t,n)}isEmpty(){return isNaN(this.#a[8])}isCancellable(){return this.#f.length<=10}removeLastElement(){return this.#a.fill(NaN),this.#i.length=this.#t.length=this.#f.length=0,{path:{d:``}}}#g(){let e=this.#a.subarray(4,6),t=this.#a.subarray(16,18),[n,r,i,a]=this.#e;return[(this.#o+(e[0]-t[0])/2-n)/i,(this.#s+(e[1]-t[1])/2-r)/a,(this.#o+(t[0]-e[0])/2-n)/i,(this.#s+(t[1]-e[1])/2-r)/a]}add(e,t){this.#o=e,this.#s=t;let[n,r,i,a]=this.#e,[o,s,c,l]=this.#a.subarray(8,12),u=e-c,d=t-l,f=Math.hypot(u,d);if(f<this.#c)return!1;let p=f-this.#l,m=p/f,h=m*u,g=m*d,_=o,v=s;o=c,s=l,c+=h,l+=g,this.#f?.push(e,t);let y=-g/p,b=h/p,x=y*this.#d,S=b*this.#d;return this.#a.set(this.#a.subarray(2,8),0),this.#a.set([c+x,l+S],4),this.#a.set(this.#a.subarray(14,18),12),this.#a.set([c-x,l-S],16),isNaN(this.#a[6])?(this.#i.length===0&&(this.#a.set([o+x,s+S],2),this.#i.push(NaN,NaN,NaN,NaN,(o+x-n)/i,(s+S-r)/a),this.#a.set([o-x,s-S],14),this.#t.push(NaN,NaN,NaN,NaN,(o-x-n)/i,(s-S-r)/a)),this.#a.set([_,v,o,s,c,l],6),!this.isEmpty()):(this.#a.set([_,v,o,s,c,l],6),Math.abs(Math.atan2(v-s,_-o)-Math.atan2(g,h))<Math.PI/2?([o,s,c,l]=this.#a.subarray(2,6),this.#i.push(NaN,NaN,NaN,NaN,((o+c)/2-n)/i,((s+l)/2-r)/a),[o,s,_,v]=this.#a.subarray(14,18),this.#t.push(NaN,NaN,NaN,NaN,((_+o)/2-n)/i,((v+s)/2-r)/a),!0):([_,v,o,s,c,l]=this.#a.subarray(0,6),this.#i.push(((_+5*o)/6-n)/i,((v+5*s)/6-r)/a,((5*o+c)/6-n)/i,((5*s+l)/6-r)/a,((o+c)/2-n)/i,((s+l)/2-r)/a),[c,l,o,s,_,v]=this.#a.subarray(12,18),this.#t.push(((_+5*o)/6-n)/i,((v+5*s)/6-r)/a,((5*o+c)/6-n)/i,((5*s+l)/6-r)/a,((o+c)/2-n)/i,((s+l)/2-r)/a),!0))}toSVGPath(){if(this.isEmpty())return``;let e=this.#i,t=this.#t;if(isNaN(this.#a[6])&&!this.isEmpty())return this.#_();let n=[];n.push(`M${e[4]} ${e[5]}`);for(let t=6;t<e.length;t+=6)isNaN(e[t])?n.push(`L${e[t+4]} ${e[t+5]}`):n.push(`C${e[t]} ${e[t+1]} ${e[t+2]} ${e[t+3]} ${e[t+4]} ${e[t+5]}`);this.#y(n);for(let e=t.length-6;e>=6;e-=6)isNaN(t[e])?n.push(`L${t[e+4]} ${t[e+5]}`):n.push(`C${t[e]} ${t[e+1]} ${t[e+2]} ${t[e+3]} ${t[e+4]} ${t[e+5]}`);return this.#v(n),n.join(` `)}#_(){let[e,t,n,r]=this.#e,[i,a,o,s]=this.#g();return`M${(this.#a[2]-e)/n} ${(this.#a[3]-t)/r} L${(this.#a[4]-e)/n} ${(this.#a[5]-t)/r} L${i} ${a} L${o} ${s} L${(this.#a[16]-e)/n} ${(this.#a[17]-t)/r} L${(this.#a[14]-e)/n} ${(this.#a[15]-t)/r} Z`}#v(e){let t=this.#t;e.push(`L${t[4]} ${t[5]} Z`)}#y(e){let[t,n,r,i]=this.#e,a=this.#a.subarray(4,6),o=this.#a.subarray(16,18),[s,c,l,u]=this.#g();e.push(`L${(a[0]-t)/r} ${(a[1]-n)/i} L${s} ${c} L${l} ${u} L${(o[0]-t)/r} ${(o[1]-n)/i}`)}newFreeDrawOutline(e,t,n,r,i,a){return new yO(e,t,n,r,i,a)}getOutlines(){let e=this.#i,t=this.#t,n=this.#a,[r,i,a,o]=this.#e,s=new Float32Array((this.#f?.length??0)+2);for(let e=0,t=s.length-2;e<t;e+=2)s[e]=(this.#f[e]-r)/a,s[e+1]=(this.#f[e+1]-i)/o;if(s[s.length-2]=(this.#o-r)/a,s[s.length-1]=(this.#s-i)/o,isNaN(n[6])&&!this.isEmpty())return this.#b(s);let c=new Float32Array(this.#i.length+24+this.#t.length),l=e.length;for(let t=0;t<l;t+=2){if(isNaN(e[t])){c[t]=c[t+1]=NaN;continue}c[t]=e[t],c[t+1]=e[t+1]}l=this.#S(c,l);for(let e=t.length-6;e>=6;e-=6)for(let n=0;n<6;n+=2){if(isNaN(t[e+n])){c[l]=c[l+1]=NaN,l+=2;continue}c[l]=t[e+n],c[l+1]=t[e+n+1],l+=2}return this.#x(c,l),this.newFreeDrawOutline(c,s,this.#e,this.#u,this.#n,this.#r)}#b(e){let t=this.#a,[n,r,i,a]=this.#e,[o,s,c,l]=this.#g(),u=new Float32Array(36);return u.set([NaN,NaN,NaN,NaN,(t[2]-n)/i,(t[3]-r)/a,NaN,NaN,NaN,NaN,(t[4]-n)/i,(t[5]-r)/a,NaN,NaN,NaN,NaN,o,s,NaN,NaN,NaN,NaN,c,l,NaN,NaN,NaN,NaN,(t[16]-n)/i,(t[17]-r)/a,NaN,NaN,NaN,NaN,(t[14]-n)/i,(t[15]-r)/a],0),this.newFreeDrawOutline(u,e,this.#e,this.#u,this.#n,this.#r)}#x(e,t){let n=this.#t;return e.set([NaN,NaN,NaN,NaN,n[4],n[5]],t),t+=6}#S(e,t){let n=this.#a.subarray(4,6),r=this.#a.subarray(16,18),[i,a,o,s]=this.#e,[c,l,u,d]=this.#g();return e.set([NaN,NaN,NaN,NaN,(n[0]-i)/o,(n[1]-a)/s,NaN,NaN,NaN,NaN,c,l,NaN,NaN,NaN,NaN,u,d,NaN,NaN,NaN,NaN,(r[0]-i)/o,(r[1]-a)/s],t),t+=24}},yO=class extends _O{#e;#t=new Float32Array(4);#n;#r;#i;#a;#o;constructor(e,t,n,r,i,a){super(),this.#o=e,this.#i=t,this.#e=n,this.#a=r,this.#n=i,this.#r=a,this.firstPoint=[NaN,NaN],this.lastPoint=[NaN,NaN],this.#s(a);let[o,s,c,l]=this.#t;for(let t=0,n=e.length;t<n;t+=2)e[t]=(e[t]-o)/c,e[t+1]=(e[t+1]-s)/l;for(let e=0,n=t.length;e<n;e+=2)t[e]=(t[e]-o)/c,t[e+1]=(t[e+1]-s)/l}toSVGPath(){let e=[`M${this.#o[4]} ${this.#o[5]}`];for(let t=6,n=this.#o.length;t<n;t+=6){if(isNaN(this.#o[t])){e.push(`L${this.#o[t+4]} ${this.#o[t+5]}`);continue}e.push(`C${this.#o[t]} ${this.#o[t+1]} ${this.#o[t+2]} ${this.#o[t+3]} ${this.#o[t+4]} ${this.#o[t+5]}`)}return e.push(`Z`),e.join(` `)}serialize([e,t,n,r],i){let a=n-e,o=r-t,s,c;switch(i){case 0:s=_O._rescale(this.#o,e,r,a,-o),c=_O._rescale(this.#i,e,r,a,-o);break;case 90:s=_O._rescaleAndSwap(this.#o,e,t,a,o),c=_O._rescaleAndSwap(this.#i,e,t,a,o);break;case 180:s=_O._rescale(this.#o,n,t,-a,o),c=_O._rescale(this.#i,n,t,-a,o);break;case 270:s=_O._rescaleAndSwap(this.#o,n,r,-a,-o),c=_O._rescaleAndSwap(this.#i,n,r,-a,-o);break}return{outline:Array.from(s),points:[Array.from(c)]}}#s(e){let t=this.#o,n=t[4],r=t[5],i=[n,r,n,r],a=n,o=r,s=n,c=r,l=e?Math.max:Math.min,u=new Float32Array(4);for(let e=6,d=t.length;e<d;e+=6){let d=t[e+4],f=t[e+5];isNaN(t[e])?(TC.pointBoundingBox(d,f,i),o>f?(a=d,o=f):o===f&&(a=l(a,d)),c<f?(s=d,c=f):c===f&&(s=l(s,d))):(u.set(RS,0),TC.bezierBoundingBox(n,r,...t.slice(e,e+6),u),TC.rectBoundingBox(...u,i),o>u[1]?(a=u[0],o=u[1]):o===u[1]&&(a=l(a,u[0])),c<u[3]?(s=u[2],c=u[3]):c===u[3]&&(s=l(s,u[2]))),n=d,r=f}let d=this.#t;d[0]=i[0]-this.#n,d[1]=i[1]-this.#n,d[2]=i[2]-i[0]+2*this.#n,d[3]=i[3]-i[1]+2*this.#n,this.firstPoint=[a,o],this.lastPoint=[s,c]}get box(){return this.#t}newOutliner(e,t,n,r,i,a,o=0){return new vO(e,t,n,r,i,a,o)}updateThickness(e){let t=this.getNewOutline(e);return this.#o=t.#o,this.#i=t.#i,this.#t.set(t.#t),this.firstPoint=t.firstPoint,this.lastPoint=t.lastPoint,this.#t}getNewOutline(e,t){let[n,r,i,a]=this.#t,[o,s,c,l]=this.#e,u=i*c,d=a*l,f=n*c+o,p=r*l+s,m=this.#i,h=this.newOutliner(m[0]*u+f,m[1]*d+p,this.#e,this.#a,e,this.#r,t??this.#n);for(let e=2,t=m.length;e<t;e+=2)h.add(m[e]*u+f,m[e+1]*d+p);return h.getOutlines()}};function bO(e){return{bbox:e.box,root:{viewBox:`0 0 1 1`},rootClass:{highlight:!0,free:e.isFree},path:{d:e.toSVGPath()}}}function xO(e,t){let{focusOutline:n}=e;return{bbox:_O._rotateBox(n.box,t),root:{"data-main-rotation":t},rootClass:{highlightOutline:!0,free:e.isFree},path:{d:n.toSVGPath()}}}var SO=class{#e;#t;#n;#r=[];#i=[];constructor(e,t=0,n=0,r=!0){let i=RS.slice(),a=10**-4;for(let{x:n,y:r,width:o,height:s}of e){let e=Math.floor((n-t)/a)*a,c=Math.ceil((n+o+t)/a)*a,l=Math.floor((r-t)/a)*a,u=Math.ceil((r+s+t)/a)*a,d=[e,l,u,!0],f=[c,l,u,!1];this.#r.push(d,f),TC.rectBoundingBox(e,l,c,u,i)}let o=i[2]-i[0]+2*n,s=i[3]-i[1]+2*n,c=i[0]-n,l=i[1]-n,u=r?-1/0:1/0,d=1/0,f=this.#r.at(r?-1:-2),p=[f[0],f[2]];for(let e of this.#r){let[t,n,i,a]=e;!a&&r?n<d?(d=n,u=t):n===d&&(u=Math.max(u,t)):a&&!r&&(n<d?(d=n,u=t):n===d&&(u=Math.min(u,t))),e[0]=(t-c)/o,e[1]=(n-l)/s,e[2]=(i-l)/s}this.#e=new Float32Array([c,l,o,s]),this.#t=[u,d],this.#n=p}getOutlines(){this.#r.sort((e,t)=>e[0]-t[0]||e[1]-t[1]||e[2]-t[2]);let e=[];for(let t of this.#r)t[3]?(e.push(...this.#l(t)),this.#s(t)):(this.#c(t),e.push(...this.#l(t)));return this.#a(e)}#a(e){let t=[],n=new Set;for(let n of e){let[e,r,i]=n;t.push([e,r,n],[e,i,n])}t.sort((e,t)=>e[1]-t[1]||e[0]-t[0]);for(let e=0,r=t.length;e<r;e+=2){let r=t[e][2],i=t[e+1][2];r.push(i),i.push(r),n.add(r),n.add(i)}let r=[],i;for(;n.size>0;){let e=n.values().next().value,[t,a,o,s,c]=e;n.delete(e);let l=t,u=a;for(i=[t,o],r.push(i);;){let e;if(n.has(s))e=s;else if(n.has(c))e=c;else break;n.delete(e),[t,a,o,s,c]=e,l!==t&&(i.push(l,u,t,u===a?a:o),l=t),u=u===a?o:a}i.push(l,u)}return new CO(r,this.#e,this.#t,this.#n)}#o(e){let t=this.#i,n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i][0];if(a===e)return i;a<e?n=i+1:r=i-1}return r+1}#s([,e,t]){let n=this.#o(e);this.#i.splice(n,0,[e,t])}#c([,e,t]){let n=this.#o(e);for(let r=n;r<this.#i.length;r++){let[n,i]=this.#i[r];if(n!==e)break;if(n===e&&i===t){this.#i.splice(r,1);return}}for(let r=n-1;r>=0;r--){let[n,i]=this.#i[r];if(n!==e)break;if(n===e&&i===t){this.#i.splice(r,1);return}}}#l(e){let[t,n,r]=e,i=[[t,n,r]],a=this.#o(r);for(let e=0;e<a;e++){let[n,r]=this.#i[e];for(let e=0,a=i.length;e<a;e++){let[,o,s]=i[e];if(!(r<=o||s<=n)){if(o>=n){if(s>r)i[e][1]=r;else{if(a===1)return[];i.splice(e,1),e--,a--}continue}i[e][2]=n,s>r&&i.push([t,r,s])}}}return i}},CO=class extends _O{#e;#t=null;#n;constructor(e,t,n,r){super(),this.#n=e,this.#e=t,this.firstPoint=n,this.lastPoint=r}static build(e,t){let n=new SO(e,.001).getOutlines();return n.#t=e,n.focusOutline=new SO(e,.0025,.001,t).getOutlines(),n}get isFree(){return!1}get defaultSVGProperties(){return bO(this)}getFocusSVGProperties(e){return xO(this,e)}updateRotation(e){return{root:{"data-main-rotation":e}}}serializeQuadPoints([e,t],[n,r]){let i=this.#t,a=new Float32Array(i.length*8),o=0;for(let{x:s,y:c,width:l,height:u}of i){let i=s*n+e,d=(1-c)*r+t;a[o]=a[o+4]=i,a[o+1]=a[o+3]=d,a[o+2]=a[o+6]=i+l*n,a[o+5]=a[o+7]=d-u*r,o+=8}return a}toSVGPath(){let e=[];for(let t of this.#n){let[n,r]=t;e.push(`M${n} ${r}`);for(let i=2;i<t.length;i+=2){let a=t[i],o=t[i+1];a===n?(e.push(`V${o}`),r=o):o===r&&(e.push(`H${a}`),n=a)}e.push(`Z`)}return e.join(` `)}serialize([e,t,n,r],i){let a=[],o=n-e,s=r-t;for(let t of this.#n){let n=Array(t.length);for(let i=0;i<t.length;i+=2)n[i]=e+t[i]*o,n[i+1]=r-t[i+1]*s;a.push(n)}return a}get box(){return this.#e}},wO=class extends vO{newFreeDrawOutline(e,t,n,r,i,a){return new EO(e,t,n,r,i,a)}},TO=class{#e;#t;constructor(e,t,n,r,i,a,o){this.#e=new wO(e,t,n,r,i,a,o),this.#t=i}add(e,t){return this.#e.add(e,t)?{path:{d:this.#e.toSVGPath()}}:null}addPoints(e){let t=!1;for(let n=0,r=e.length;n<r;n+=2)t=this.#e.add(e[n],e[n+1])||t;return t?{path:{d:this.#e.toSVGPath()}}:null}end(e,t){return e===void 0?null:this.add(e,t)}isEmpty(){return this.#e.isEmpty()}isCancellable(){return this.#e.isCancellable()}removeLastElement(){return this.#e.removeLastElement()}updateProperty(e,t){return null}getOutlines(){let e=this.#e.getOutlines();return e.buildFocusOutline(2*this.#t),e}get defaultSVGProperties(){return{bbox:[0,0,1,1],root:{viewBox:`0 0 1 1`},rootClass:{highlight:!0,free:!0},path:{d:this.#e.toSVGPath()}}}},EO=class e extends yO{static#e=1.5;newOutliner(e,t,n,r,i,a,o=0){return new wO(e,t,n,r,i,a,o)}get isFree(){return!0}buildFocusOutline(t){this.focusOutline=this.getNewOutline(t/2+e.#e,.0025)}get defaultSVGProperties(){return bO(this)}getFocusSVGProperties(e){return xO(this,e)}get focusMustRemoveSelfIntersections(){return!0}updateRotation(e){return{root:{"data-main-rotation":e}}}updateProperty(e,t){if(e!==`thickness`)return null;let n=this.updateThickness(t/2);return this.buildFocusOutline(t),n}getPathResizedSVGProperties(){return{path:{d:this.toSVGPath()}}}},DO=class e extends hO{constructor(e=null){super(),super.updateProperties(e)}updateSVGProperty(e,t){e!==`thickness`&&super.updateSVGProperty(e,t)}clone(){let t=new e;return t.updateAll(this),t}},OO=class e extends gO{#e=null;#t=0;#n=null;#r=0;#i=``;#a=``;static _DEFAULT_OPACITY=1;static _DEFAULT_THICKNESS=12;static _defaultDrawingOptions=null;static _type=`highlight`;static _editorType=KS.HIGHLIGHT;static get _keyboardManager(){let t=e.prototype;return mC(this,`_keyboardManager`,new Dw([[[`ArrowLeft`],t._moveCaret,{args:[0]}],[[`ArrowRight`],t._moveCaret,{args:[1]}],[[`ArrowUp`],t._moveCaret,{args:[2]}],[[`ArrowDown`],t._moveCaret,{args:[3]}]]))}constructor(e){super({...e,name:`highlightEditor`}),this.#e=e.anchorNode||null,this.#t=e.anchorOffset||0,this.#n=e.focusNode||null,this.#r=e.focusOffset||0,this.#i=e.methodOfCreation||(this._drawOutlines?.isFree?`main_toolbar`:``),this.#a=e.text||``,this._isDraggable=!1,this.defaultL10nId=`pdfjs-editor-highlight-editor`,this.rotate()}static initialize(t,n){Iw.initialize(t,n),this._defaultDrawingOptions||=new DO({fill:n.highlightColors?.values().next().value||`#fff066`,"fill-opacity":e._DEFAULT_OPACITY,thickness:e._DEFAULT_THICKNESS})}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get typesMap(){return mC(this,`typesMap`,new Map([[qS.HIGHLIGHT_COLOR,`fill`],[qS.HIGHLIGHT_THICKNESS,`thickness`]]))}static get isDrawer(){return!1}static get _hasClipPath(){return!0}static get _hasDrawClass(){return!1}_addOutlines(t){let{boxes:n,drawOutlines:r}=t;!n&&!r||(this._drawingOptions||=t.drawingOptions||e.getDefaultDrawingOptions(),n&&(t={...t,drawOutlines:CO.build(n,this._uiManager.direction===`ltr`)}),super._addOutlines(t))}get colorType(){return qS.HIGHLIGHT_COLOR}get color(){return this._drawingOptions.fill}get opacity(){return this._drawingOptions[`fill-opacity`]}get _opacityName(){return`fill-opacity`}get _drawRotation(){return this._drawOutlines?.isFree?this.rotation:0}get isResizable(){return!1}get _mustBeDisabledOnCommit(){return!1}get _mustFixPosition(){return!this._drawOutlines?.isFree}get telemetryInitialData(){return{action:`added`,type:this._drawOutlines.isFree?`free_highlight`:`highlight`,color:this._uiManager.getNonHCMColorName(this.color),thickness:this._drawingOptions.thickness,methodOfCreation:this.#i}}get telemetryFinalData(){return{type:`highlight`,color:this._uiManager.getNonHCMColorName(this.color)}}static computeTelemetryFinalData(e){return{numberOfColors:e.get(`color`).size}}translateInPage(e,t){}get toolbarPosition(){return this.#o(this._drawOutlines.focusOutline.lastPoint)}get commentButtonPosition(){return this.#o(this._drawOutlines.firstPoint)}#o([e,t]){let[n,r,i,a]=this._drawOutlines.box;return[(e-n)/i,(t-r)/a]}updateParams(t,n){switch(t){case qS.HIGHLIGHT_COLOR:this._updateColorAndOpacity(n,e._DEFAULT_OPACITY,t),this._reportTelemetry({action:`color_changed`,color:this._uiManager.getNonHCMColorName(n)},!0);break;case qS.HIGHLIGHT_THICKNESS:super.updateParams(t,n),this._reportTelemetry({action:`thickness_changed`,thickness:n},!0);break}}get propertiesToUpdate(){let e=super.propertiesToUpdate;return e.push([qS.HIGHLIGHT_FREE,this._drawOutlines.isFree]),e}get toolbarButtons(){return this._uiManager.highlightColors?(this._colorPicker=new DD({editor:this}),[[`colorPicker`,this._colorPicker]]):super.toolbarButtons}fixAndSetPosition(){return super.fixAndSetPosition(this._drawRotation)}getRect(e,t){return super.getRect(e,t,this._drawRotation)}onceAdded(e){this.annotationElementId||this.parent.addUndoableEditor(this),e&&this.div.focus()}remove(){this._reportTelemetry({action:`deleted`}),super.remove()}render(){if(this.div)return this.div;let e=super.render();return this.#a&&(e.setAttribute(`aria-label`,this.#a),e.setAttribute(`role`,`mark`)),this._drawOutlines.isFree?e.classList.add(`free`):e.addEventListener(`keydown`,this.#s.bind(this),{signal:this._uiManager._signal}),this.enableEditing(),e}#s(t){e._keyboardManager.exec(this,t)}_moveCaret(e){switch(this.parent.unselect(this),e){case 0:case 2:this.#c(!0);break;case 1:case 3:this.#c(!1);break}}#c(e){if(!this.#e)return;let t=window.getSelection();e?t.setPosition(this.#e,this.#t):t.setPosition(this.#n,this.#r)}unselect(){super.unselect(),this._drawOutlines.isFree||this.#c(!1)}static createDrawerInstance({x:e,y:t,box:n,parent:r,isLTR:i}){return new TO(e,t,n,r.scale,this._defaultDrawingOptions.thickness/2,i,.001)}static _getDrawingTarget(e,{target:t}){return t.closest(`.textLayer`)}static _getPointerCoords({x:e,y:t}){return[e,t]}static _addDrawingListeners(e,t){e.classList.add(`free`),t.addEventListener(`abort`,()=>e.classList.remove(`free`),{once:!0}),window.addEventListener(`blur`,()=>this._endDraw(null),{signal:t}),window.addEventListener(`pointerdown`,QC,{capture:!0,passive:!1,signal:t})}static _endDrawingSession(e=!1){return this.endDrawing(e)}createDrawingOptions({color:t,opacity:n,thickness:r}){let{_defaultDrawingOptions:i,_DEFAULT_OPACITY:a}=e;this._drawingOptions=e.getDefaultDrawingOptions({fill:TC.makeHexColor(...t),"fill-opacity":n||a,thickness:r||i.thickness})}static deserializeDraw(e,t,n,r,i,a,o){let{quadPoints:s}=a;if(s){let i=[];for(let a=0,o=s.length;a<o;a+=8)i.push({x:(s[a]-e)/n,y:1-(s[a+1]-t)/r,width:(s[a+2]-s[a])/n,height:(s[a+1]-s[a+5])/r});return CO.build(i,o.direction===`ltr`)}let c=a.thickness||this._defaultDrawingOptions.thickness,l=(a.inkLists||a.outlines.points)[0],u=new wO(l[0]-e,r-(l[1]-t),[0,0,n,r],1,c/2,!0,.001);for(let n=0,i=l.length;n<i;n+=2)u.add(l[n]-e,r-(l[n+1]-t));let d=u.getOutlines();return d.buildFocusOutline(c),d}static async deserialize(e,t,n){let r=null;if(e instanceof aO){let{data:{quadPoints:t,rect:n,rotation:i,id:a,color:o,opacity:s,popupRef:c,richText:l,contentsObj:u,creationDate:d,modificationDate:f},parent:{page:{pageNumber:p}}}=e;r=e={annotationType:KS.HIGHLIGHT,color:Array.from(o),opacity:s,quadPoints:t,pageIndex:p-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:c,richText:l,comment:u?.str||null,creationDate:d,modificationDate:f}}else if(e instanceof iO){let{data:{inkLists:t,rect:n,rotation:i,id:a,color:o,borderStyle:{rawWidth:s},popupRef:c,richText:l,contentsObj:u,creationDate:d,modificationDate:f},parent:{page:{pageNumber:p}}}=e;r=e={annotationType:KS.HIGHLIGHT,color:Array.from(o),thickness:s,inkLists:t,pageIndex:p-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:c,richText:l,comment:u?.str||null,creationDate:d,modificationDate:f}}let i=await super.deserialize(e,t,n);return i._initialData=r,e.comment&&i.setCommentData(e),i}serialize(e=!1){if(this.isEmpty()||e)return null;if(this.deleted)return this.serializeDeleted();let t=super.serialize(e);return Object.assign(t,{color:Iw._colorManager.convert(this._uiManager.getNonHCMColor(this.color)),opacity:this.opacity,thickness:this._drawingOptions.thickness,quadPoints:this._drawOutlines.serializeQuadPoints(this.pageTranslation,this.pageDimensions),outlines:this._drawOutlines.serialize(t.rect,this._drawRotation)}),this.addComment(t),this.annotationElementId&&!this.#l(t)?null:(t.id=this.annotationElementId,t)}#l(e){let{color:t}=this._initialData;return this.hasEditedComment||e.color.some((e,n)=>e!==t[n])}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}},kO=class{#e=new Float64Array(6);#t=new Float64Array(2);#n;#r;#i;#a;#o;#s=``;#c=0;#l=new AO;#u;#d;constructor(e,t,n,r,i,a){this.#u=n,this.#d=r,this.#i=i,this.#a=a,[e,t]=this.#f(e,t);let o=this.#n=[NaN,NaN,NaN,NaN,e,t];this.#o=[e,t],this.#r=[{line:o,points:this.#o}],this.#e.set(o,0),this.#t.set([e,t],0)}updateProperty(e,t){e===`stroke-width`&&(this.#a=t)}#f(e,t){return _O._normalizePoint(e,t,this.#u,this.#d,this.#i)}isEmpty(){return!this.#r?.length}isCancellable(){return this.#o.length<=10}add(e,t){return this.#p(e,t)&&this.toSVGPath(),{path:{d:this.#m()}}}addPoints(e){let t=!1;for(let n=0,r=e.length;n<r;n+=2)this.#p(e[n],e[n+1])&&(t=!0,this.#o.length<=6&&(this.toSVGPath(),t=!1));return t&&this.toSVGPath(),{path:{d:this.#m()}}}#p(e,t){[e,t]=this.#f(e,t),this.#t.set([e,t],0);let[n,r,i,a]=this.#e.subarray(2,6),o=e-i,s=t-a;return Math.hypot(this.#u*o,this.#d*s)<=2?!1:(this.#o.push(e,t),isNaN(n)?(this.#e.set([i,a,e,t],2),this.#n.push(NaN,NaN,NaN,NaN,e,t),!0):(isNaN(this.#e[0])&&this.#n.splice(6,6),this.#e.set([n,r,i,a,e,t],0),this.#n.push(..._O.createBezierPoints(n,r,i,a,e,t)),!0))}end(e,t){return e!==void 0&&this.#p(e,t)||this.#o.length===2?{path:{d:this.toSVGPath()}}:{path:{d:this.#s}}}startNew(e,t,n,r,i){this.#u=n,this.#d=r,this.#i=i,[e,t]=this.#f(e,t);let a=this.#n=[NaN,NaN,NaN,NaN,e,t];this.#o=[e,t],this.#t.set([e,t],0);let o=this.#r.at(-1);return o&&(o.line=new Float32Array(o.line),o.points=new Float32Array(o.points)),this.#r.push({line:a,points:this.#o}),this.#e.set(a,0),this.#c=0,this.toSVGPath(),null}getLastElement(){return this.#r.at(-1)}setLastElement(e){return this.#r?(this.#r.push(e),this.#n=e.line,this.#o=e.points,this.#c=0,{path:{d:this.toSVGPath()}}):this.#l.setLastElement(e)}removeLastElement(){if(!this.#r)return this.#l.removeLastElement();this.#r.pop(),this.#s=``;for(let e=0,t=this.#r.length;e<t;e++){let{line:t,points:n}=this.#r[e];this.#n=t,this.#o=n,this.#c=0,this.toSVGPath()}return{path:{d:this.#s}}}#m(){let e=_O.svgRound(this.#t[0]),t=_O.svgRound(this.#t[1]);if(this.#o.length===2){let n=_O.svgRound(this.#n[4]),r=_O.svgRound(this.#n[5]);return`${this.#s} M ${n} ${r} L ${e} ${t}`}return`${this.#s} L ${e} ${t}`}toSVGPath(){let e=_O.svgRound(this.#n[4]),t=_O.svgRound(this.#n[5]);if(this.#o.length===2)return this.#s=`${this.#s} M ${e} ${t} Z`,this.#s;if(this.#o.length<=6){let n=this.#s.lastIndexOf(`M`);this.#s=`${this.#s.slice(0,n)} M ${e} ${t}`,this.#c=6}if(this.#o.length===4){let e=_O.svgRound(this.#n[10]),t=_O.svgRound(this.#n[11]);return this.#s=`${this.#s} L ${e} ${t}`,this.#c=12,this.#s}let n=[];this.#c===0&&(n.push(`M ${e} ${t}`),this.#c=6);for(let e=this.#c,t=this.#n.length;e<t;e+=6){let[t,r,i,a,o,s]=this.#n.slice(e,e+6).map(_O.svgRound);n.push(`C${t} ${r} ${i} ${a} ${o} ${s}`)}return this.#s+=n.join(` `),this.#c=this.#n.length,this.#s}getOutlines(e,t,n,r){let i=this.#r.at(-1);return i.line=new Float32Array(i.line),i.points=new Float32Array(i.points),this.#l.build(this.#r,e,t,n,this.#i,this.#a,r),this.#e=null,this.#n=null,this.#r=null,this.#s=null,this.#l}get defaultSVGProperties(){return{root:{viewBox:`0 0 10000 10000`},rootClass:{draw:!0},bbox:[0,0,1,1]}}},AO=class extends _O{#e;#t=0;#n;#r;#i;#a;#o;#s;#c;build(e,t,n,r,i,a,o){this.#i=t,this.#a=n,this.#o=r,this.#s=i,this.#c=a,this.#n=o??0,this.#r=e,this.#d()}get thickness(){return this.#c}setLastElement(e){return this.#r.push(e),{path:{d:this.toSVGPath()}}}removeLastElement(){return this.#r.pop(),{path:{d:this.toSVGPath()}}}toSVGPath(){let e=[];for(let{line:t}of this.#r){if(e.push(`M${_O.svgRound(t[4])} ${_O.svgRound(t[5])}`),t.length===6){e.push(`Z`);continue}if(t.length===12&&isNaN(t[6])){e.push(`L${_O.svgRound(t[10])} ${_O.svgRound(t[11])}`);continue}for(let n=6,r=t.length;n<r;n+=6){let[r,i,a,o,s,c]=t.subarray(n,n+6).map(_O.svgRound);e.push(`C${r} ${i} ${a} ${o} ${s} ${c}`)}}return e.join(``)}serialize([e,t,n,r],i){let a=[],o=[],[s,c,l,u]=this.#u(),d,f,p,m,h,g,_,v,y;switch(this.#s){case 0:y=_O._rescale,d=e,f=t+r,p=n,m=-r,h=e+s*n,g=t+(1-c-u)*r,_=e+(s+l)*n,v=t+(1-c)*r;break;case 90:y=_O._rescaleAndSwap,d=e,f=t,p=n,m=r,h=e+c*n,g=t+s*r,_=e+(c+u)*n,v=t+(s+l)*r;break;case 180:y=_O._rescale,d=e+n,f=t,p=-n,m=r,h=e+(1-s-l)*n,g=t+c*r,_=e+(1-s)*n,v=t+(c+u)*r;break;case 270:y=_O._rescaleAndSwap,d=e+n,f=t+r,p=-n,m=-r,h=e+(1-c-u)*n,g=t+(1-s-l)*r,_=e+(1-c)*n,v=t+(1-s)*r;break}for(let{line:e,points:t}of this.#r)a.push(y(e,d,f,p,m,i?Array(e.length):null)),o.push(y(t,d,f,p,m,i?Array(t.length):null));return{lines:a,points:o,rect:[h,g,_,v]}}static deserialize(e,t,n,r,i,{paths:{lines:a,points:o},rotation:s,thickness:c}){let l=[],u,d,f,p,m;switch(s){case 0:m=_O._rescale,u=-e/n,d=t/r+1,f=1/n,p=-1/r;break;case 90:m=_O._rescaleAndSwap,u=-t/r,d=-e/n,f=1/r,p=1/n;break;case 180:m=_O._rescale,u=e/n+1,d=-t/r,f=-1/n,p=1/r;break;case 270:m=_O._rescaleAndSwap,u=t/r+1,d=e/n+1,f=-1/r,p=-1/n;break}if(!a){a=[];for(let e of o){let t=e.length;if(t===2){a.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1]]));continue}if(t===4){a.push(new Float32Array([NaN,NaN,NaN,NaN,e[0],e[1],NaN,NaN,NaN,NaN,e[2],e[3]]));continue}let n=new Float32Array(3*(t-2));a.push(n);let[r,i,o,s]=e.subarray(0,4);n.set([NaN,NaN,NaN,NaN,r,i],0);for(let a=4;a<t;a+=2){let t=e[a],c=e[a+1];n.set(_O.createBezierPoints(r,i,o,s,t,c),(a-2)*3),[r,i,o,s]=[o,s,t,c]}}}for(let e=0,t=a.length;e<t;e++)l.push({line:m(a[e].map(e=>e??NaN),u,d,f,p),points:m(o[e].map(e=>e??NaN),u,d,f,p)});let h=new this.prototype.constructor;return h.build(l,n,r,1,s,c,i),h}#l(e=this.#c){let t=this.#n+e/2*this.#o;return this.#s%180==0?[t/this.#i,t/this.#a]:[t/this.#a,t/this.#i]}#u(){let[e,t,n,r]=this.#e,[i,a]=this.#l(0);return[e+i,t+a,n-2*i,r-2*a]}#d(){let e=this.#e=zS.slice();for(let{line:t}of this.#r){if(t.length<=12){for(let n=4,r=t.length;n<r;n+=6)TC.pointBoundingBox(t[n],t[n+1],e);continue}let n=t[4],r=t[5];for(let i=6,a=t.length;i<a;i+=6){let[a,o,s,c,l,u]=t.subarray(i,i+6);TC.bezierBoundingBox(n,r,a,o,s,c,l,u,e),n=l,r=u}}let[t,n]=this.#l();e[0]=IC(e[0]-t,0,1),e[1]=IC(e[1]-n,0,1),e[2]=IC(e[2]+t,0,1),e[3]=IC(e[3]+n,0,1),e[2]-=e[0],e[3]-=e[1]}get box(){return this.#e}updateProperty(e,t){return e===`stroke-width`?this.#f(t):null}#f(e){let[t,n]=this.#l();this.#c=e;let[r,i]=this.#l(),[a,o]=[r-t,i-n],s=this.#e;return s[0]-=a,s[1]-=o,s[2]+=2*a,s[3]+=2*o,s}updateParentDimensions([e,t],n){let[r,i]=this.#l();this.#i=e,this.#a=t,this.#o=n;let[a,o]=this.#l(),s=a-r,c=o-i,l=this.#e;return l[0]-=s,l[1]-=c,l[2]+=2*s,l[3]+=2*c,l}updateRotation(e){return this.#t=e,{path:{transform:this.rotationTransform}}}get viewBox(){return this.#e.map(_O.svgRound).join(` `)}get defaultProperties(){let[e,t]=this.#e;return{root:{viewBox:this.viewBox},path:{"transform-origin":`${_O.svgRound(e)} ${_O.svgRound(t)}`}}}get rotationTransform(){let[,,e,t]=this.#e,n=0,r=0,i=0,a=0,o=0,s=0;switch(this.#t){case 90:r=t/e,i=-e/t,o=e;break;case 180:n=-1,a=-1,o=e,s=t;break;case 270:r=-t/e,i=e/t,s=t;break;default:return``}return`matrix(${n} ${r} ${i} ${a} ${_O.svgRound(o)} ${_O.svgRound(s)})`}getPathResizingSVGProperties([e,t,n,r]){let[i,a]=this.#l(),[o,s,c,l]=this.#e;if(Math.abs(c-i)<=_O.PRECISION||Math.abs(l-a)<=_O.PRECISION){let i=e+n/2-(o+c/2),a=t+r/2-(s+l/2);return{path:{"transform-origin":`${_O.svgRound(e)} ${_O.svgRound(t)}`,transform:`${this.rotationTransform} translate(${i} ${a})`}}}let u=(n-2*i)/(c-2*i),d=(r-2*a)/(l-2*a),f=c/n,p=l/r;return{path:{"transform-origin":`${_O.svgRound(o)} ${_O.svgRound(s)}`,transform:`${this.rotationTransform} scale(${f} ${p}) translate(${_O.svgRound(i)} ${_O.svgRound(a)}) scale(${u} ${d}) translate(${_O.svgRound(-i)} ${_O.svgRound(-a)})`}}}getPathResizedSVGProperties([e,t,n,r]){let[i,a]=this.#l(),o=this.#e,[s,c,l,u]=o;if(o[0]=e,o[1]=t,o[2]=n,o[3]=r,Math.abs(l-i)<=_O.PRECISION||Math.abs(u-a)<=_O.PRECISION){let i=e+n/2-(s+l/2),a=t+r/2-(c+u/2);for(let{line:e,points:t}of this.#r)_O._translate(e,i,a,e),_O._translate(t,i,a,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${_O.svgRound(e)} ${_O.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}let d=(n-2*i)/(l-2*i),f=(r-2*a)/(u-2*a),p=-d*(s+i)+e+i,m=-f*(c+a)+t+a;if(d!==1||f!==1||p!==0||m!==0)for(let{line:e,points:t}of this.#r)_O._rescale(e,p,m,d,f,e),_O._rescale(t,p,m,d,f,t);return{root:{viewBox:this.viewBox},path:{"transform-origin":`${_O.svgRound(e)} ${_O.svgRound(t)}`,transform:this.rotationTransform||null,d:this.toSVGPath()}}}getPathTranslatedSVGProperties([e,t],n){let[r,i]=n,a=this.#e,o=e-a[0],s=t-a[1];if(this.#i===r&&this.#a===i)for(let{line:e,points:t}of this.#r)_O._translate(e,o,s,e),_O._translate(t,o,s,t);else{let e=this.#i/r,t=this.#a/i;this.#i=r,this.#a=i;for(let{line:n,points:r}of this.#r)_O._rescale(n,o,s,e,t,n),_O._rescale(r,o,s,e,t,r);a[2]*=e,a[3]*=t}return a[0]=e,a[1]=t,{root:{viewBox:this.viewBox},path:{d:this.toSVGPath(),"transform-origin":`${_O.svgRound(e)} ${_O.svgRound(t)}`}}}get defaultSVGProperties(){let e=this.#e;return{root:{viewBox:this.viewBox},rootClass:{draw:!0},path:{d:this.toSVGPath(),"transform-origin":`${_O.svgRound(e[0])} ${_O.svgRound(e[1])}`,transform:this.rotationTransform||null},bbox:e}}},jO=class e extends hO{constructor(e){super(),this._viewParameters=e,super.updateProperties({fill:`none`,stroke:Iw._defaultLineColor,"stroke-opacity":1,"stroke-width":1,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-miterlimit":10})}updateSVGProperty(e,t){e===`stroke-width`&&(t??=this[`stroke-width`],t*=this._viewParameters.realScale),super.updateSVGProperty(e,t)}clone(){let t=new e(this._viewParameters);return t.updateAll(this),t}},MO=class e extends gO{static _type=`ink`;static _editorType=KS.INK;static _defaultDrawingOptions=null;constructor(e){super({...e,name:`inkEditor`}),this._willKeepAspectRatio=!0,this.defaultL10nId=`pdfjs-editor-ink-editor`}static initialize(e,t){Iw.initialize(e,t),this._defaultDrawingOptions=new jO(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!0}static get typesMap(){return mC(this,`typesMap`,new Map([[qS.INK_THICKNESS,`stroke-width`],[qS.INK_COLOR,`stroke`],[qS.INK_OPACITY,`stroke-opacity`]]))}static createDrawerInstance({x:e,y:t,box:[,,n,r],rotation:i}){return new kO(e,t,n,r,i,this._defaultDrawingOptions[`stroke-width`])}static deserializeDraw(e,t,n,r,i,a){return AO.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=null;if(e instanceof iO){let{data:{inkLists:t,rect:n,rotation:i,id:a,color:o,opacity:s,borderStyle:{rawWidth:c},popupRef:l,richText:u,contentsObj:d,creationDate:f,modificationDate:p},parent:{page:{pageNumber:m}}}=e;r=e={annotationType:KS.INK,color:Array.from(o),thickness:c,opacity:s,paths:{points:t},boxes:null,pageIndex:m-1,rect:n.slice(0),rotation:i,annotationElementId:a,id:a,deleted:!1,popupRef:l,richText:u,comment:d?.str||null,creationDate:f,modificationDate:p}}let i=await super.deserialize(e,t,n);return i._initialData=r,e.comment&&i.setCommentData(e),i}get toolbarButtons(){return this._colorPicker||=new OD(this),[[`colorPicker`,this._colorPicker]]}get colorType(){return qS.INK_COLOR}get colorAndOpacityType(){return qS.INK_COLOR_AND_OPACITY}get opacityType(){return qS.INK_OPACITY}updateParams(e,t){if(e===qS.INK_COLOR_AND_OPACITY){this._updateColorAndOpacity(t.color,t.opacity);return}super.updateParams(e,t)}static updateDefaultParams(e,t){if(e===qS.INK_COLOR_AND_OPACITY){super.updateDefaultParams(qS.INK_COLOR,t.color),super.updateDefaultParams(qS.INK_OPACITY,t.opacity);return}super.updateDefaultParams(e,t)}get color(){return this._drawingOptions.stroke}get opacity(){return this._drawingOptions[`stroke-opacity`]}onScaleChanging(){if(!this.parent)return;super.onScaleChanging();let{_drawId:e,_drawingOptions:t,parent:n}=this;t.updateSVGProperty(`stroke-width`),n.drawLayer.updateProperties(e,t.toSVGProperties())}static onScaleChangingWhenDrawing(){let e=this._currentParent;e&&(super.onScaleChangingWhenDrawing(),this._defaultDrawingOptions.updateSVGProperty(`stroke-width`),e.drawLayer.updateProperties(this._currentDrawId,this._defaultDrawingOptions.toSVGProperties()))}createDrawingOptions({color:t,thickness:n,opacity:r}){this._drawingOptions=e.getDefaultDrawingOptions({stroke:TC.makeHexColor(...t),"stroke-width":n,"stroke-opacity":r})}serialize(e=!1){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let{lines:t,points:n}=this.serializeDraw(e),{_drawingOptions:{stroke:r,"stroke-opacity":i,"stroke-width":a}}=this,o=Object.assign(super.serialize(e),{color:Iw._colorManager.convert(r),opacity:i,thickness:a,paths:{lines:t,points:n}});return this.addComment(o),e?(o.isCopy=!0,o):this.annotationElementId&&!this.#e(o)?null:(o.id=this.annotationElementId,o)}#e(e){let{color:t,thickness:n,opacity:r,pageIndex:i}=this._initialData;return this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized||e.color.some((e,n)=>e!==t[n])||e.thickness!==n||e.opacity!==r||e.pageIndex!==i}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let{points:t,rect:n}=this.serializeDraw(!1);return e.updateEdited({rect:n,thickness:this._drawingOptions[`stroke-width`],points:t,popup:this.comment}),null}},NO=class extends AO{toSVGPath(){let e=super.toSVGPath();return e.endsWith(`Z`)||(e+=`Z`),e}},PO=8,FO=3,IO=class{static#e={maxDim:512,sigmaSFactor:.02,sigmaR:25,kernelSize:16};static#t(e,t,n,r){return n-=e,r-=t,n===0?r>0?0:4:n===1?r+6:2-r}static#n=new Int32Array([0,1,-1,1,-1,0,-1,-1,0,-1,1,-1,1,0,1,1]);static#r(e,t,n,r,i,a,o){let s=this.#t(n,r,i,a);for(let i=0;i<8;i++){let a=(-i+s-o+16)%8,c=this.#n[2*a],l=this.#n[2*a+1];if(e[(n+c)*t+(r+l)]!==0)return a}return-1}static#i(e,t,n,r,i,a,o){let s=this.#t(n,r,i,a);for(let i=0;i<8;i++){let a=(i+s+o+16)%8,c=this.#n[2*a],l=this.#n[2*a+1];if(e[(n+c)*t+(r+l)]!==0)return a}return-1}static#a(e,t,n,r){let i=e.length,a=new Int32Array(i);for(let t=0;t<i;t++)a[t]=+(e[t]<=r);for(let e=1;e<n-1;e++)a[e*t]=a[e*t+t-1]=0;for(let e=0;e<t;e++)a[e]=a[t*n-1-e]=0;let o=1,s,c=[];for(let e=1;e<n-1;e++){s=1;for(let n=1;n<t-1;n++){let r=e*t+n,i=a[r];if(i===0)continue;let l=e,u=n;if(i===1&&a[r-1]===0)o+=1,--u;else if(i>=1&&a[r+1]===0)o+=1,u+=1,i>1&&(s=i);else{i!==1&&(s=Math.abs(i));continue}let d=[n,e],f=u===n+1,p={isHole:f,points:d,id:o,parent:0};c.push(p);let m;for(let e of c)if(e.id===s){m=e;break}m?m.isHole?p.parent=f?m.parent:s:p.parent=f?s:m.parent:p.parent=f?s:0;let h=this.#r(a,t,e,n,l,u,0);if(h===-1){a[r]=-o,a[r]!==1&&(s=Math.abs(a[r]));continue}let g=this.#n[2*h],_=this.#n[2*h+1],v=e+g,y=n+_;l=v,u=y;let b=e,x=n;for(;;){let i=this.#i(a,t,b,x,l,u,1);g=this.#n[2*i],_=this.#n[2*i+1];let c=b+g,f=x+_;d.push(f,c);let p=b*t+x;if(a[p+1]===0?a[p]=-o:a[p]===1&&(a[p]=o),c===e&&f===n&&b===v&&x===y){a[r]!==1&&(s=Math.abs(a[r]));break}else l=b,u=x,b=c,x=f}}}return c}static#o(e,t,n,r){if(n-t<=4){for(let i=t;i<n-2;i+=2)r.push(e[i],e[i+1]);return}let i=e[t],a=e[t+1],o=e[n-4]-i,s=e[n-3]-a,c=Math.hypot(o,s),l=o/c,u=s/c,d=l*a-u*i,f=s/o,p=1/c,m=Math.atan(f),h=Math.cos(m),g=Math.sin(m),_=p*(Math.abs(h)+Math.abs(g)),v=p*(1-_+_**2),y=Math.max(Math.atan(Math.abs(g+h)*v),Math.atan(Math.abs(g-h)*v)),b=0,x=t;for(let r=t+2;r<n-2;r+=2){let t=Math.abs(d-l*e[r+1]+u*e[r]);t>b&&(x=r,b=t)}b>(c*y)**2?(this.#o(e,t,x+2,r),this.#o(e,x,n,r)):r.push(i,a)}static#s(e){let t=[],n=e.length;return this.#o(e,0,n,t),t.push(e[n-2],e[n-1]),t.length<=4?null:t}static#c(e,t,n,r,i,a){let o=new Float32Array(a**2),s=-2*r**2,c=a>>1;for(let e=0;e<a;e++){let t=(e-c)**2;for(let n=0;n<a;n++)o[e*a+n]=Math.exp((t+(n-c)**2)/s)}let l=new Float32Array(256),u=-2*i**2;for(let e=0;e<256;e++)l[e]=Math.exp(e**2/u);let d=e.length,f=new Uint8Array(d),p=new Uint32Array(256);for(let r=0;r<n;r++)for(let i=0;i<t;i++){let s=r*t+i,u=e[s],d=0,m=0;for(let s=0;s<a;s++){let f=r+s-c;if(!(f<0||f>=n))for(let n=0;n<a;n++){let r=i+n-c;if(r<0||r>=t)continue;let p=e[f*t+r],h=o[s*a+n]*l[Math.abs(p-u)];d+=p*h,m+=h}}let h=f[s]=Math.round(d/m);p[h]++}return[f,p]}static#l(e){let t=new Uint32Array(256);for(let n of e)t[n]++;return t}static#u(e){let t=e.length,n=new Uint8ClampedArray(t>>2),r=-1/0,i=1/0;for(let t=0,a=n.length;t<a;t++){let a=n[t]=e[t<<2];r=Math.max(r,a),i=Math.min(i,a)}let a=255/(r-i);for(let e=0,t=n.length;e<t;e++)n[e]=(n[e]-i)*a;return n}static#d(e){let t,n=-1/0,r=-1/0,i=e.findIndex(e=>e!==0),a=i,o=i;for(t=i;t<256;t++){let i=e[t];i>n&&(t-a>r&&(r=t-a,o=t-1),n=i,a=t)}for(t=o-1;t>=0&&!(e[t]>e[t+1]);t--);return t}static#f(e){let t=e,{width:n,height:r}=e,{maxDim:i}=this.#e,a=n,o=r;if(n>i||r>i){let s=n,c=r,l=Math.log2(Math.max(n,r)/i),u=Math.floor(l);l=l===u?u-1:u;for(let n=0;n<l;n++){a=Math.ceil(s/2),o=Math.ceil(c/2);let n=new OffscreenCanvas(a,o);n.getContext(`2d`).drawImage(e,0,0,s,c,0,0,a,o),s=a,c=o,e!==t&&e.close(),e=n.transferToImageBitmap()}let d=Math.min(i/a,i/o);a=Math.round(a*d),o=Math.round(o*d)}let s=new OffscreenCanvas(a,o).getContext(`2d`,{willReadFrequently:!0});s.fillStyle=`white`,s.fillRect(0,0,a,o),s.filter=`grayscale(1)`,s.drawImage(e,0,0,e.width,e.height,0,0,a,o);let c=s.getImageData(0,0,a,o).data;return[this.#u(c),a,o]}static extractContoursFromText(e,{fontFamily:t,fontStyle:n,fontWeight:r},i,a,o,s){let c=new OffscreenCanvas(1,1),l=c.getContext(`2d`,{alpha:!1}),u=l.font=`${n} ${r} 200px ${t}`,{actualBoundingBoxLeft:d,actualBoundingBoxRight:f,actualBoundingBoxAscent:p,actualBoundingBoxDescent:m,fontBoundingBoxAscent:h,fontBoundingBoxDescent:g,width:_}=l.measureText(e),v=1.5,y=Math.ceil(Math.max(Math.abs(d)+Math.abs(f)||0,_)*v),b=Math.ceil(Math.max(Math.abs(p)+Math.abs(m)||200,Math.abs(h)+Math.abs(g)||200)*v);c=new OffscreenCanvas(y,b),l=c.getContext(`2d`,{alpha:!0,willReadFrequently:!0}),l.font=u,l.filter=`grayscale(1)`,l.fillStyle=`white`,l.fillRect(0,0,y,b),l.fillStyle=`black`,l.fillText(e,y*(v-1)/2,b*(3-v)/2);let x=this.#u(l.getImageData(0,0,y,b).data),S=this.#l(x),C=this.#d(S),w=this.#a(x,y,b,C);return this.processDrawnLines({lines:{curves:w,width:y,height:b},pageWidth:i,pageHeight:a,rotation:o,innerMargin:s,mustSmooth:!0,areContours:!0})}static process(e,t,n,r,i){let[a,o,s]=this.#f(e),[c,l]=this.#c(a,o,s,Math.hypot(o,s)*this.#e.sigmaSFactor,this.#e.sigmaR,this.#e.kernelSize),u=this.#d(l),d=this.#a(c,o,s,u);return this.processDrawnLines({lines:{curves:d,width:o,height:s},pageWidth:t,pageHeight:n,rotation:r,innerMargin:i,mustSmooth:!0,areContours:!0})}static processDrawnLines({lines:e,pageWidth:t,pageHeight:n,rotation:r,innerMargin:i,mustSmooth:a,areContours:o}){r%180!=0&&([t,n]=[n,t]);let{curves:s,width:c,height:l}=e,u=e.thickness??0,d=[],f=Math.min(t/c,n/l),p=f/t,m=f/n,h=[];for(let{points:e}of s){let t=a?this.#s(e):e;if(!t)continue;h.push(t);let n=t.length,r=new Float32Array(n),i=new Float32Array(3*(n===2?2:n-2));if(d.push({line:i,points:r}),n===2){r[0]=t[0]*p,r[1]=t[1]*m,i.set([NaN,NaN,NaN,NaN,r[0],r[1]],0);continue}let[o,s,c,l]=t;o*=p,s*=m,c*=p,l*=m,r.set([o,s,c,l],0),i.set([NaN,NaN,NaN,NaN,o,s],0);for(let e=4;e<n;e+=2){let n=r[e]=t[e]*p,a=r[e+1]=t[e+1]*m;i.set(_O.createBezierPoints(o,s,c,l,n,a),(e-2)*3),[o,s,c,l]=[c,l,n,a]}}if(d.length===0)return null;let g=o?new NO:new AO;return g.build(d,t,n,1,r,o?0:u,i),{outline:g,newCurves:h,areContours:o,thickness:u,width:c,height:l}}static async compressSignature({outlines:e,areContours:t,thickness:n,width:r,height:i}){let a=1/0,o=-1/0,s=0;for(let t of e){s+=t.length;for(let e=2,n=t.length;e<n;e++){let n=t[e]-t[e-2];a=Math.min(a,n),o=Math.max(o,n)}}let c;c=a>=-128&&o<=127?Int8Array:a>=-32768&&o<=32767?Int16Array:Int32Array;let l=e.length,u=PO+FO*l,d=new Uint32Array(u),f=0;d[f++]=u*Uint32Array.BYTES_PER_ELEMENT+(s-2*l)*c.BYTES_PER_ELEMENT,d[f++]=0,d[f++]=r,d[f++]=i,d[f++]=+!t,d[f++]=Math.max(0,Math.floor(n??0)),d[f++]=l,d[f++]=c.BYTES_PER_ELEMENT;for(let t of e)d[f++]=t.length-2,d[f++]=t[0],d[f++]=t[1];let p=new CompressionStream(`deflate-raw`),m=p.writable.getWriter();await m.ready,m.write(d);let h=c.prototype.constructor;for(let t of e){let e=new h(t.length-2);for(let n=2,r=t.length;n<r;n++)e[n-2]=t[n]-t[n-2];m.write(e)}return m.close(),(await new Response(p.readable).bytes()).toBase64()}static async decompressSignature(e){try{let t=Uint8Array.fromBase64(e),{readable:n,writable:r}=new DecompressionStream(`deflate-raw`),i=r.getWriter();await i.ready,i.write(t).then(async()=>{await i.ready,await i.close()}).catch(()=>{});let a=null,o=0;for await(let e of n)a||=new Uint8Array(new Uint32Array(e.buffer,0,4)[0]),a.set(e,o),o+=e.length;let s=new Uint32Array(a.buffer,0,a.length>>2),c=s[1];if(c!==0)throw Error(`Invalid version: ${c}`);let l=s[2],u=s[3],d=s[4]===0,f=s[5],p=s[6],m=s[7],h=[],g=(PO+FO*p)*Uint32Array.BYTES_PER_ELEMENT,_;switch(m){case Int8Array.BYTES_PER_ELEMENT:_=new Int8Array(a.buffer,g);break;case Int16Array.BYTES_PER_ELEMENT:_=new Int16Array(a.buffer,g);break;case Int32Array.BYTES_PER_ELEMENT:_=new Int32Array(a.buffer,g);break}o=0;for(let e=0;e<p;e++){let t=s[FO*e+PO],n=new Float32Array(t+2);h.push(n);for(let t=0;t<FO-1;t++)n[t]=s[FO*e+PO+t+1];for(let e=0;e<t;e++)n[e+2]=n[e]+_[o++]}return{areContours:d,thickness:f,outlines:h,width:l,height:u}}catch(e){return sC(`decompressSignature: ${e}`),null}}},LO=class e extends hO{constructor(){super(),super.updateProperties({fill:Iw._defaultLineColor,"stroke-width":0})}clone(){let t=new e;return t.updateAll(this),t}},RO=class e extends jO{constructor(e){super(e),super.updateProperties({stroke:Iw._defaultLineColor,"stroke-width":1})}clone(){let t=new e(this._viewParameters);return t.updateAll(this),t}},zO=class e extends gO{#e=!1;#t=null;#n=null;#r=null;static _type=`signature`;static _editorType=KS.SIGNATURE;static _defaultDrawingOptions=null;constructor(e){super({...e,mustBeCommitted:!0,name:`signatureEditor`}),this._willKeepAspectRatio=!0,this.#n=e.signatureData||null,this.#t=null,this.defaultL10nId=`pdfjs-editor-signature-editor1`}static initialize(e,t){Iw.initialize(e,t),this._defaultDrawingOptions=new LO,this._defaultDrawnSignatureOptions=new RO(t.viewParameters)}static getDefaultDrawingOptions(e){let t=this._defaultDrawingOptions.clone();return t.updateProperties(e),t}static get supportMultipleDrawings(){return!1}static get typesMap(){return mC(this,`typesMap`,new Map)}static get isDrawer(){return!1}get telemetryFinalData(){return{type:`signature`,hasDescription:!!this.#t}}static computeTelemetryFinalData(e){let t=e.get(`hasDescription`);return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}get isResizable(){return!0}onScaleChanging(){this._drawId!==null&&super.onScaleChanging()}render(){if(this.div)return this.div;let t,n,{_isCopy:r}=this;if(r&&(this._isCopy=!1,t=this.x,n=this.y),super.render(),this._drawId===null)if(this.#n){let{lines:t,mustSmooth:n,areContours:r,description:i,uuid:a,heightInPage:o}=this.#n,{rawDims:{pageWidth:s,pageHeight:c},rotation:l}=this.parent.viewport,u=IO.processDrawnLines({lines:t,pageWidth:s,pageHeight:c,rotation:l,innerMargin:e._INNER_MARGIN,mustSmooth:n,areContours:r});this.addSignature(u,o,i,a)}else this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:``})),this.div.hidden=!0,this._uiManager.getSignature(this);else this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:this.#t||``}));return r&&(this._isCopy=!0,this._moveAfterPaste(t,n)),this.div}setUuid(e){this.#r=e,this.addEditToolbar()}getUuid(){return this.#r}get description(){return this.#t}set description(e){this.#t=e,this.div&&(this.div.setAttribute(`data-l10n-args`,JSON.stringify({description:e})),super.addEditToolbar().then(t=>{t?.updateEditSignatureButton(e)}))}getSignaturePreview(){let{newCurves:e,areContours:t,thickness:n,width:r,height:i}=this.#n,a=Math.max(r,i);return{areContours:t,outline:IO.processDrawnLines({lines:{curves:e.map(e=>({points:e})),thickness:n,width:r,height:i},pageWidth:a,pageHeight:a,rotation:0,innerMargin:0,mustSmooth:!1,areContours:t}).outline}}get toolbarButtons(){return this._uiManager.signatureManager?[[`editSignature`,this._uiManager.signatureManager]]:super.toolbarButtons}addSignature(t,n,r,i){let{x:a,y:o}=this,{outline:s}=this.#n=t;this.#e=s instanceof NO,this.description=r;let c;this.#e?c=e.getDefaultDrawingOptions():(c=e._defaultDrawnSignatureOptions.clone(),c.updateProperties({"stroke-width":s.thickness})),this._addOutlines({drawOutlines:s,drawingOptions:c});let[,l]=this.pageDimensions,u=n/l;u=u>=1?.5:u,this.width*=u/this.height,this.width>=1&&(u*=.9/this.width,this.width=.9),this.height=u,this.setDims(),this.x=a,this.y=o,this.center(),this._onResized(),this.onScaleChanging(),this.rotate(),this._uiManager.addToAnnotationStorage(this),this.setUuid(i),this._reportTelemetry({action:`pdfjs.signature.inserted`,data:{hasBeenSaved:!!i,hasDescription:!!r}}),this.div.hidden=!1}getFromImage(t){let{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return IO.process(t,n,r,i,e._INNER_MARGIN)}getFromText(t,n){let{rawDims:{pageWidth:r,pageHeight:i},rotation:a}=this.parent.viewport;return IO.extractContoursFromText(t,n,r,i,a,e._INNER_MARGIN)}getDrawnSignature(t){let{rawDims:{pageWidth:n,pageHeight:r},rotation:i}=this.parent.viewport;return IO.processDrawnLines({lines:t,pageWidth:n,pageHeight:r,rotation:i,innerMargin:e._INNER_MARGIN,mustSmooth:!1,areContours:!1})}createDrawingOptions({areContours:t,thickness:n}){t?this._drawingOptions=e.getDefaultDrawingOptions():(this._drawingOptions=e._defaultDrawnSignatureOptions.clone(),this._drawingOptions.updateProperties({"stroke-width":n}))}serialize(e=!1){if(this.isEmpty())return null;let{lines:t,points:n}=this.serializeDraw(e),{_drawingOptions:{"stroke-width":r}}=this,i=Object.assign(super.serialize(e),{isSignature:!0,areContours:this.#e,color:[0,0,0],thickness:this.#e?0:r});return this.addComment(i),e?(i.paths={lines:t,points:n},i.uuid=this.#r,i.isCopy=!0):i.lines=t,this.#t&&(i.accessibilityData={type:`Figure`,alt:this.#t}),i}static deserializeDraw(e,t,n,r,i,a){return a.areContours?NO.deserialize(e,t,n,r,i,a):AO.deserialize(e,t,n,r,i,a)}static async deserialize(e,t,n){let r=await super.deserialize(e,t,n);return r.#e=e.areContours,r.description=e.accessibilityData?.alt||``,r.#r=e.uuid,r}},BO=class extends Iw{#e=null;#t=null;#n=null;#r=null;#i=null;#a=``;#o=null;#s=!1;#c=null;#l=!1;#u=!1;static _type=`stamp`;static _editorType=KS.STAMP;constructor(e){super({...e,name:`stampEditor`}),this.#r=e.bitmapUrl,this.#i=e.bitmapFile,this.defaultL10nId=`pdfjs-editor-stamp-editor`}static initialize(e,t){Iw.initialize(e,t)}static isHandlingMimeForPasting(e){return sw.includes(e)}static paste(e,t){t.pasteEditor({mode:KS.STAMP},{bitmapFile:e.getAsFile()})}altTextFinish(){this._uiManager.useNewAltTextFlow&&(this.div.hidden=!1),super.altTextFinish()}get telemetryFinalData(){return{type:`stamp`,hasAltText:!!this.altTextData?.altText}}static computeTelemetryFinalData(e){let t=e.get(`hasAltText`);return{hasAltText:t.get(!0)??0,hasNoAltText:t.get(!1)??0}}#d(e,t=!1){if(!e){this.remove();return}this.#e=e.bitmap,t||(this.#t=e.id,this.#l=e.isSvg),e.file&&(this.#a=e.file.name),this.#m()}#f(){if(this.#n=null,this._uiManager.enableWaiting(!1),this.#o){if(this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this.addEditToolbar().then(()=>{this._editToolbar.hide(),this._uiManager.editAltText(this,!0)});return}if(!this._uiManager.useNewAltTextWhenAddingImage&&this._uiManager.useNewAltTextFlow&&this.#e){this._reportTelemetry({action:`pdfjs.image.image_added`,data:{alt_text_modal:!1,alt_text_type:`empty`}});try{this.mlGuessAltText()}catch{}}this.div.focus()}}async mlGuessAltText(e=null,t=!0){if(this.hasAltTextData())return null;let{mlManager:n}=this._uiManager;if(!n)throw Error(`No ML.`);if(!await n.isEnabledFor(`altText`))throw Error(`ML isn't enabled for alt text.`);let{data:r,width:i,height:a}=e||this.copyCanvas(null,null,!0).imageData,o=await n.guess({name:`altText`,request:{data:r,width:i,height:a,channels:r.length/(i*a)}});if(!o)throw Error(`No response from the AI service.`);if(o.error)throw Error(`Error from the AI service.`);if(o.cancel)return null;if(!o.output)throw Error(`No valid response from the AI service.`);let s=o.output;return await this.setGuessedAltText(s),t&&!this.hasAltTextData()&&(this.altTextData={alt:s,decorative:!1}),s}#p(){if(this.#t){this._uiManager.enableWaiting(!0),this._uiManager.imageManager.getFromId(this.#t).then(e=>this.#d(e,!0)).finally(()=>this.#f());return}if(this.#r){let e=this.#r;this.#r=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromUrl(e).then(e=>this.#d(e)).finally(()=>this.#f());return}if(this.#i){let e=this.#i;this.#i=null,this._uiManager.enableWaiting(!0),this.#n=this._uiManager.imageManager.getFromFile(e).then(e=>this.#d(e)).finally(()=>this.#f());return}let e=document.createElement(`input`);e.type=`file`,e.accept=sw.join(`,`);let t=this._uiManager._signal;this.#n=new Promise(n=>{e.addEventListener(`change`,async()=>{if(!e.files||e.files.length===0)this.remove();else{this._uiManager.enableWaiting(!0);let t=await this._uiManager.imageManager.getFromFile(e.files[0]);this._reportTelemetry({action:`pdfjs.image.image_selected`,data:{alt_text_modal:this._uiManager.useNewAltTextFlow}}),this.#d(t)}n()},{signal:t}),e.addEventListener(`cancel`,()=>{this.remove(),n()},{signal:t})}).finally(()=>this.#f()),e.click()}remove(){this.#t&&(this.#e=null,this._uiManager.imageManager.deleteId(this.#t),this.#o?.remove(),this.#o=null,this.#c&&=(clearTimeout(this.#c),null)),super.remove()}rebuild(){if(!this.parent){this.#t&&this.#p();return}super.rebuild(),this.div!==null&&(this.#t&&this.#o===null&&this.#p(),this.isAttachedToDOM||this.parent.add(this))}onceAdded(e){this._isDraggable=!0,e&&this.div.focus()}isEmpty(){return!(this.#n||this.#e||this.#r||this.#i||this.#t||this.#s)}get toolbarButtons(){return[[`altText`,this.createAltText()]]}get isResizable(){return!0}render(){if(this.div)return this.div;let e,t;return this._isCopy&&(e=this.x,t=this.y),super.render(),this.div.hidden=!0,this.createAltText(),this.#s||(this.#e?this.#m():this.#p()),this._isCopy&&this._moveAfterPaste(e,t),this._uiManager.addShouldRescale(this),this.div}setCanvas(e,t){let{id:n,bitmap:r}=this._uiManager.imageManager.getFromCanvas(e,t);t.remove(),n&&this._uiManager.imageManager.isValidId(n)&&(this.#t=n,r&&(this.#e=r),this.#s=!1,this.#m())}_onResized(){this.onScaleChanging()}onScaleChanging(){this.parent&&(this.#c!==null&&clearTimeout(this.#c),this.#c=setTimeout(()=>{this.#c=null,this.#g()},200))}#m(){let{div:e}=this,{width:t,height:n}=this.#e,[r,i]=this.pageDimensions,a=.75;if(this.width)t=this.width*r,n=this.height*i;else if(t>a*r||n>a*i){let e=Math.min(a*r/t,a*i/n);t*=e,n*=e}this._uiManager.enableWaiting(!1);let o=this.#o=document.createElement(`canvas`);o.setAttribute(`role`,`img`),this.addContainer(o),this.width=t/r,this.height=n/i,this.setDims(),this._initialOptions?.isCentered?this.center():this.fixAndSetPosition(),this._initialOptions=null,(!this._uiManager.useNewAltTextWhenAddingImage||!this._uiManager.useNewAltTextFlow||this.annotationElementId)&&(e.hidden=!1),this.#g(),this.#u||=(this.parent.addUndoableEditor(this),!0),this._reportTelemetry({action:`inserted_image`}),this.#a&&this.div.setAttribute(`aria-description`,this.#a),this.annotationElementId||this._uiManager.a11yAlert(Iw._l10nAlert.stamp)}copyCanvas(e,t,n=!1){e||=224;let{width:r,height:i}=this.#e,a=new ow,o=this.#e,s=r,c=i,l=null;if(t){if(r>t||i>t){let e=Math.min(t/r,t/i);s=Math.floor(r*e),c=Math.floor(i*e)}l=document.createElement(`canvas`);let e=l.width=Math.ceil(s*a.sx),n=l.height=Math.ceil(c*a.sy);this.#l||(o=this.#h(e,n));let u=l.getContext(`2d`);u.filter=this._uiManager.hcmFilter;let d=`white`,f=`#cfcfd8`;this._uiManager.hcmFilter===`none`?cw.isDarkMode&&(d=`#8f8f9d`,f=`#42414d`):f=`black`;let p=15*a.sx,m=15*a.sy,h=new OffscreenCanvas(p*2,m*2),g=h.getContext(`2d`);g.fillStyle=d,g.fillRect(0,0,p*2,m*2),g.fillStyle=f,g.fillRect(0,0,p,m),g.fillRect(p,m,p,m),u.fillStyle=u.createPattern(h,`repeat`),u.fillRect(0,0,e,n),u.drawImage(o,0,0,o.width,o.height,0,0,e,n)}let u=null;if(n){let t,n;if(a.symmetric&&o.width<e&&o.height<e)t=o.width,n=o.height;else if(o=this.#e,r>e||i>e){let a=Math.min(e/r,e/i);t=Math.floor(r*a),n=Math.floor(i*a),this.#l||(o=this.#h(t,n))}let s=new OffscreenCanvas(t,n).getContext(`2d`,{willReadFrequently:!0});s.drawImage(o,0,0,o.width,o.height,0,0,t,n),u={width:t,height:n,data:s.getImageData(0,0,t,n).data}}return{canvas:l,width:s,height:c,imageData:u}}#h(e,t){let{width:n,height:r}=this.#e,i=n,a=r,o=this.#e;for(;i>2*e||a>2*t;){let n=i,r=a;i>2*e&&(i=Math.ceil(i/2)),a>2*t&&(a=Math.ceil(a/2));let s=new OffscreenCanvas(i,a);s.getContext(`2d`).drawImage(o,0,0,n,r,0,0,i,a),o=s.transferToImageBitmap()}return o}#g(){let[e,t]=this.parentDimensions,{width:n,height:r}=this,i=new ow,a=Math.ceil(n*e*i.sx),o=Math.ceil(r*t*i.sy),s=this.#o;if(!s||s.width===a&&s.height===o)return;s.width=a,s.height=o;let c=this.#l?this.#e:this.#h(a,o),l=s.getContext(`2d`);l.filter=this._uiManager.hcmFilter,l.drawImage(c,0,0,c.width,c.height,0,0,a,o)}#_(e){if(e){if(this.#l){let e=this._uiManager.imageManager.getSvgUrl(this.#t);if(e)return e}let e=document.createElement(`canvas`);return{width:e.width,height:e.height}=this.#e,e.getContext(`2d`).drawImage(this.#e,0,0),e.toDataURL()}if(this.#l){let[e,t]=this.pageDimensions,n=Math.round(this.width*e*HC.PDF_TO_CSS_UNITS),r=Math.round(this.height*t*HC.PDF_TO_CSS_UNITS),i=new OffscreenCanvas(n,r);return i.getContext(`2d`).drawImage(this.#e,0,0,this.#e.width,this.#e.height,0,0,n,r),i.transferToImageBitmap()}return structuredClone(this.#e)}static async deserialize(e,t,n){let r=null,i=!1;if(e instanceof lO){let{data:{rect:a,rotation:o,id:s,structParent:c,popupRef:l,richText:u,contentsObj:d,creationDate:f,modificationDate:p},container:m,parent:{page:{pageNumber:h}},canvas:g}=e,_,v;g?(delete e.canvas,{id:_,bitmap:v}=n.imageManager.getFromCanvas(m.id,g),g.remove()):(i=!0,e._hasNoCanvas=!0);let y=(await t._structTree.getAriaAttributes(`${WS}${s}`))?.get(`aria-label`)||``;r=e={annotationType:KS.STAMP,bitmapId:_,bitmap:v,pageIndex:h-1,rect:a.slice(0),rotation:o,annotationElementId:s,id:s,deleted:!1,accessibilityData:{decorative:!1,altText:y},isSvg:!1,structParent:c,popupRef:l,richText:u,comment:d?.str||null,creationDate:f,modificationDate:p}}let a=await super.deserialize(e,t,n),{rect:o,bitmap:s,bitmapUrl:c,bitmapId:l,isSvg:u,accessibilityData:d}=e;i?(n.addMissingCanvas(e.id,a),a.#s=!0):l&&n.imageManager.isValidId(l)?(a.#t=l,s&&(a.#e=s)):a.#r=c,a.#l=u;let[f,p]=a.pageDimensions;return a.width=(o[2]-o[0])/f,a.height=(o[3]-o[1])/p,d&&(a.altTextData=d),a._initialData=r,e.comment&&a.setCommentData(e),a.#u=!!r,a}serialize(e=!1,t=null){if(this.isEmpty())return null;if(this.deleted)return this.serializeDeleted();let n=Object.assign(super.serialize(e),{bitmapId:this.#t,isSvg:this.#l});if(this.addComment(n),e)return n.bitmapUrl=this.#_(!0),n.accessibilityData=this.serializeAltText(!0),n.isCopy=!0,n;let{decorative:r,altText:i}=this.serializeAltText(!1);if(!r&&i&&(n.accessibilityData={type:`Figure`,alt:i}),this.annotationElementId){let e=this.#v(n);return e.isSame?null:(e.isSameAltText?delete n.accessibilityData:n.accessibilityData.structParent=this._initialData.structParent??-1,n.id=this.annotationElementId,delete n.bitmapId,n)}if(t===null)return n;t.stamps||=new Map;let a=this.#l?(n.rect[2]-n.rect[0])*(n.rect[3]-n.rect[1]):null;if(!t.stamps.has(this.#t))t.stamps.set(this.#t,{area:a,serialized:n}),n.bitmap=this.#_(!1);else if(this.#l){let e=t.stamps.get(this.#t);a>e.area&&(e.area=a,e.serialized.bitmap.close(),e.serialized.bitmap=this.#_(!1))}return n}#v(e){let{pageIndex:t,accessibilityData:{altText:n}}=this._initialData,r=e.pageIndex===t,i=(e.accessibilityData?.alt||``)===n;return{isSame:!this.hasEditedComment&&!this._hasBeenMoved&&!this._hasBeenResized&&r&&i,isSameAltText:i}}renderAnnotationElement(e){return this.deleted?(e.hide(),null):(e.updateEdited({rect:this.getPDFRect(),popup:this.comment}),null)}},VO=class e{#e;#t=!1;#n=null;#r=null;#i=null;#a=new Map;#o=!1;#s=!1;#c=!1;#l=null;#u=null;#d=null;#f=null;#p=null;#m=-1;#h;static _initialized=!1;static#g=new Map([mO,MO,BO,OO,zO].map(e=>[e._editorType,e]));constructor({uiManager:t,pageIndex:n,div:r,structTreeLayer:i,accessibilityManager:a,annotationLayer:o,drawLayer:s,textLayer:c,viewport:l,l10n:u}){let d=[...e.#g.values()];if(!e._initialized){e._initialized=!0;for(let e of d)e.initialize(u,t)}t.registerEditorTypes(d),this.#h=t,this.pageIndex=n,this.div=r,this.#e=a,this.#n=o,this.viewport=l,this.#d=c,this.drawLayer=s,this._structTree=i,this.#h.addLayer(this)}get isEmpty(){return this.#a.size===0}get isInvisible(){return this.isEmpty&&this.#h.getMode()===KS.NONE}updateToolbar(e){this.#h.updateToolbar(e)}updateMode(t=this.#h.getMode()){switch(this.#S(),t){case KS.NONE:this.div.classList.toggle(`nonEditing`,!0),this.disableTextSelection(),this.togglePointerEvents(!1),this.toggleAnnotationLayerPointerEvents(!0),this.disableClick();return;case KS.INK:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick();break;case KS.HIGHLIGHT:this.enableTextSelection(),this.togglePointerEvents(!1),this.disableClick();break;default:this.disableTextSelection(),this.togglePointerEvents(!0),this.enableClick()}this.toggleAnnotationLayerPointerEvents(!1);let{classList:n}=this.div;if(n.toggle(`nonEditing`,!1),t===KS.POPUP)n.toggle(`commentEditing`,!0);else{n.toggle(`commentEditing`,!1);for(let r of e.#g.values())n.toggle(`${r._type}Editing`,t===r._editorType)}this.div.hidden=!1}hasTextLayer(e){return e===this.#d?.div}setEditingState(e){this.#h.setEditingState(e)}addCommands(e){this.#h.addCommands(e)}cleanUndoStack(e){this.#h.cleanUndoStack(e)}toggleDrawing(e=!1){this.div.classList.toggle(`drawing`,!e)}togglePointerEvents(e=!1){this.div.classList.toggle(`disabled`,!e)}toggleAnnotationLayerPointerEvents(e=!1){this.#n?.togglePointerEvents(e)}get#_(){return this.#a.size===0?this.#h.getEditors(this.pageIndex):this.#a.values()}async enable(){this.#c=!0,this.div.tabIndex=0,this.togglePointerEvents(!0),this.div.classList.toggle(`nonEditing`,!1),this.#p?.abort(),this.#p=null;let e=new Set;for(let t of this.#_)t.enableEditing(),t.show(!0),t.annotationElementId&&(this.#h.removeChangedExistingAnnotation(t),e.add(t.annotationElementId));let t=this.#n;if(t)for(let n of t.getEditableAnnotations()){if(n.hide(),this.#h.isDeletedAnnotationElement(n.data.id)||e.has(n.data.id))continue;let t=await this.deserialize(n);t&&(this.addOrRebuild(t),t.enableEditing())}this.#c=!1,this.#h._eventBus.dispatch(`editorsrendered`,{source:this,pageNumber:this.pageIndex+1})}disable(){if(this.#s=!0,this.div.tabIndex=-1,this.togglePointerEvents(!1),this.div.classList.toggle(`nonEditing`,!0),this.#d&&!this.#p){this.#p=new AbortController;let e=this.#h.combinedSignal(this.#p);this.#d.div.addEventListener(`pointerdown`,e=>{let{clientX:t,clientY:n,timeStamp:r}=e;if(r-this.#m>500){this.#m=r;return}this.#m=-1;let{classList:i}=this.div;i.toggle(`getElements`,!0);let a=document.elementsFromPoint(t,n);if(i.toggle(`getElements`,!1),!this.div.contains(a[0]))return;let o,s=RegExp(`^${GS}[0-9]+$`);for(let e of a)if(s.test(e.id)){o=e.id;break}if(!o)return;let c=this.#a.get(o);c?.annotationElementId===null&&(QC(e),c.dblclick(e))},{signal:e,capture:!0})}let t=this.#n,n=[];if(t){let e=new Map,r=new Map;for(let t of this.#_){if(t.disableEditing(),!t.annotationElementId){n.push(t);continue}if(t.serialize()!==null){e.set(t.annotationElementId,t);continue}else r.set(t.annotationElementId,t);this.getEditableAnnotation(t.annotationElementId)?.show(),t.remove()}for(let n of t.getEditableAnnotations()){let{id:t}=n.data;if(this.#h.isDeletedAnnotationElement(t)){n.updateEdited({deleted:!0});continue}let i=r.get(t);if(i){i.resetAnnotationElement(n),i.show(!1),n.show();continue}i=e.get(t),i&&(this.#h.addChangedExistingAnnotation(i),i.renderAnnotationElement(n)&&i.show(!1)),n.show()}}this.#S(),this.isEmpty&&(this.div.hidden=!0);let{classList:r}=this.div;for(let t of e.#g.values())r.remove(`${t._type}Editing`);this.disableTextSelection(),this.toggleAnnotationLayerPointerEvents(!0),t?.updateFakeAnnotations(n),this.#s=!1}getEditableAnnotation(e){return this.#n?.getEditableAnnotation(e)||null}setActiveEditor(e){this.#h.getActive()!==e&&this.#h.setActiveEditor(e)}enableTextSelection(){if(this.div.tabIndex=-1,this.#d?.div&&!this.#f){this.#f=new AbortController;let e=this.#h.combinedSignal(this.#f);this.#d.div.addEventListener(`pointerdown`,this.#v.bind(this),{signal:e}),this.#d.div.classList.add(`highlighting`)}}disableTextSelection(){this.div.tabIndex=0,this.#d?.div&&this.#f&&(this.#f.abort(),this.#f=null,this.#d.div.classList.remove(`highlighting`))}#v(e){this.#h.unselectAll();let{target:t}=e;if(t===this.#d.div||(t.getAttribute(`role`)===`img`||t.classList.contains(`endOfContent`)||t.classList.contains(`textLayerImages`)||t.classList.contains(`textLayerImagePlaceholder`))&&this.#d.div.contains(t)){let{isMac:t}=wC.platform;if(e.button!==0||e.ctrlKey&&t)return;this.#h.showAllEditors(`highlight`,!0,!0),OO.startDrawing(this,this.#h,this.#h.direction===`ltr`,e),e.preventDefault()}}enableClick(){if(this.#r)return;this.#r=new AbortController;let e=this.#h.combinedSignal(this.#r);this.div.addEventListener(`pointerdown`,this.pointerdown.bind(this),{signal:e});let t=this.pointerup.bind(this);this.div.addEventListener(`pointerup`,t,{signal:e}),this.div.addEventListener(`pointercancel`,t,{signal:e})}disableClick(){this.#r?.abort(),this.#r=null}attach(e){this.#a.set(e.id,e);let{annotationElementId:t}=e;t&&this.#h.isDeletedAnnotationElement(t)&&this.#h.removeDeletedAnnotationElement(e)}detach(e){this.#a.delete(e.id),this.#e?.removePointerInTextLayer(e.contentDiv),!this.#s&&e.annotationElementId&&this.#h.addDeletedAnnotationElement(e)}remove(e){this.detach(e),this.#h.removeEditor(e),e.div.remove(),e.isAttachedToDOM=!1}changeParent(e){e.parent!==this&&(e.parent&&e.annotationElementId&&(this.#h.addDeletedAnnotationElement(e),Iw.deleteAnnotationElement(e),e.annotationElementId=null),this.attach(e),e.parent?.detach(e),e.setParent(this),e.div&&e.isAttachedToDOM&&(e.div.remove(),this.div.append(e.div)))}add(e){if(!(e.parent===this&&e.isAttachedToDOM)){if(this.changeParent(e),this.#h.addEditor(e),this.attach(e),!e.isAttachedToDOM){let t=e.render();this.div.append(t),e.isAttachedToDOM=!0}e.fixAndSetPosition(),e.onceAdded(!this.#c),this.#h.addToAnnotationStorage(e),e._reportTelemetry(e.telemetryInitialData)}}moveEditorInDOM(e){if(!e.isAttachedToDOM)return;let{activeElement:t}=document;e.div.contains(t)&&!this.#i&&(e._focusEventsAllowed=!1,this.#i=setTimeout(()=>{this.#i=null,e.div.contains(document.activeElement)?e._focusEventsAllowed=!0:(e.div.addEventListener(`focusin`,()=>{e._focusEventsAllowed=!0},{once:!0,signal:this.#h._signal}),t.focus())},0)),e._structTreeParentId=this.#e?.moveElementInDOM(this.div,e.div,e.contentDiv,!0)}addOrRebuild(e){e.needsToBeRebuilt()?(e.parent||=this,e.rebuild(),e.show()):this.add(e)}addUndoableEditor(e){this.addCommands({cmd:()=>e._uiManager.rebuild(e),undo:()=>{e.remove()},mustExec:!1})}getEditorByUID(e){for(let t of this.#a.values())if(t.uid===e)return t;return null}get#y(){return e.#g.get(this.#h.getMode())}combinedSignal(e){return this.#h.combinedSignal(e)}#b(e){let t=this.#y;return t?new t.prototype.constructor(e):null}canCreateNewEmptyEditor(){return this.#y?.canCreateNewEmptyEditor()}async pasteEditor(e,t){this.updateToolbar(e),await this.#h.updateMode(e.mode);let{offsetX:n,offsetY:r}=this.#x(),i=this.#h.getId(),a=this.#b({parent:this,id:i,x:n,y:r,uiManager:this.#h,isCentered:!0,...t});a&&this.add(a)}async deserialize(t){return await e.#g.get(t.annotationType??t.annotationEditorType)?.deserialize(t,this,this.#h)||null}createAndAddNewEditor(e,t,n={}){let r=this.#h.getId(),i=this.#b({parent:this,id:r,x:e.offsetX,y:e.offsetY,uiManager:this.#h,isCentered:t,...n});return i&&this.add(i),i}get boundingClientRect(){return this.div.getBoundingClientRect()}#x(){let{x:e,y:t,width:n,height:r}=this.boundingClientRect,i=Math.max(0,e),a=Math.max(0,t),o=Math.min(window.innerWidth,e+n),s=Math.min(window.innerHeight,t+r),c=(i+o)/2-e,l=(a+s)/2-t,[u,d]=this.viewport.rotation%180==0?[c,l]:[l,c];return{offsetX:u,offsetY:d}}addNewEditor(e={}){this.createAndAddNewEditor(this.#x(),!0,e)}setSelected(e){this.#h.setSelected(e)}toggleSelected(e){this.#h.toggleSelected(e)}unselect(e){this.#h.unselect(e)}pointerup(e){let{isMac:t}=wC.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div||!this.#o||(this.#o=!1,this.#y?.isDrawer&&this.#y.supportMultipleDrawings))return;if(!this.#t){this.#t=!0;return}let n=this.#h.getMode();if(n===KS.STAMP||n===KS.POPUP||n===KS.SIGNATURE){this.#h.unselectAll();return}this.createAndAddNewEditor(e,!1)}pointerdown(e){if(this.#h.getMode()===KS.HIGHLIGHT&&this.enableTextSelection(),this.#o){this.#o=!1;return}let{isMac:t}=wC.platform;if(e.button!==0||e.ctrlKey&&t||e.target!==this.div)return;if(this.#o=!0,this.#y?.isDrawer){this.startDrawingSession(e);return}let n=this.#h.getActive();this.#t=!n||n.isEmpty()}startDrawingSession(e){if(this.div.focus({preventScroll:!0}),this.#l){this.#y.startDrawing(this,this.#h,!1,e);return}this.#h.setCurrentDrawingSession(this),this.#l=new AbortController;let t=this.#h.combinedSignal(this.#l);this.div.addEventListener(`blur`,({relatedTarget:e})=>{e&&!this.div.contains(e)&&(this.#u=null,this.commitOrRemove())},{signal:t}),this.#y.startDrawing(this,this.#h,!1,e)}pause(e){if(e){let{activeElement:e}=document;this.div.contains(e)&&(this.#u=e);return}this.#u&&setTimeout(()=>{this.#u?.focus(),this.#u=null},0)}endDrawingSession(e=!1){return this.#l?(this.#h.setCurrentDrawingSession(null),this.#l.abort(),this.#l=null,this.#u=null,this.#y.endDrawing(e)):null}findNewParent(e,t,n){let r=this.#h.findParent(t,n);return r===null||r===this?!1:(r.changeParent(e),!0)}commitOrRemove(){return this.#l?(this.endDrawingSession(),!0):!1}onScaleChanging(){this.#l&&this.#y.onScaleChangingWhenDrawing(this)}destroy(){this.commitOrRemove(),this.#h.getActive()?.parent===this&&(this.#h.commitOrRemove(),this.#h.setActiveEditor(null)),this.#i&&=(clearTimeout(this.#i),null);for(let e of this.#a.values())this.#e?.removePointerInTextLayer(e.contentDiv),e.setParent(null),e.isAttachedToDOM=!1,e.div.remove();this.div=null,this.#a.clear(),this.#h.removeLayer(this)}#S(){for(let e of this.#a.values())e.isEmpty()&&e.remove()}async render({viewport:e}){this.viewport=e,aw(this.div,e);for(let e of this.#h.getEditors(this.pageIndex))this.add(e),e.rebuild();await this.#h.findClonesForPage(this),this.div.hidden=this.isEmpty,this.updateMode()}update({viewport:e}){this.#h.commitOrRemove(),this.#S();let t=this.viewport.rotation,n=e.rotation;if(this.viewport=e,aw(this.div,{rotation:n}),t!==n)for(let e of this.#a.values())e.rotate(n)}get pageDimensions(){let{pageWidth:e,pageHeight:t}=this.viewport.rawDims;return[e,t]}get scale(){return this.#h.viewParameters.realScale}};function HO(e,t){return e===t?0:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function UO(e){return e?e.nodeType===Node.ELEMENT_NODE?e.closest(`.textLayer`):e.parentElement?.closest(`.textLayer`)||null:null}function WO(e,t,n,r){if(e===n)return t<=r;let i=e.compareDocumentPosition(n);return i&Node.DOCUMENT_POSITION_FOLLOWING?!0:i&Node.DOCUMENT_POSITION_PRECEDING?!1:null}function GO(e,t,n){if(e.nodeType!==Node.ELEMENT_NODE||!e.classList.contains(`textLayer`)||t!==e.childNodes.length)return{container:e,offset:t};let r=e.lastChild;return r?.nodeType===Node.ELEMENT_NODE&&r.classList.contains(`endOfContent`)&&(r=r.previousSibling),!r||!n.contains(r)?null:r.nodeType===Node.TEXT_NODE?{container:r,offset:r.textContent.length}:{container:r,offset:r.childNodes.length}}var KO=class e{#e=null;#t=new Map;#n=null;#r=null;#i=null;#a=null;#o=new Map;static#s=0;static#c=0;static#l=null;static#u=new Set;static#d=!1;static#f=new Set;static#p=new WeakMap;constructor({filterFactory:t=null,pageColors:n=null,pageIndex:r,textLayer:i=null}){if(this.pageIndex=r,this.#r=t,this.#i=n,i){let t=e.#p.get(i);if(t?.selectionDiv&&(t.selectionDiv.remove(),e.#u.delete(t.selectionDiv)),e.#p.set(i,{drawLayer:this}),e.#f.add(i),this.#n=i,this.#a=new MutationObserver(t=>{if(!(!this.#e||!this.#n?.isConnected||!e.#h())){for(let{addedNodes:n}of t)for(let t of n)if(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains(`endOfContent`)){e.#_();return}}}),this.#a.observe(i,{childList:!0}),e.#l===null){e.#l=new AbortController;let{signal:t}=e.#l;document.addEventListener(`selectionchange`,e.#_.bind(e),{signal:t}),document.addEventListener(`pointerdown`,()=>{e.#d=!0},{signal:t}),document.addEventListener(`pointerup`,()=>{e.#d=!1},{signal:t}),window.addEventListener(`blur`,()=>{e.#d=!1},{signal:t})}}}setParent(t){if(!this.#e){this.#e=t,this.#n?.isConnected&&e.#h()&&e.#_();return}if(this.#e!==t){if(this.#t.size>0)for(let e of this.#t.values())e.remove(),t.append(e);this.#e=t}}static#m(e){let t=this.#p.get(e);t?.selectionDiv&&(t.selectionDiv.remove(),this.#u.delete(t.selectionDiv),t.selectionDiv=null,t.path=null)}static#h(){let e=document.getSelection();return!!e&&!e.isCollapsed}static#g(){return this.#f.keys().filter(e=>e.isConnected).toArray().sort(HO)}static#_(){let t=document.getSelection();if(!t||t.isCollapsed){for(let e of this.#u)e.remove();this.#u.clear();return}let n=new WeakMap,r=this.#g(),i=[];for(let e=0,n=t.rangeCount;e<n;e++){let n=t.getRangeAt(e);if(n.collapsed)continue;let{startContainer:a,startOffset:o,endContainer:s,endOffset:c}=n,l=UO(a),u=UO(s),d=l===null,f=u===null;if(this.#d&&d!==f)return;if(t.rangeCount===1){let{anchorNode:e,anchorOffset:n,focusNode:r,focusOffset:i}=t,d=UO(e),f=UO(r),p=WO(e,n,r,i);d&&f&&p!==null&&(p?(a=e,o=n,l=d,s=r,c=i,u=f):(a=r,o=i,l=f,s=e,c=n,u=d))}let p=r.filter(e=>n.intersectsNode(e));if(p.length===0)continue;let m=!1;if(l||(l=p[0],a=l,o=0,m=!0),u||(u=p.at(-1),s=u,c=u.childNodes.length,m=!0),s.nodeType===Node.ELEMENT_NODE){if(s.classList.contains(`endOfContent`)){let e=s.previousSibling;if(!e)continue;s=e,c=e.nodeType===Node.TEXT_NODE?e.textContent.length:e.childNodes.length}else if(s.classList.contains(`textLayer`)&&s.childNodes.length===c){let e=GO(s,c,u);if(!e)continue;s=e.container,c=e.offset}}if(a.nodeType===Node.ELEMENT_NODE){let e=GO(a,o,l);if(!e)continue;a=e.container,o=e.offset}if(l===u&&!m&&p.includes(l)){i.push([n,l]);continue}for(let e of p){let t=e.firstChild;if(!t)continue;let n=document.createRange();if(e===l?n.setStart(a,o):n.setStartBefore(t),e===u)n.setEnd(s,c);else{let t=e.lastChild;if(!t)continue;if(t.nodeType===Node.ELEMENT_NODE&&t.classList.contains(`endOfContent`)){let e=t.previousSibling;if(!e)continue;n.setEndAfter(e)}else n.setEndAfter(t)}n.collapsed||i.push([n,e])}}let a=new Set(i.map(e=>e[1]));for(let e of this.#f)a.has(e)||this.#m(e);for(let[t,r]of i){let i=e.#p.get(r);if(!i)continue;let a=n.get(r);if(!a){let e=r.getBoundingClientRect();a=(t,n,r,i)=>({x:(t-e.x)/e.width,y:(n-e.y)/e.height,width:r/e.width,height:i/e.height}),n.set(r,a)}let o=[];for(let{x:e,y:n,width:r,height:i}of t.getClientRects())r===0||i===0||({x:e,y:n,width:r,height:i}=a(e,n,r,i),!(r===1&&i===1)&&o.push(`M${e} ${n} h${r} v${i} h-${r} Z`));if(o.length===0)continue;let s=i.drawLayer,c=i.selectionDiv,l=i.path;if(!c){let t=`clip_selection_${e.#c++}`;c=document.createElement(`div`),c.className=`selection`,c.style.clipPath=`url(#${t})`;let n=s.#r?.createSelectionStyle(s.#i);if(n)for(let[e,t]of Object.entries(n))c.style.setProperty(e,t);let r=e._svgFactory.create(1,1,!0);r.setAttribute(`aria-hidden`,`true`),r.setAttribute(`width`,`100%`),r.setAttribute(`height`,`100%`);let a=e._svgFactory.createElement(`clipPath`);a.setAttribute(`id`,t),a.setAttribute(`clipPathUnits`,`objectBoundingBox`),l=e._svgFactory.createElement(`path`),a.append(l),r.append(a),c.append(r),i.path=l,i.selectionDiv=c}s.#e&&c.parentNode!==s.#e&&(s.#e.append(c),this.#u.add(c)),l.setAttribute(`d`,o.join(` `))}}static get _svgFactory(){return mC(this,`_svgFactory`,new ND)}static#v(e,[t,n,r,i]){let{style:a}=e;a.top=`${100*n}%`,a.left=`${100*t}%`,a.width=`${100*r}%`,a.height=`${100*i}%`}#y(){let t=e._svgFactory.create(1,1,!0);return this.#e.append(t),t.setAttribute(`aria-hidden`,`true`),t}#b(t,n){let r=e._svgFactory.createElement(`clipPath`);t.append(r);let i=`clip_${n}`;r.setAttribute(`id`,i),r.setAttribute(`clipPathUnits`,`objectBoundingBox`);let a=e._svgFactory.createElement(`use`);return r.append(a),a.setAttribute(`href`,`#${n}`),a.classList.add(`clip`),i}#x(e,t){for(let[n,r]of Object.entries(t))r===null?e.removeAttribute(n):e.setAttribute(n,r)}draw(t,n=!1,r=!1){let i=e.#s++,a=this.#y(),o=e._svgFactory.createElement(`defs`);a.append(o);let s=e._svgFactory.createElement(`path`);o.append(s);let c=`path_${i}`;s.setAttribute(`id`,c),s.setAttribute(`vector-effect`,`non-scaling-stroke`),n&&this.#o.set(i,s);let l=r?this.#b(o,c):null,u=e._svgFactory.createElement(`use`);return a.append(u),u.setAttribute(`href`,`#${c}`),this.updateProperties(a,t),this.#t.set(i,a),{id:i,clipPathId:`url(#${l})`}}drawOutline(t,n){let r=e.#s++,i=this.#y(),a=e._svgFactory.createElement(`defs`);i.append(a);let o=e._svgFactory.createElement(`path`);a.append(o);let s=`path_${r}`;o.setAttribute(`id`,s),o.setAttribute(`vector-effect`,`non-scaling-stroke`);let c;if(n){let t=e._svgFactory.createElement(`mask`);a.append(t),c=`mask_${r}`,t.setAttribute(`id`,c),t.setAttribute(`maskUnits`,`objectBoundingBox`);let n=e._svgFactory.createElement(`rect`);t.append(n),n.setAttribute(`width`,`1`),n.setAttribute(`height`,`1`),n.setAttribute(`fill`,`white`);let i=e._svgFactory.createElement(`use`);t.append(i),i.setAttribute(`href`,`#${s}`),i.setAttribute(`stroke`,`none`),i.setAttribute(`fill`,`black`),i.setAttribute(`fill-rule`,`nonzero`),i.classList.add(`mask`)}let l=e._svgFactory.createElement(`use`);i.append(l),l.setAttribute(`href`,`#${s}`),c&&l.setAttribute(`mask`,`url(#${c})`);let u=l.cloneNode();return i.append(u),l.classList.add(`mainOutline`),u.classList.add(`secondaryOutline`),this.updateProperties(i,t),this.#t.set(r,i),r}finalizeDraw(e,t){this.#o.delete(e),this.updateProperties(e,t)}updateProperties(t,n){if(!n)return;let{root:r,bbox:i,rootClass:a,path:o}=n,s=typeof t==`number`?this.#t.get(t):t;if(s){if(r&&this.#x(s,r),i&&e.#v(s,i),a){let{classList:e}=s;for(let[t,n]of Object.entries(a))e.toggle(t,n)}if(o){let e=s.firstElementChild.firstElementChild;this.#x(e,o)}}}updateParent(e,t){if(t===this)return;let n=this.#t.get(e);n&&(t.#e.append(n),this.#t.delete(e),t.#t.set(e,n))}remove(e){this.#o.delete(e),this.#e!==null&&(this.#t.get(e).remove(),this.#t.delete(e))}destroy(){this.#e=null;for(let e of this.#t.values())e.remove();this.#t.clear(),this.#o.clear(),this.#a?.disconnect(),this.#a=null,this.#n&&=(e.#p.get(this.#n)?.drawLayer===this&&(e.#m(this.#n),e.#p.delete(this.#n),e.#f.delete(this.#n),e.#f.size===0&&(e.#l?.abort(),e.#l=null,e.#d=!1)),null)}};function qO(e){return`${(e*100).toFixed(2)}%`}var JO=class e{#e=[];#t=new Map;#n=null;#r=0;#i=0;#a=0;static#o=null;constructor(e,t,n,r){this.#r=e,this.#e=t,this.#i=n.rawDims.pageWidth,this.#a=n.rawDims.pageHeight,this.#n=r}render(){let t=document.createElement(`div`);t.className=`textLayerImages`;for(let e=0;e<this.#e.length;e+=6){let n=this.#s(this.#e.subarray(e,e+6));n&&t.append(n)}return t.addEventListener(`contextmenu`,t=>{if(!(t.target instanceof HTMLCanvasElement))return;let n=t.target,r=this.#t.get(n);if(!r)return;let i=e.#o?.deref();if(i===n)return;i&&(i.width=0,i.height=0),e.#o=new WeakRef(n);let{inverseTransform:a,x1:o,y1:s,width:c,height:l}=r,u=this.#n(),d=Math.ceil(o*u.width),f=Math.ceil(s*u.height),p=Math.floor((o+c/this.#i)*u.width),m=Math.floor((s+l/this.#a)*u.height);n.width=p-d,n.height=m-f;let h=n.getContext(`2d`);h.setTransform(...a),h.translate(-d,-f),h.drawImage(u,0,0)}),t}#s([e,t,n,r,i,a]){let o=Math.hypot((i-e)*this.#i,(a-t)*this.#a),s=Math.hypot((n-e)*this.#i,(r-t)*this.#a);if(o<this.#r||s<this.#r)return null;let c=[(i-e)*this.#i/o,(a-t)*this.#a/o,(n-e)*this.#i/s,(r-t)*this.#a/s,0,0],l=TC.inverseTransform(c),u=document.createElement(`canvas`);return u.className=`textLayerImagePlaceholder`,u.width=0,u.height=0,Object.assign(u.style,{opacity:0,position:`absolute`,left:qO(e),top:qO(t),width:qO(o/this.#i),height:qO(s/this.#a),transformOrigin:`0% 0%`,transform:`matrix(${c.join(`,`)})`}),this.#t.set(u,{inverseTransform:l,width:o,height:s,x1:e,y1:t}),u}};globalThis._pdfjsTestingUtils={HighlightOutliner:SO},globalThis.pdfjsLib={AbortException:xC,AnnotationEditorLayer:VO,AnnotationEditorParamsType:qS,AnnotationEditorType:KS,AnnotationEditorUIManager:kw,AnnotationLayer:fO,AnnotationMode:US,AnnotationType:ZS,applyOpacity:uw,build:ED,ColorPicker:DD,createValidAbsoluteUrl:dC,CSSConstants:lw,DOMSVGFactory:ND,DrawLayer:KO,FeatureTest:wC,fetchData:UC,findContrastColor:gw,getDocument:gD,getFilenameFromUrl:qC,getPdfFilenameFromUrl:JC,getRGB:tw,getRGBA:ew,getUuid:AC,GlobalWorkerOptions:rD,ImageKind:XS,InvalidPDFException:vC,isDataScheme:GC,isPdfFile:KC,isValidExplicitDest:CT,makeArr:MC,makeMap:NC,makeObj:PC,makeSet:FC,MathClamp:IC,noContextMenu:ZC,normalizeUnicode:kC,OPS:eC,OutputScale:ow,PasswordException:gC,PasswordResponses:nC,PDFDataRangeTransport:vD,PDFDateString:$C,PDFWorker:xD,PermissionFlag:JS,PixelsPerInch:HC,RenderingCancelledException:WC,renderRichText:_w,ResponseException:yC,setLayerDimensions:aw,shadow:mC,SignatureExtractor:IO,stopEvent:QC,SupportedImageMimeTypes:sw,TextLayer:mD,TextLayerImages:JO,TouchManager:Fw,updateUrlHash:fC,Util:TC,VerbosityLevel:$S,version:TD,XfaLayer:VC},rD.workerSrc=`/assets/pdf.worker.min-Dswkl-cV.mjs`;function YO(e){let t=e.replace(`#`,``);return{r:parseInt(t.substring(0,2),16)/255||0,g:parseInt(t.substring(2,4),16)/255||0,b:parseInt(t.substring(4,6),16)/255||0}}async function XO(e){let t=await MS.create();for(let n of e){let e=await n.arrayBuffer(),r=await MS.load(e,{ignoreEncryption:!0}),i=await t.copyPages(r,r.getPageIndices());for(let e of i)t.addPage(e)}let n=await t.save();return new Blob([n],{type:`application/pdf`})}async function ZO(e,t){let n=await e.arrayBuffer(),r=await MS.load(n,{ignoreEncryption:!0}),i=r.getPageCount(),a=e.name.replace(/\.[^/.]+$/,``);if(!t.trim()||t.toLowerCase()===`all`){let e=[];for(let t=0;t<i;t++){let n=await MS.create(),[i]=await n.copyPages(r,[t]);n.addPage(i);let o=await n.save();e.push({name:`${a}_page_${t+1}.pdf`,blob:new Blob([o],{type:`application/pdf`})})}return e}let o=t.split(`,`).map(e=>e.trim()).filter(Boolean),s=[],c=1;for(let e of o){let t=e.split(`-`).map(e=>parseInt(e.trim(),10)),n=t[0],o=t.length>1?t[1]:n;if((isNaN(n)||n<1)&&(n=1),(isNaN(o)||o>i)&&(o=i),n>i)continue;if(n>o){let e=n;n=o,o=e}let l=[];for(let e=n;e<=o;e++)l.push(e-1);if(l.length===0)continue;let u=await MS.create(),d=await u.copyPages(r,l);for(let e of d)u.addPage(e);let f=await u.save();s.push({name:`${a}_part_${c}_(p${n}-p${o}).pdf`,blob:new Blob([f],{type:`application/pdf`})}),c++}if(s.length===0)throw Error(`No valid pages found in the specified range.`);return s}async function QO(e,t=`medium`){let n=await e.arrayBuffer(),r=e.size,i=await(await MS.load(n,{ignoreEncryption:!0,updateMetadata:!1})).save({useObjectStreams:!0}),a=new Blob([i],{type:`application/pdf`});return{blob:a,originalSize:r,compressedSize:a.size}}async function $O(e,t){let n=await MS.create();for(let r of e){let e=await r.arrayBuffer(),i=r.type===`image/png`||r.name.toLowerCase().endsWith(`.png`),a;try{a=i?await n.embedPng(e):await n.embedJpg(e)}catch{let e=await new Promise((e,t)=>{let n=new Image;n.onload=()=>{let r=document.createElement(`canvas`);r.width=n.naturalWidth,r.height=n.naturalHeight;let i=r.getContext(`2d`);if(!i)return t(Error(`Canvas 2D context unavailable`));i.drawImage(n,0,0),r.toBlob(n=>{if(!n)return t(Error(`Canvas blob conversion failed`));n.arrayBuffer().then(e).catch(t)},`image/jpeg`,.92)},n.onerror=()=>t(Error(`Failed to load image file`)),n.src=URL.createObjectURL(r)});a=await n.embedJpg(e)}let o=a.width,s=a.height,c=o,l=s;if(t.pageSize===`a4`?(c=DS.A4[0],l=DS.A4[1]):t.pageSize===`letter`&&(c=DS.Letter[0],l=DS.Letter[1]),t.orientation===`landscape`&&c<l){let e=c;c=l,l=e}else if(t.orientation===`portrait`&&c>l){let e=c;c=l,l=e}else if(t.orientation===`auto`&&t.pageSize!==`fit`&&o>s&&c<l){let e=c;c=l,l=e}let u=t.margin,d=c-u*2,f=l-u*2,p=Math.min(d/o,f/s),m=o*p,h=s*p,g=u+(d-m)/2,_=u+(f-h)/2;n.addPage([c,l]).drawImage(a,{x:g,y:_,width:m,height:h})}let r=await n.save();return new Blob([r],{type:`application/pdf`})}async function ek(e,t){let n=await e.arrayBuffer(),r=await MS.load(n,{ignoreEncryption:!0});r.getPages().forEach((e,n)=>{let r=t[n]||0;if(r!==0){let t=e.getRotation().angle;e.setRotation(By((t+r)%360))}});let i=await r.save();return new Blob([i],{type:`application/pdf`})}async function tk(e,t,n){let r=await e.arrayBuffer(),i=await MS.load(r,{ignoreEncryption:!0}),a=await i.embedFont(SS.HelveticaBold),o=i.getPages(),{r:s,g:c,b:l}=YO(n.colorHex);for(let e of o){let{width:r,height:i}=e.getSize(),o=a.widthOfTextAtSize(t,n.size),u=a.heightAtSize(n.size);e.drawText(t,{x:r/2-o/2,y:i/2-u/2,size:n.size,font:a,color:Ub(s,c,l),opacity:n.opacity,rotate:By(n.angle)})}let u=await i.save();return new Blob([u],{type:`application/pdf`})}async function nk(e,t={}){let n=t.format||`image/jpeg`,r=n===`image/png`?`png`:`jpg`,i=t.scale||1.5,a=await e.arrayBuffer(),o=await gD({data:new Uint8Array(a)}).promise,s=o.numPages,c=e.name.replace(/\.[^/.]+$/,``),l=[];for(let e=1;e<=s;e++){let t=await o.getPage(e),a=t.getViewport({scale:i}),s=document.createElement(`canvas`);s.width=a.width,s.height=a.height;let u=s.getContext(`2d`);if(!u)continue;await t.render({canvasContext:u,viewport:a,canvas:s}).promise;let d=await new Promise((e,t)=>{s.toBlob(n=>{n?e(n):t(Error(`Canvas to blob failed`))},n,.92)});l.push({name:`${c}_page_${e}.${r}`,blob:d})}return l}function rk({title:e=`Sedang Memproses Berkas...`,message:t=`Mohon tunggu sebentar, berkas Anda sedang diproses langsung di browser secara aman.`,icon:n,iconColor:r=`#0B57D0`,progressPercent:i}){return(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-12 sm:p-16 rounded-3xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] text-center space-y-5 animate-pulse max-w-2xl mx-auto w-full my-6 shadow-xs`,children:[(0,U.jsx)(`div`,{className:`w-16 h-16 rounded-2xl bg-[#EDF2FC] dark:bg-[#28292A] flex items-center justify-center transition-transform`,style:{color:r},children:n?(0,U.jsx)(n,{size:32}):(0,U.jsx)(oi,{className:`w-8 h-8 animate-spin`})}),(0,U.jsxs)(`div`,{className:`space-y-1.5 max-w-md`,children:[(0,U.jsx)(`h3`,{className:`text-base sm:text-lg font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:e}),(0,U.jsx)(`p`,{className:`text-xs sm:text-sm text-[#444746] dark:text-[#C4C7C5] leading-relaxed`,children:t})]}),(0,U.jsx)(`div`,{className:`w-full max-w-sm h-1.5 rounded-full bg-[#E0E3E7] dark:bg-[#36373A] overflow-hidden`,children:typeof i==`number`?(0,U.jsx)(`div`,{className:`h-full bg-[#0B57D0] rounded-full transition-all duration-300`,style:{width:`${Math.min(100,Math.max(0,i))}%`}}):(0,U.jsx)(`div`,{className:`h-full bg-[#0B57D0] rounded-full w-2/5 animate-[progress_1.4s_ease-in-out_infinite]`})})]})}function ik(){let e=tt(),t=Qe(),[n,r]=Fn(),{toast:i}=as(),a=n.get(`mode`)||`merge`,o=e=>{r({mode:e}),c([]),u([]),f([])},[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)([]),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1);(0,v.useEffect)(()=>{u(s.map(e=>e.id))},[s.length]);let[b,x]=(0,v.useState)(`1-3, 4-5`),[S,C]=(0,v.useState)(`CONFIDENTIAL`),[w,T]=(0,v.useState)(90);(0,v.useEffect)(()=>{if(t.state&&t.state.initialFiles){let e=t.state.initialFiles;E(e)}},[t.state]);let E=e=>{let t=a===`images-to-pdf`?e.filter(e=>e.type.startsWith(`image/`)||/\.(png|jpe?g|webp)$/i.test(e.name)):e.filter(e=>e.type.includes(`pdf`)||e.name.toLowerCase().endsWith(`.pdf`));if(t.length===0){i.error(a===`images-to-pdf`?`Pilih berkas gambar (JPG, PNG, WebP).`:`Pilih berkas PDF.`);return}let n=t.map(e=>({id:`${e.name}-${Date.now()}-${Math.random()}`,file:e,status:`idle`,thumbnailUrl:e.type.startsWith(`image/`)?URL.createObjectURL(e):void 0})),r=[...s,...n];c(r),(a===`compress`||a===`pdf-to-images`)&&setTimeout(()=>D(r),50)},D=async(e=s)=>{if(e.length!==0){y(!0);try{let t=[];if(a===`merge`){let n=e.map(e=>e.file),r=await XO(n);t.push({name:`9drive_dokumen_gabungan.pdf`,blob:r,size:r.size}),i.success(`Berhasil menggabungkan ${n.length} berkas PDF!`)}else if(a===`split`){for(let n of e){let e=await ZO(n.file,b);for(let n of e)t.push({name:n.name,blob:n.blob,size:n.blob.size})}i.success(`Berhasil memisahkan ${t.length} dokumen PDF!`)}else if(a===`compress`){for(let n of e){let e=await QO(n.file,`medium`),r=n.file.name.replace(/\.[^/.]+$/,``);t.push({name:`${r}_compressed.pdf`,blob:e.blob,size:e.compressedSize})}i.success(`Berhasil mengompres ${e.length} berkas PDF!`)}else if(a===`images-to-pdf`){let n=e.map(e=>e.file),r=await $O(n,{orientation:`auto`,pageSize:`a4`,margin:20});t.push({name:`9drive_album_gambar.pdf`,blob:r,size:r.size}),i.success(`Berhasil menyatukan ${n.length} foto ke 1 PDF!`)}else if(a===`rotate`){for(let n of e){let e={};for(let t=0;t<200;t++)e[t]=w;let r=await ek(n.file,e),i=n.file.name.replace(/\.[^/.]+$/,``);t.push({name:`${i}_rotated_${w}deg.pdf`,blob:r,size:r.size})}i.success(`Berhasil memutar ${e.length} berkas PDF!`)}else if(a===`watermark`){for(let n of e){let e=await tk(n.file,S,{opacity:.35,size:48,colorHex:`#D32F2F`,angle:45}),r=n.file.name.replace(/\.[^/.]+$/,``);t.push({name:`${r}_watermarked.pdf`,blob:e,size:e.size})}i.success(`Berhasil memberi watermark pada ${e.length} berkas PDF!`)}else if(a===`pdf-to-images`){for(let n of e){let e=await nk(n.file,{format:`image/jpeg`,scale:1.5});for(let n of e)t.push({name:n.name,blob:n.blob,size:n.blob.size})}i.success(`Berhasil mengekstrak ${t.length} gambar dari PDF!`)}f(t),t.length===1?(sm(t[0].blob,t[0].name),i.success(`Berkas ${t[0].name} berhasil dibuat & diunduh!`)):t.length>1&&(lm(t,`9drive_${a}_hasil.zip`),i.success(`${t.length} berkas berhasil dibuat & diunduh sebagai ZIP!`)),g(!0)}catch(e){console.error(`PDF Operation failed:`,e),i.error(e.message||`Operasi PDF gagal`)}finally{y(!1)}}},O=()=>{let e=s.filter(e=>l.includes(e.id));if(e.length===0){i.error(`Pilih minimal 1 berkas untuk diunduh.`);return}D(e)},k=()=>{c([]),u([]),f([])},A=[{id:`merge`,label:`Merge PDF`,icon:Tc,desc:`Satukan beberapa berkas PDF menjadi satu dokumen berurutan.`},{id:`split`,label:`Split PDF`,icon:Ec,desc:`Ekstrak rentang halaman tertentu atau pecah lembar dokumen PDF.`},{id:`compress`,label:`Compress PDF`,icon:Dc,desc:`Kecilkan ukuran file dokumen PDF secara instan tanpa merusak teks.`},{id:`images-to-pdf`,label:`JPG ke PDF`,icon:Oc,desc:`Gabungkan foto JPG, PNG, atau WebP menjadi satu dokumen PDF rapi.`},{id:`pdf-to-images`,label:`PDF ke Gambar`,icon:zc,desc:`Ekstrak setiap halaman dokumen PDF menjadi berkas foto resolusi tinggi.`},{id:`rotate`,label:`Rotate PDF`,icon:kc,desc:`Putar orientasi lembar dokumen PDF yang terbalik (90°, 180°, 270°).`},{id:`watermark`,label:`Watermark PDF`,icon:Ac,desc:`Bubuhkan stempel tanda hak cipta atau teks khusus di lembar PDF.`}],j=A.find(e=>e.id===a);return(0,U.jsxs)(`div`,{className:`flex flex-col min-h-full w-full min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 pb-3 border-b border-[#E0E3E7]/70 dark:border-[#36373A]/70 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>e(`/tools`),className:`text-xl sm:text-[22px] font-normal transition-colors text-[#444746] hover:text-[#0B57D0] dark:text-[#C4C7C5]`,children:`Tools Studio`}),(0,U.jsx)(Cr,{className:`h-4 w-4 text-[#747775] shrink-0`}),(0,U.jsx)(`span`,{className:`truncate text-xl sm:text-[22px] font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:j?.label})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 sm:shrink-0 sm:justify-end`,children:[s.length>0&&(0,U.jsxs)(G,{type:`button`,variant:`outline`,size:`sm`,onClick:k,className:`h-9 px-4 text-xs font-medium rounded-full border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`,children:[(0,U.jsx)(Ci,{className:`w-3.5 h-3.5 mr-1.5`}),`Pilih Berkas Lain`]}),d.length>0&&(0,U.jsxs)(G,{type:`button`,size:`sm`,onClick:()=>g(!0),className:`h-9 px-4 text-xs font-medium rounded-full bg-[#0F9D58] hover:bg-[#0F9D58]/90 text-white`,children:[(0,U.jsx)(Lr,{className:`w-3.5 h-3.5 mr-1.5`}),`Simpan Hasil (`,d.length,`)`]})]})]}),(0,U.jsx)(`div`,{className:`flex items-center gap-2 py-4 overflow-x-auto`,children:A.map(e=>{let t=e.icon;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>o(e.id),className:`flex items-center gap-2 h-8 px-4 rounded-full text-xs font-medium whitespace-nowrap transition-all border select-none ${a===e.id?`bg-[#C2E7FF] text-[#001D35] border-[#C2E7FF] dark:bg-[#004A77] dark:text-[#C2E7FF] dark:border-[#004A77]`:`bg-transparent text-[#444746] border-[#E0E3E7] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:border-[#36373A] dark:hover:bg-[#28292A]`}`,children:[(0,U.jsx)(t,{size:20}),(0,U.jsx)(`span`,{children:e.label})]},e.id)})}),_?(0,U.jsx)(rk,{title:a===`compress`?`Sedang Mengecilkan Dokumen PDF...`:a===`pdf-to-images`?`Sedang Mengubah Lembar PDF ke Gambar...`:a===`merge`?`Sedang Menggabungkan Dokumen PDF...`:`Sedang Memproses Dokumen PDF...`,message:`Mohon tunggu sebentar, dokumen PDF Anda sedang diproses langsung di browser secara aman.`,icon:j?.icon,iconColor:`#EA4335`}):s.length===0?(0,U.jsx)(`div`,{className:`w-full py-4 flex flex-col space-y-6`,children:(0,U.jsx)(im,{title:a===`images-to-pdf`?`Tarik & lepaskan gambar untuk dijadikan PDF`:`Tarik & lepaskan dokumen PDF ke sini, atau pilih berkas`,description:j?.desc||`Pengolahan berkas PDF aman dan cepat langsung di browser.`,acceptedFormats:a===`images-to-pdf`?[`JPG`,`PNG`,`WEBP`]:[`PDF`],accept:a===`images-to-pdf`?`image/*,.png,.jpg,.jpeg,.webp`:`.pdf,application/pdf`,icon:j?.icon,iconColor:`#EA4335`,maxSizeText:`Proses cepat • 100% Privat`,multiple:a===`merge`||a===`images-to-pdf`||a===`compress`,onFilesSelected:E,onOpenDrivePicker:()=>m(!0)})}):(0,U.jsxs)(`div`,{className:`w-full flex-1 flex flex-col space-y-4 py-2`,children:[a===`merge`&&(0,U.jsx)(`div`,{className:`p-3.5 rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#1E1F20]/50 flex items-center justify-between`,children:(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`p`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[`Susunan Urutan Berkas PDF (`,s.length,` berkas)`]}),(0,U.jsx)(`p`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:`Gunakan tombol panah untuk mengatur urutan dokumen sebelum digabungkan menjadi satu PDF.`})]})}),a===`split`&&(0,U.jsxs)(`div`,{className:`p-3.5 rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] flex flex-col sm:flex-row sm:items-center justify-between gap-3 text-xs`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3] block`,children:`Rentang Halaman:`}),(0,U.jsx)(`span`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F]`,children:`Ketik nomor halaman atau rentang (contoh: 1-3, 5, atau 'all')`})]}),(0,U.jsx)(Os,{type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:`contoh: 1-3, 5, 7-10 atau 'all'`,className:`h-8 max-w-xs text-xs rounded-lg`})]}),a===`rotate`&&(0,U.jsxs)(`div`,{className:`p-3.5 rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] flex items-center justify-between gap-3 text-xs`,children:[(0,U.jsx)(`span`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Sudut Rotasi:`}),(0,U.jsx)(`div`,{className:`flex gap-1.5`,children:[90,180,270].map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>T(e),className:`px-3 py-1 text-xs font-medium rounded-lg border transition-all ${w===e?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9]`}`,children:[`+`,e,`°`]},e))})]}),a===`watermark`&&(0,U.jsxs)(`div`,{className:`p-3.5 rounded-2xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] flex flex-col sm:flex-row sm:items-center justify-between gap-3 text-xs`,children:[(0,U.jsx)(`span`,{className:`font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Teks Watermark:`}),(0,U.jsx)(Os,{type:`text`,value:S,onChange:e=>C(e.target.value),placeholder:`CONFIDENTIAL`,className:`h-8 max-w-xs text-xs rounded-lg`})]}),(0,U.jsx)(nm,{items:s,onAddFiles:E,onRemoveItem:e=>c(t=>t.filter(t=>t.id!==e)),onReorder:e=>c(e),onClear:k,onOpenDrivePicker:()=>m(!0),accept:a===`images-to-pdf`?`image/*`:`.pdf,application/pdf`,allowReorder:a===`merge`||a===`images-to-pdf`,disabled:_,selectedIds:l,onSelectionChange:u,primaryAction:(0,U.jsx)(G,{type:`button`,size:`sm`,onClick:O,disabled:_||l.length===0,className:`h-8 px-4 text-xs font-medium rounded-full bg-[#0B57D0] hover:bg-[#0B57D0]/90 text-white shadow-xs flex items-center gap-1.5 shrink-0`,children:_?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(oi,{className:`w-3.5 h-3.5 animate-spin`}),(0,U.jsx)(`span`,{children:`Memproses...`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Lr,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:a===`images-to-pdf`?`Unduh PDF (${l.length})`:a===`merge`?`Unduh PDF Gabungan (${l.length})`:a===`compress`?`Unduh PDF Kompres (${l.length})`:a===`pdf-to-images`?`Unduh Gambar (${l.length})`:`Unduh Hasil (${l.length})`})]})})})]}),(0,U.jsx)(am,{open:p,onClose:()=>m(!1),onSelectFiles:E,acceptFilter:a===`images-to-pdf`?`image`:`pdf`,multiple:!0}),(0,U.jsx)(um,{open:h,onClose:()=>g(!1),files:d,defaultZipName:`9drive_${a}_hasil.zip`,toolName:`PDF Studio (${j?.label})`})]})}async function ak(e,t=.8,n){let r=e.size;return new Promise((i,a)=>{let o=new Image,s=URL.createObjectURL(e);o.onload=()=>{URL.revokeObjectURL(s);let{naturalWidth:c,naturalHeight:l}=o;n&&c>n&&(l=Math.round(l*n/c),c=n);let u=document.createElement(`canvas`);u.width=c,u.height=l;let d=u.getContext(`2d`);if(!d)return a(Error(`Canvas 2D unavailable`));d.imageSmoothingEnabled=!0,d.imageSmoothingQuality=`high`,d.drawImage(o,0,0,c,l);let f=e.type===`image/png`?`image/png`:`image/jpeg`;u.toBlob(e=>{if(!e)return a(Error(`Compression failed`));i({blob:e,originalSize:r,compressedSize:e.size})},f,t)},o.onerror=()=>a(Error(`Failed to load image`)),o.src=s})}async function ok(e,t,n=.92){return new Promise((r,i)=>{let a=new Image,o=URL.createObjectURL(e);a.onload=()=>{URL.revokeObjectURL(o);let s=document.createElement(`canvas`);s.width=a.naturalWidth,s.height=a.naturalHeight;let c=s.getContext(`2d`);if(!c)return i(Error(`Canvas 2D unavailable`));t===`image/jpeg`&&(c.fillStyle=`#FFFFFF`,c.fillRect(0,0,s.width,s.height)),c.drawImage(a,0,0),s.toBlob(n=>{if(!n)return i(Error(`Conversion failed`));r({blob:n,name:`${e.name.replace(/\.[^/.]+$/,``)}.${{"image/png":`png`,"image/jpeg":`jpg`,"image/webp":`webp`}[t]}`})},t,n)},a.onerror=()=>i(Error(`Failed to load image`)),a.src=o})}async function sk(e,t){return new Promise((n,r)=>{let i=new Image,a=URL.createObjectURL(e);i.onload=()=>{URL.revokeObjectURL(a);let o=i.naturalWidth,s=i.naturalHeight;if(t.scalePercent&&t.scalePercent>0){let e=t.scalePercent/100;o=Math.round(i.naturalWidth*e),s=Math.round(i.naturalHeight*e)}else if(t.width||t.height)if(t.maintainAspectRatio){if(t.width&&!t.height)o=t.width,s=Math.round(i.naturalHeight*t.width/i.naturalWidth);else if(t.height&&!t.width)s=t.height,o=Math.round(i.naturalWidth*t.height/i.naturalHeight);else if(t.width&&t.height){let e=Math.min(t.width/i.naturalWidth,t.height/i.naturalHeight);o=Math.round(i.naturalWidth*e),s=Math.round(i.naturalHeight*e)}}else o=t.width||i.naturalWidth,s=t.height||i.naturalHeight;let c=document.createElement(`canvas`);c.width=Math.max(1,o),c.height=Math.max(1,s);let l=c.getContext(`2d`);if(!l)return r(Error(`Canvas 2D unavailable`));l.imageSmoothingEnabled=!0,l.imageSmoothingQuality=`high`,l.drawImage(i,0,0,o,s),c.toBlob(e=>{if(!e)return r(Error(`Resizing failed`));n(e)},e.type||`image/png`)},i.onerror=()=>r(Error(`Failed to load image`)),i.src=a})}async function ck(e,t,n){return new Promise((r,i)=>{let a=new Image,o=URL.createObjectURL(e);a.onload=()=>{URL.revokeObjectURL(o);let s=document.createElement(`canvas`);s.width=a.naturalWidth,s.height=a.naturalHeight;let c=s.getContext(`2d`);if(!c)return i(Error(`Canvas 2D unavailable`));c.drawImage(a,0,0),c.save(),c.globalAlpha=Math.max(.05,Math.min(1,n.opacity)),c.fillStyle=n.colorHex,c.font=`bold ${n.size}px sans-serif`;let l=c.measureText(t).width,u=n.size,d=s.width/2-l/2,f=s.height/2+u/3;n.position===`bottom-right`?(d=s.width-l-30,f=s.height-30):n.position===`bottom-left`&&(d=30,f=s.height-30),c.shadowColor=`rgba(0, 0, 0, 0.4)`,c.shadowBlur=6,c.fillText(t,d,f),c.restore(),s.toBlob(e=>{if(!e)return i(Error(`Watermark export failed`));r(e)},e.type||`image/png`)},a.onerror=()=>i(Error(`Failed to load image`)),a.src=o})}async function lk(e,t,n){return new Promise((r,i)=>{let a=new Image,o=URL.createObjectURL(e);a.onload=()=>{URL.revokeObjectURL(o);let s=document.createElement(`canvas`);s.width=t.width,s.height=t.height;let c=s.getContext(`2d`);if(!c)return i(Error(`Canvas 2D unavailable`));c.drawImage(a,t.x,t.y,t.width,t.height,0,0,t.width,t.height);let l=n||(e.type===`image/png`?`image/png`:`image/jpeg`);s.toBlob(t=>{if(!t)return i(Error(`Crop failed`));r({blob:t,name:`${e.name.replace(/\.[^/.]+$/,``)}_cropped.${l===`image/png`?`png`:`jpg`}`})},l,.95)},a.onerror=()=>i(Error(`Failed to load image`)),a.src=o})}function uk(){let e=tt(),t=Qe(),[n,r]=Fn(),{toast:i}=as(),a=n.get(`mode`)||`compress`,o=e=>{r({mode:e}),c([]),u([]),f([])},[s,c]=(0,v.useState)([]),[l,u]=(0,v.useState)([]),[d,f]=(0,v.useState)([]),[p,m]=(0,v.useState)(!1),[h,g]=(0,v.useState)(!1),[_,y]=(0,v.useState)(!1);(0,v.useEffect)(()=>{u(s.map(e=>e.id))},[s.length]);let[b,x]=(0,v.useState)(.8),[S,C]=(0,v.useState)(`image/webp`),[w,T]=(0,v.useState)(50),[E,D]=(0,v.useState)(``),[O,k]=(0,v.useState)(``),[A,j]=(0,v.useState)(!0),[M,N]=(0,v.useState)(`1:1`),[P,F]=(0,v.useState)(`© 9Drive Studio`),[I,L]=(0,v.useState)(.4),[R,ee]=(0,v.useState)(36),[te,ne]=(0,v.useState)(`#FFFFFF`),[re,z]=(0,v.useState)(`bottom-right`);(0,v.useEffect)(()=>{if(t.state&&t.state.initialFiles){let e=t.state.initialFiles;ie(e)}},[t.state]);let ie=e=>{let t=e.filter(e=>e.type.startsWith(`image/`)||/\.(png|jpe?g|webp|bmp|gif)$/i.test(e.name));if(t.length===0){i.error(`Pilih berkas gambar yang valid (JPG, PNG, WebP).`);return}let n=t.map(e=>({id:`${e.name}-${Date.now()}-${Math.random()}`,file:e,status:`idle`,thumbnailUrl:URL.createObjectURL(e)})),r=[...s,...n];c(r),(a===`compress`||a===`convert`)&&setTimeout(()=>ae(r),50)},ae=async(e=s)=>{if(e.length!==0){y(!0);try{let t=[];if(a===`compress`){let n=0,r=0;for(let i of e){let e=await ak(i.file,b);n+=e.originalSize,r+=e.compressedSize;let a=i.file.name.replace(/\.[^/.]+$/,``),o=i.file.type===`image/png`?`png`:`jpg`;t.push({name:`${a}_compressed.${o}`,blob:e.blob,size:e.compressedSize})}let a=Math.round((n-r)/n*100);i.success(`Berhasil mengompres ${e.length} foto! Hemat ${a}% ukuran berkas.`)}else if(a===`convert`){for(let n of e){let e=await ok(n.file,S);t.push({name:e.name,blob:e.blob,size:e.blob.size})}i.success(`Berhasil mengonversi ${e.length} gambar!`)}else if(a===`resize`){for(let e of s){let n=await sk(e.file,{scalePercent:E||O?void 0:w,width:E?Number(E):void 0,height:O?Number(O):void 0,maintainAspectRatio:A}),r=e.file.name.replace(/\.[^/.]+$/,``);t.push({name:`${r}_resized.png`,blob:n,size:n.size})}i.success(`Berhasil mengubah ukuran ${s.length} gambar!`)}else if(a===`watermark`){for(let e of s){let n=await ck(e.file,P,{opacity:I,size:R,colorHex:te,position:re}),r=e.file.name.replace(/\.[^/.]+$/,``);t.push({name:`${r}_watermarked.png`,blob:n,size:n.size})}i.success(`Berhasil memberi watermark pada ${s.length} gambar!`)}else if(a===`crop`){for(let e of s){let n=new Image,r=URL.createObjectURL(e.file);await new Promise(e=>{n.onload=e,n.src=r}),URL.revokeObjectURL(r);let i=n.naturalWidth,a=n.naturalHeight;if(M===`1:1`){let e=Math.min(n.naturalWidth,n.naturalHeight);i=e,a=e}else M===`3:4`?n.naturalWidth/n.naturalHeight>3/4?(a=n.naturalHeight,i=Math.round(3/4*a)):(i=n.naturalWidth,a=Math.round(4/3*i)):M===`4:6`?n.naturalWidth/n.naturalHeight>4/6?(a=n.naturalHeight,i=Math.round(4/6*a)):(i=n.naturalWidth,a=Math.round(6/4*i)):M===`16:9`&&(n.naturalWidth/n.naturalHeight>16/9?(a=n.naturalHeight,i=Math.round(16/9*a)):(i=n.naturalWidth,a=Math.round(9/16*i)));let o=Math.round((n.naturalWidth-i)/2),s=Math.round((n.naturalHeight-a)/2),c=await lk(e.file,{x:o,y:s,width:i,height:a});t.push({name:c.name,blob:c.blob,size:c.blob.size})}i.success(`Berhasil memotong ${s.length} foto!`)}f(t),t.length===1?(sm(t[0].blob,t[0].name),i.success(`Berkas ${t[0].name} berhasil diunduh!`)):t.length>1&&(lm(t,`9drive_${a}_hasil.zip`),i.success(`${t.length} berkas berhasil diunduh sebagai ZIP!`)),g(!0)}catch(e){console.error(`Image Operation failed:`,e),i.error(e.message||`Pemrosesan gambar gagal`)}finally{y(!1)}}},oe=()=>{let e=s.filter(e=>l.includes(e.id));if(e.length===0){i.error(`Pilih minimal 1 berkas untuk diunduh.`);return}ae(e)},se=()=>{c([]),u([]),f([])},ce=[{id:`compress`,label:`Kompres Gambar`,icon:fi,desc:`Kecilkan ukuran foto JPG, PNG, dan WebP secara instan tanpa mengurangi kejernihan visual.`},{id:`convert`,label:`Konversi Format`,icon:Si,desc:`Ubah format gambar antara WebP, PNG, dan JPG untuk kebutuhan web atau cetak.`},{id:`resize`,label:`Ubah Ukuran`,icon:ui,desc:`Sesuaikan dimensi pixel atau persentase skala foto dengan rasio aspek tetap terkunci.`},{id:`crop`,label:`Potong / Crop`,icon:Fr,desc:`Potong foto dengan preset rasio pas foto resmi (3:4, 4:6), 1:1, atau rasio bebas.`},{id:`watermark`,label:`Watermark Foto`,icon:Mi,desc:`Tambahkan cap teks hak cipta pada gambar di posisi tengah ataupun sudut berkas.`}],le=ce.find(e=>e.id===a);return(0,U.jsxs)(`div`,{className:`flex flex-col min-h-full w-full min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 pb-3 border-b border-[#E0E3E7]/70 dark:border-[#36373A]/70 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>e(`/tools`),className:`text-xl sm:text-[22px] font-normal transition-colors text-[#444746] hover:text-[#0B57D0] dark:text-[#C4C7C5]`,children:`Tools Studio`}),(0,U.jsx)(Cr,{className:`h-4 w-4 text-[#747775] shrink-0`}),(0,U.jsx)(`span`,{className:`truncate text-xl sm:text-[22px] font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:le?.label})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 sm:shrink-0 sm:justify-end`,children:[s.length>0&&(0,U.jsxs)(G,{type:`button`,variant:`outline`,size:`sm`,onClick:se,className:`h-9 px-4 text-xs font-medium rounded-full border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`,children:[(0,U.jsx)(Ci,{className:`w-3.5 h-3.5 mr-1.5`}),`Pilih Foto Lain`]}),d.length>0&&(0,U.jsxs)(G,{type:`button`,size:`sm`,onClick:()=>g(!0),className:`h-9 px-4 text-xs font-medium rounded-full bg-[#0F9D58] hover:bg-[#0F9D58]/90 text-white`,children:[(0,U.jsx)(Lr,{className:`w-3.5 h-3.5 mr-1.5`}),`Simpan Hasil (`,d.length,`)`]})]})]}),(0,U.jsx)(`div`,{className:`flex items-center gap-2 py-4 overflow-x-auto`,children:ce.map(e=>{let t=e.icon;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>o(e.id),className:`flex items-center gap-2 h-8 px-4 rounded-full text-xs font-medium whitespace-nowrap transition-all border select-none ${a===e.id?`bg-[#C2E7FF] text-[#001D35] border-[#C2E7FF] dark:bg-[#004A77] dark:text-[#C2E7FF] dark:border-[#004A77]`:`bg-transparent text-[#444746] border-[#E0E3E7] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:border-[#36373A] dark:hover:bg-[#28292A]`}`,children:[(0,U.jsx)(t,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:e.label})]},e.id)})}),_?(0,U.jsx)(rk,{title:a===`compress`?`Sedang Mengecilkan Ukuran Foto...`:a===`convert`?`Sedang Mengubah Format Gambar...`:a===`resize`?`Sedang Mengubah Ukuran Gambar...`:a===`crop`?`Sedang Memotong Foto...`:`Sedang Memproses Foto...`,message:`Mohon tunggu sebentar, foto Anda sedang diproses langsung di browser secara aman.`,icon:le?.icon,iconColor:`#7248B9`}):s.length===0?(0,U.jsx)(`div`,{className:`w-full py-4 flex flex-col space-y-6`,children:(0,U.jsx)(im,{title:a===`crop`?`Pilih foto untuk dipotong atau pas foto`:`Tarik & lepaskan foto ke sini, atau pilih berkas`,description:le?.desc||`Proses gambar Anda secara otomatis dan instan di browser.`,acceptedFormats:[`JPG`,`PNG`,`WEBP`],accept:`image/*,.png,.jpg,.jpeg,.webp`,icon:le?.icon,iconColor:`#7248B9`,maxSizeText:`Auto-proses instan • 100% Privat`,multiple:a!==`crop`,onFilesSelected:ie,onOpenDrivePicker:()=>m(!0)})}):(0,U.jsxs)(`div`,{className:`grid grid-cols-1 lg:grid-cols-12 gap-5 flex-1`,children:[(0,U.jsx)(`div`,{className:`lg:col-span-8 flex flex-col space-y-4`,children:(0,U.jsx)(nm,{items:s,onAddFiles:ie,onRemoveItem:e=>c(t=>t.filter(t=>t.id!==e)),onClear:se,onOpenDrivePicker:()=>m(!0),accept:`image/*`,disabled:_,selectedIds:l,onSelectionChange:u,primaryAction:(0,U.jsx)(G,{type:`button`,size:`sm`,onClick:oe,disabled:_||l.length===0,className:`h-8 px-4 text-xs font-medium rounded-full bg-[#0B57D0] hover:bg-[#0B57D0]/90 text-white shadow-xs flex items-center gap-1.5 shrink-0`,children:_?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(oi,{className:`w-3.5 h-3.5 animate-spin`}),(0,U.jsx)(`span`,{children:`Memproses...`})]}):(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Lr,{className:`w-3.5 h-3.5`}),(0,U.jsxs)(`span`,{children:[`Unduh Hasil (`,l.length,`)`]})]})})})}),(0,U.jsx)(`div`,{className:`lg:col-span-4 flex flex-col space-y-4`,children:(0,U.jsxs)(`div`,{className:`p-4 rounded-2xl border border-[#E0E3E7] bg-white dark:border-[#36373A] dark:bg-[#1E1F20] space-y-3.5`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] block`,children:[`Pengaturan `,le?.label]}),a===`compress`&&(0,U.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,U.jsxs)(`div`,{className:`flex justify-between text-xs text-[#747775] dark:text-[#8E918F]`,children:[(0,U.jsx)(`span`,{children:`Kualitas Visual:`}),(0,U.jsxs)(`span`,{className:`font-semibold text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[Math.round(b*100),`%`]})]}),(0,U.jsx)(`input`,{type:`range`,min:`0.3`,max:`0.95`,step:`0.05`,value:b,onChange:e=>x(Number(e.target.value)),className:`w-full accent-[#0B57D0]`}),(0,U.jsxs)(`div`,{className:`flex justify-between text-[11px] text-[#747775]`,children:[(0,U.jsx)(`span`,{children:`Kompresi Maksimal`}),(0,U.jsx)(`span`,{children:`Kualitas Tinggi`})]})]}),a===`convert`&&(0,U.jsxs)(`div`,{className:`space-y-2.5`,children:[(0,U.jsx)(`label`,{className:`text-xs text-[#747775] dark:text-[#8E918F] block`,children:`Format Berkas Tujuan:`}),(0,U.jsx)(`div`,{className:`grid grid-cols-3 gap-1.5`,children:[{label:`WebP`,value:`image/webp`},{label:`PNG`,value:`image/png`},{label:`JPG`,value:`image/jpeg`}].map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>C(e.value),className:`py-1.5 text-xs font-medium rounded-lg border transition-all ${S===e.value?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9]`}`,children:e.label},e.value))}),(0,U.jsx)(`p`,{className:`text-[11px] text-[#747775] leading-relaxed`,children:`WebP menghasilkan ukuran paling hemat untuk web. PNG mempertahankan transparansi.`})]}),a===`resize`&&(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mb-1.5 block`,children:`Skala Persentase:`}),(0,U.jsx)(`div`,{className:`grid grid-cols-4 gap-1.5`,children:[25,50,75,100].map(e=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{T(e),D(``),k(``)},className:`py-1.5 text-xs font-medium rounded-lg border transition-all ${w===e&&!E&&!O?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9]`}`,children:[e,`%`]},e))})]}),(0,U.jsxs)(`div`,{className:`pt-2 border-t border-[#E0E3E7]/60 dark:border-[#36373A]/60`,children:[(0,U.jsx)(`label`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mb-1.5 block`,children:`Atau Ukuran Pixel Pasti:`}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,U.jsx)(Os,{type:`number`,placeholder:`Lebar (px)`,value:E,onChange:e=>D(e.target.value),className:`h-8 text-xs`}),(0,U.jsx)(Os,{type:`number`,placeholder:`Tinggi (px)`,value:O,onChange:e=>k(e.target.value),className:`h-8 text-xs`})]}),(0,U.jsxs)(`label`,{className:`flex items-center gap-2 mt-2 text-xs text-[#444746] dark:text-[#C4C7C5] cursor-pointer`,children:[(0,U.jsx)(`input`,{type:`checkbox`,checked:A,onChange:e=>j(e.target.checked),className:`rounded accent-[#0B57D0]`}),(0,U.jsx)(`span`,{children:`Kunci Rasio Aspek`})]})]})]}),a===`crop`&&(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mb-1.5 block`,children:`Preset Rasio Potong:`}),(0,U.jsx)(`div`,{className:`grid grid-cols-2 gap-1.5`,children:[{id:`1:1`,label:`1:1 (Persegi / Avatar)`},{id:`3:4`,label:`3:4 (Pas Foto 3x4)`},{id:`4:6`,label:`4:6 (Pas Foto 4x6)`},{id:`16:9`,label:`16:9 (Landscape / Banner)`}].map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>N(e.id),className:`p-2 text-xs font-medium rounded-xl border text-left transition-all ${M===e.id?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9]`}`,children:e.label},e.id))})]}),(0,U.jsx)(`p`,{className:`text-[11px] text-[#747775] dark:text-[#8E918F] leading-relaxed`,children:`Memotong bagian tengah foto dengan rasio aspek yang dipilih secara proporsional.`})]}),a===`watermark`&&(0,U.jsxs)(`div`,{className:`space-y-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mb-1 block`,children:`Teks Watermark:`}),(0,U.jsx)(Os,{type:`text`,value:P,onChange:e=>F(e.target.value),className:`h-8 text-xs`})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mb-1 block`,children:`Ukuran (px):`}),(0,U.jsx)(Os,{type:`number`,value:R,onChange:e=>ee(Number(e.target.value)||24),className:`h-8 text-xs`})]}),(0,U.jsxs)(`div`,{className:`flex flex-col`,children:[(0,U.jsx)(`label`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mb-1`,children:`Warna:`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-0.5`,children:[(0,U.jsx)(`input`,{type:`color`,value:te,onChange:e=>ne(e.target.value),className:`w-7 h-7 rounded-md cursor-pointer border border-[#E0E3E7] p-0.5`}),(0,U.jsx)(`span`,{className:`text-xs font-mono text-[#747775]`,children:te.toUpperCase()})]})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`label`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mb-1 block`,children:`Posisi:`}),(0,U.jsx)(`div`,{className:`grid grid-cols-3 gap-1.5`,children:[{id:`bottom-right`,label:`Kanan Bawah`},{id:`center`,label:`Tengah`},{id:`bottom-left`,label:`Kiri Bawah`}].map(e=>(0,U.jsx)(`button`,{type:`button`,onClick:()=>z(e.id),className:`py-1.5 text-[11px] font-medium rounded-lg border transition-all ${re===e.id?`border-[#0B57D0] bg-[#C2E7FF] text-[#001D35] dark:border-[#004A77] dark:bg-[#004A77] dark:text-[#C2E7FF]`:`border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9]`}`,children:e.label},e.id))})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsxs)(`label`,{className:`text-xs text-[#747775] dark:text-[#8E918F] mb-1 block`,children:[`Transparansi: `,Math.round(I*100),`%`]}),(0,U.jsx)(`input`,{type:`range`,min:`0.1`,max:`1`,step:`0.05`,value:I,onChange:e=>L(Number(e.target.value)),className:`w-full accent-[#0B57D0]`})]})]})]})})]}),(0,U.jsx)(am,{open:p,onClose:()=>m(!1),onSelectFiles:ie,acceptFilter:`image`,multiple:!0}),(0,U.jsx)(um,{open:h,onClose:()=>g(!1),files:d,defaultZipName:`9drive_${a}_hasil.zip`,toolName:`Image Studio (${le?.label})`})]})}function dk(e){let t=e.numberOfChannels,n=e.sampleRate,r=[];for(let n=0;n<t;n++)r.push(e.getChannelData(n));let i=e.length*t*2,a=new ArrayBuffer(44+i),o=new DataView(a);function s(e,t){for(let n=0;n<t.length;n++)o.setUint8(e+n,t.charCodeAt(n))}s(0,`RIFF`),o.setUint32(4,36+i,!0),s(8,`WAVE`),s(12,`fmt `),o.setUint32(16,16,!0),o.setUint16(20,1,!0),o.setUint16(22,t,!0),o.setUint32(24,n,!0),o.setUint32(28,n*t*2,!0),o.setUint16(32,t*2,!0),o.setUint16(34,16,!0),s(36,`data`),o.setUint32(40,i,!0);let c=44;for(let n=0;n<e.length;n++)for(let e=0;e<t;e++){let t=Math.max(-1,Math.min(1,r[e][n])),i=t<0?t*32768:t*32767;o.setInt16(c,i,!0),c+=2}return new Blob([o],{type:`audio/wav`})}async function fk(e){let t=await e.arrayBuffer(),n=new(window.AudioContext||window.webkitAudioContext);try{let r=await n.decodeAudioData(t);return{blob:dk(r),name:`${e.name.replace(/\.[^/.]+$/,``)}_audio.wav`,duration:r.duration}}finally{n.close()}}function pk(){let e=tt(),t=Qe(),{toast:n}=as(),[r,i]=(0,v.useState)(null),[a,o]=(0,v.useState)([]),[s,c]=(0,v.useState)(!1),[l,u]=(0,v.useState)(!1),[d,f]=(0,v.useState)(!1),[p,m]=(0,v.useState)(`Mengekstrak audio dari video...`),h=(0,v.useRef)(null),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(0),[x,S]=(0,v.useState)(0),[C,w]=(0,v.useState)(!1),[T,E]=(0,v.useState)(null);(0,v.useEffect)(()=>{if(t.state&&t.state.initialFiles){let e=t.state.initialFiles;e.length>0&&D(e)}},[t.state]),(0,v.useEffect)(()=>()=>{T&&URL.revokeObjectURL(T)},[T]);let D=async e=>{let t=e.filter(e=>e.type.startsWith(`video/`)||/\.(mp4|webm|mkv|mov|avi)$/i.test(e.name));if(t.length===0){n.error(`Pilih berkas video yang valid (MP4, WebM, MKV, MOV).`);return}let r=t[0];i(r),f(!0),m(`Mengonversi ${r.name}...`);try{let e=[];for(let n=0;n<t.length;n++){let r=t[n];m(t.length>1?`Memproses ${n+1} dari ${t.length} video (${r.name})...`:`Mengekstrak gelombang audio kualitas studio dari ${r.name}...`);let i=await fk(r);e.push({name:i.name,blob:i.blob,size:i.blob.size})}o(e),e.length>0&&(E(URL.createObjectURL(e[0].blob)),b(0),_(!1)),n.success(`Berhasil mengekstrak audio dari ${e.length} video!`)}catch(e){console.error(`Video audio extraction failed:`,e),n.error(e.message||`Gagal mengekstrak audio dari video`)}finally{f(!1)}},O=()=>{h.current&&h.current.pause(),i(null),o([]),E(null),_(!1),b(0)},k=()=>{h.current&&(g?(h.current.pause(),_(!1)):(h.current.play(),_(!0)))},A=e=>{let t=parseFloat(e.target.value);h.current&&(h.current.currentTime=t,b(t))},j=e=>{if(isNaN(e))return`0:00`;let t=Math.floor(e/60),n=Math.floor(e%60);return`${t}:${n<10?`0`:``}${n}`};return(0,U.jsxs)(`div`,{className:`flex flex-col min-h-full w-full min-w-0`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col gap-2 pb-3 border-b border-[#E0E3E7]/70 dark:border-[#36373A]/70 sm:flex-row sm:items-center sm:justify-between`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>e(`/tools`),className:`text-xl sm:text-[22px] font-normal transition-colors text-[#444746] hover:text-[#0B57D0] dark:text-[#C4C7C5]`,children:`Tools Studio`}),(0,U.jsx)(Cr,{className:`h-4 w-4 text-[#747775] shrink-0`}),(0,U.jsx)(`span`,{className:`truncate text-xl sm:text-[22px] font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Ekstrak Audio Video`})]}),a.length>0&&(0,U.jsxs)(`div`,{className:`flex items-center gap-2 sm:shrink-0 sm:justify-end`,children:[(0,U.jsxs)(G,{type:`button`,variant:`outline`,size:`sm`,onClick:O,className:`h-9 px-4 text-xs font-medium rounded-full border-[#E0E3E7] dark:border-[#36373A] text-[#444746] dark:text-[#C4C7C5] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A]`,children:[(0,U.jsx)(Ci,{className:`w-3.5 h-3.5 mr-1.5`}),`Ekstrak Video Lain`]}),(0,U.jsxs)(G,{type:`button`,size:`sm`,onClick:()=>u(!0),className:`h-9 px-4 text-xs font-medium rounded-full bg-[#0B57D0] hover:bg-[#0842A0] text-white shadow-xs`,children:[(0,U.jsx)(jr,{className:`w-3.5 h-3.5 mr-1.5`}),`Simpan ke 9Drive`]})]})]}),(0,U.jsxs)(`div`,{className:`w-full py-4 flex flex-col space-y-6`,children:[!r&&!d&&a.length===0&&(0,U.jsx)(im,{title:`Tarik & lepaskan video ke sini, atau pilih berkas`,description:`Otomatis mengekstrak audio studio (16-bit PCM WAV) dari rekaman video MP4, WebM, atau MOV Anda secara instan di browser.`,acceptedFormats:[`MP4`,`MOV`,`WEBM`,`MKV`],accept:`video/*,.mp4,.webm,.mkv,.mov`,icon:Bc,iconColor:`#FA7B17`,maxSizeText:`Tanpa batas kuota • 100% Privat`,multiple:!0,onFilesSelected:D,onOpenDrivePicker:()=>c(!0)}),d&&(0,U.jsxs)(`div`,{className:`flex flex-col items-center justify-center p-12 sm:p-16 rounded-3xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] text-center space-y-5 animate-pulse`,children:[(0,U.jsx)(`div`,{className:`w-16 h-16 rounded-2xl bg-[#FEF7E0] dark:bg-[#7C4A00]/30 text-[#B06000] dark:text-[#FDD663] flex items-center justify-center`,children:(0,U.jsx)(oi,{className:`w-8 h-8 animate-spin`})}),(0,U.jsxs)(`div`,{className:`space-y-1.5 max-w-md`,children:[(0,U.jsx)(`h3`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:p}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F]`,children:`Mengambil suara dari video langsung di perangkat Anda tanpa diunggah ke internet.`})]}),(0,U.jsx)(`div`,{className:`w-full max-w-sm h-1.5 rounded-full bg-[#E0E3E7] dark:bg-[#36373A] overflow-hidden`,children:(0,U.jsx)(`div`,{className:`h-full bg-[#0B57D0] rounded-full animate-[progress_1.5s_ease-in-out_infinite]`})})]}),!d&&a.length>0&&(0,U.jsxs)(`div`,{className:`rounded-3xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] p-6 sm:p-8 space-y-6 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4 pb-6 border-b border-[#E0E3E7]/60 dark:border-[#36373A]/60`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,U.jsx)(`div`,{className:`w-12 h-12 rounded-xl bg-[#FEF7E0] dark:bg-[#7C4A00]/30 text-[#B06000] dark:text-[#FDD663] flex items-center justify-center shrink-0`,children:(0,U.jsx)(Ur,{className:`w-6 h-6`})}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`h3`,{className:`text-base font-medium text-[#1F1F1F] dark:text-[#E3E3E3] truncate max-w-md`,children:a[0].name}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-[#747775] dark:text-[#8E918F] mt-0.5`,children:[(0,U.jsx)(`span`,{children:wo(a[0].size||0)}),(0,U.jsx)(`span`,{children:`•`}),(0,U.jsxs)(`span`,{className:`text-[#0F9D58] dark:text-[#81C995] font-medium flex items-center gap-1`,children:[(0,U.jsx)(ji,{className:`w-3 h-3`}),`16-bit Stereo PCM WAV`]})]})]})]}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2.5`,children:[(0,U.jsxs)(G,{type:`button`,variant:`outline`,onClick:()=>sm(a[0].blob,a[0].name),className:`h-10 px-4 rounded-full text-xs font-medium border-[#E0E3E7] dark:border-[#36373A] hover:bg-[#F0F4F9] dark:hover:bg-[#28292A] text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[(0,U.jsx)(Lr,{className:`w-4 h-4 mr-1.5`}),`Unduh WAV`]}),(0,U.jsxs)(G,{type:`button`,onClick:()=>u(!0),className:`h-10 px-5 rounded-full text-xs font-medium bg-[#0B57D0] hover:bg-[#0842A0] text-white shadow-xs`,children:[(0,U.jsx)(jr,{className:`w-4 h-4 mr-1.5`}),`Simpan ke 9Drive`]})]})]}),T&&(0,U.jsxs)(`div`,{className:`p-5 rounded-2xl bg-[#F8FAFD] dark:bg-[#28292A] border border-[#E0E3E7] dark:border-[#36373A] space-y-3`,children:[(0,U.jsx)(`audio`,{ref:h,src:T,onTimeUpdate:()=>{h.current&&b(h.current.currentTime)},onLoadedMetadata:()=>{h.current&&S(h.current.duration)},onEnded:()=>_(!1),className:`hidden`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-4`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:k,"aria-label":g?`Pause`:`Play`,className:`w-12 h-12 rounded-full bg-[#0B57D0] hover:bg-[#0842A0] text-white flex items-center justify-center shrink-0 shadow-xs transition-transform active:scale-95`,children:g?(0,U.jsx)(vi,{className:`w-5 h-5`}):(0,U.jsx)(bi,{className:`w-5 h-5 ml-0.5`})}),(0,U.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,U.jsx)(`input`,{type:`range`,min:0,max:x||100,step:.1,value:y,onChange:A,className:`w-full h-1.5 bg-[#E0E3E7] dark:bg-[#36373A] rounded-lg appearance-none cursor-pointer accent-[#0B57D0]`}),(0,U.jsxs)(`div`,{className:`flex justify-between text-[11px] text-[#747775] dark:text-[#8E918F] font-mono`,children:[(0,U.jsx)(`span`,{children:j(y)}),(0,U.jsx)(`span`,{children:j(x)})]})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>{h.current&&(h.current.muted=!C,w(!C))},className:`w-9 h-9 rounded-full hover:bg-black/5 dark:hover:bg-white/10 flex items-center justify-center text-[#747775] dark:text-[#8E918F]`,children:C?(0,U.jsx)(Vi,{className:`w-4 h-4`}):(0,U.jsx)(Bi,{className:`w-4 h-4`})})]})]}),a.length>1&&(0,U.jsxs)(`div`,{className:`space-y-2 pt-2`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:[`Semua Berkas Hasil Ekstraksi (`,a.length,`)`]}),(0,U.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-2`,children:a.map((e,t)=>(0,U.jsxs)(`div`,{className:`flex items-center justify-between p-3 rounded-xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2 truncate`,children:[(0,U.jsx)(Ur,{className:`w-4 h-4 text-[#0B57D0] shrink-0`}),(0,U.jsx)(`span`,{className:`text-xs text-[#1F1F1F] dark:text-[#E3E3E3] truncate`,children:e.name})]}),(0,U.jsx)(`button`,{type:`button`,onClick:()=>sm(e.blob,e.name),className:`text-xs text-[#0B57D0] hover:underline shrink-0 ml-2`,children:`Unduh`})]},t))})]})]}),(0,U.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-4 pt-4`,children:[(0,U.jsxs)(`div`,{className:`p-4 rounded-2xl border border-[#E0E3E7] bg-white dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5 mb-1`,children:[(0,U.jsx)(gi,{className:`w-4 h-4 text-[#FA7B17]`}),`Suara Jernih (.WAV)`]}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] leading-relaxed`,children:`Hasil suara jernih dan utuh tanpa penurunan kualitas, siap diputar atau dipindahkan.`})]}),(0,U.jsxs)(`div`,{className:`p-4 rounded-2xl border border-[#E0E3E7] bg-white dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5 mb-1`,children:[(0,U.jsx)(ji,{className:`w-4 h-4 text-[#0B57D0] dark:text-[#A8C7FA]`}),`Privat & Tanpa Internet`]}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] leading-relaxed`,children:`Video diproses langsung di perangkat Anda tanpa diunggah ke server mana pun.`})]}),(0,U.jsxs)(`div`,{className:`p-4 rounded-2xl border border-[#E0E3E7] bg-white dark:border-[#36373A] dark:bg-[#1E1F20]`,children:[(0,U.jsxs)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3] flex items-center gap-1.5 mb-1`,children:[(0,U.jsx)(jr,{className:`w-4 h-4 text-[#0F9D58]`}),`Integrasi Cloud 9Drive`]}),(0,U.jsx)(`p`,{className:`text-xs text-[#747775] dark:text-[#8E918F] leading-relaxed`,children:`Simpan langsung ke folder cloud Drive atau unduh berkas .WAV ke perangkat lokal.`})]})]})]}),(0,U.jsx)(am,{open:s,onClose:()=>c(!1),onSelectFiles:D,acceptFilter:`video`}),(0,U.jsx)(um,{open:l,onClose:()=>u(!1),files:a,defaultZipName:`extracted_audio.zip`})]})}function mk(e){let t=e.trim().split(/\r\n|\n/);if(t.length<2)return`[]`;let n=t[0].split(`,`).map(e=>e.trim().replace(/^["']|["']$/g,``)),r=[];for(let e=1;e<t.length;e++){let i=t[e].trim();if(!i)continue;let a={},o=i.split(`,`).map(e=>e.trim().replace(/^["']|["']$/g,``));n.forEach((e,t)=>{a[e]=o[t]??``}),r.push(a)}return JSON.stringify(r,null,2)}function hk(e){let t=JSON.parse(e);if(!Array.isArray(t)||t.length===0)return``;let n=Object.keys(t[0]),r=[];r.push(n.join(`,`));for(let e of t){let t=n.map(t=>`"${(``+(e[t]??``)).replace(/"/g,`""`)}"`);r.push(t.join(`,`))}return r.join(`
|
|
133
|
+
`)}async function gk(e,t=`SHA-256`){let n=await e.arrayBuffer(),r=await crypto.subtle.digest(t,n);return Array.from(new Uint8Array(r)).map(e=>e.toString(16).padStart(2,`0`)).join(``)}function _k(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result),r.onerror=e=>n(e),r.readAsDataURL(e)})}function vk(){let e=tt(),[t,n]=Fn(),{toast:r}=as(),i=t.get(`mode`)||`csv-json`,a=e=>{n({mode:e})},[o,s]=(0,v.useState)(`name,email,role
|
|
134
|
+
Alice,alice@example.com,Admin
|
|
135
|
+
Bob,bob@example.com,Editor`),[c,l]=(0,v.useState)(``),[u,d]=(0,v.useState)(null),[f,p]=(0,v.useState)(``),[m,h]=(0,v.useState)(``),[g,_]=(0,v.useState)(!1),[y,b]=(0,v.useState)(null),[x,S]=(0,v.useState)(``),C=()=>{try{l(mk(o)),r.success(`Berhasil mengubah CSV ke JSON!`)}catch{r.error(`Format CSV tidak valid`)}},w=()=>{try{s(hk(c||o)),r.success(`Berhasil mengubah JSON ke CSV!`)}catch{r.error(`Format JSON array tidak valid`)}},T=async e=>{if(e.target.files&&e.target.files[0]){let t=e.target.files[0];d(t),_(!0);try{let e=await gk(t,`SHA-256`),n=await gk(t,`SHA-1`);p(e),h(n)}catch{r.error(`Gagal menghitung hash`)}finally{_(!1)}}},E=async e=>{if(e.target.files&&e.target.files[0]){let t=e.target.files[0];b(t);try{S(await _k(t)),r.success(`Data URI Base64 berhasil dibuat!`)}catch{r.error(`Gagal mengonversi file`)}}},D=(e,t)=>{navigator.clipboard.writeText(e),r.success(`${t} disalin ke clipboard!`)},O=[{id:`csv-json`,label:`CSV ⇄ JSON Converter`,icon:Hr},{id:`hash`,label:`File Hash & Checksum`,icon:Gr},{id:`base64`,label:`Base64 Encoder`,icon:yr}],k=O.find(e=>e.id===i);return(0,U.jsxs)(`div`,{className:`flex flex-col min-h-full w-full min-w-0`,children:[(0,U.jsx)(`div`,{className:`flex flex-col gap-2 pb-3 border-b border-[#E0E3E7]/70 dark:border-[#36373A]/70 sm:flex-row sm:items-center sm:justify-between`,children:(0,U.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,U.jsx)(`button`,{type:`button`,onClick:()=>e(`/tools`),className:`text-xl sm:text-[22px] font-normal transition-colors text-[#444746] hover:text-[#0B57D0] dark:text-[#C4C7C5]`,children:`Tools Studio`}),(0,U.jsx)(Cr,{className:`h-4 w-4 text-[#747775] shrink-0`}),(0,U.jsx)(`span`,{className:`truncate text-xl sm:text-[22px] font-normal text-[#1F1F1F] dark:text-[#E3E3E3]`,children:k?.label})]})}),(0,U.jsx)(`div`,{className:`flex items-center gap-2 py-4 overflow-x-auto`,children:O.map(e=>{let t=e.icon;return(0,U.jsxs)(`button`,{type:`button`,onClick:()=>a(e.id),className:`flex items-center gap-2 h-8 px-4 rounded-full text-xs font-medium whitespace-nowrap transition-all border select-none ${i===e.id?`bg-[#C2E7FF] text-[#001D35] border-[#C2E7FF] dark:bg-[#004A77] dark:text-[#C2E7FF] dark:border-[#004A77]`:`bg-transparent text-[#444746] border-[#E0E3E7] hover:bg-[#F0F4F9] dark:text-[#C4C7C5] dark:border-[#36373A] dark:hover:bg-[#28292A]`}`,children:[(0,U.jsx)(t,{className:`w-3.5 h-3.5`}),(0,U.jsx)(`span`,{children:e.label})]},e.id)})}),(0,U.jsxs)(`div`,{className:`flex-1 mt-1`,children:[i===`csv-json`&&(0,U.jsxs)(`div`,{className:`grid grid-cols-1 md:grid-cols-2 gap-4`,children:[(0,U.jsxs)(`div`,{className:`flex flex-col space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Input CSV:`}),(0,U.jsx)(G,{size:`sm`,variant:`outline`,onClick:C,className:`h-7 text-xs rounded-lg`,children:`Konversi ke JSON →`})]}),(0,U.jsx)(`textarea`,{value:o,onChange:e=>s(e.target.value),className:`w-full h-80 p-3 text-xs font-mono rounded-xl border border-[#E0E3E7] dark:border-[#36373A] bg-white dark:bg-[#1E1F20] text-[#1F1F1F] dark:text-[#E3E3E3] resize-none focus:outline-none focus:ring-2 focus:ring-[#0B57D0]`})]}),(0,U.jsxs)(`div`,{className:`flex flex-col space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Output JSON:`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,U.jsx)(G,{size:`sm`,variant:`outline`,onClick:w,className:`h-7 text-xs rounded-lg`,children:`← Konversi ke CSV`}),(0,U.jsx)(G,{size:`sm`,variant:`outline`,onClick:()=>D(c,`JSON`),disabled:!c,className:`h-7 text-xs rounded-lg`,children:(0,U.jsx)(Nr,{className:`w-3.5 h-3.5`})})]})]}),(0,U.jsx)(`textarea`,{value:c,onChange:e=>l(e.target.value),placeholder:`Klik tombol konversi untuk melihat hasil...`,className:`w-full h-80 p-3 text-xs font-mono rounded-xl border border-[#E0E3E7] dark:border-[#36373A] bg-[#F8FAFD] dark:bg-[#18191A] text-[#1F1F1F] dark:text-[#E3E3E3] resize-none focus:outline-none focus:ring-2 focus:ring-[#0B57D0]`})]})]}),i===`hash`&&(0,U.jsxs)(`div`,{className:`max-w-2xl mx-auto space-y-4`,children:[(0,U.jsxs)(`label`,{className:`flex flex-col items-center justify-center p-8 border border-dashed border-[#E0E3E7] dark:border-[#36373A] rounded-2xl bg-[#F8FAFD] dark:bg-[#1E1F20] cursor-pointer hover:border-[#0B57D0] transition-colors text-center`,children:[(0,U.jsx)(`input`,{type:`file`,onChange:T,className:`hidden`}),g?(0,U.jsx)(oi,{className:`w-8 h-8 animate-spin text-[#0B57D0] mb-2`}):(0,U.jsx)(Gr,{className:`w-8 h-8 text-[#0B57D0] mb-2`}),(0,U.jsx)(`p`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:u?u.name:`Pilih atau drop berkas apa saja untuk menghitung hash`}),(0,U.jsx)(`p`,{className:`text-[11px] text-[#747775] mt-1`,children:g?`Sedang menghitung hash...`:`Dihitung secara aman langsung di browser`})]}),f&&(0,U.jsxs)(`div`,{className:`p-4 rounded-2xl bg-white dark:bg-[#1E1F20] border border-[#E0E3E7] dark:border-[#36373A] space-y-3`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[11px] font-semibold text-[#747775] uppercase`,children:`SHA-256:`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[(0,U.jsx)(`code`,{className:`text-xs font-mono bg-[#F0F4F9] dark:bg-[#28292A] p-2 rounded-lg flex-1 break-all select-all text-[#1F1F1F] dark:text-[#E3E3E3]`,children:f}),(0,U.jsx)(G,{size:`sm`,variant:`outline`,onClick:()=>D(f,`SHA-256`),children:(0,U.jsx)(Nr,{className:`w-3.5 h-3.5`})})]})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{className:`text-[11px] font-semibold text-[#747775] uppercase`,children:`SHA-1:`}),(0,U.jsxs)(`div`,{className:`flex items-center gap-2 mt-1`,children:[(0,U.jsx)(`code`,{className:`text-xs font-mono bg-[#F0F4F9] dark:bg-[#28292A] p-2 rounded-lg flex-1 break-all select-all text-[#1F1F1F] dark:text-[#E3E3E3]`,children:m}),(0,U.jsx)(G,{size:`sm`,variant:`outline`,onClick:()=>D(m,`SHA-1`),children:(0,U.jsx)(Nr,{className:`w-3.5 h-3.5`})})]})]})]})]}),i===`base64`&&(0,U.jsxs)(`div`,{className:`max-w-2xl mx-auto space-y-4`,children:[(0,U.jsxs)(`label`,{className:`flex flex-col items-center justify-center p-8 border border-dashed border-[#E0E3E7] dark:border-[#36373A] rounded-2xl bg-[#F8FAFD] dark:bg-[#1E1F20] cursor-pointer hover:border-[#0B57D0] transition-colors text-center`,children:[(0,U.jsx)(`input`,{type:`file`,onChange:E,className:`hidden`}),(0,U.jsx)(yr,{className:`w-8 h-8 text-[#0B57D0] mb-2`}),(0,U.jsx)(`p`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:y?y.name:`Pilih berkas atau foto untuk di-encode ke Base64`}),(0,U.jsx)(`p`,{className:`text-[11px] text-[#747775] mt-1`,children:`Berguna untuk data URI gambar pada HTML/CSS`})]}),x&&(0,U.jsxs)(`div`,{className:`p-4 rounded-2xl bg-white dark:bg-[#1E1F20] border border-[#E0E3E7] dark:border-[#36373A] space-y-2`,children:[(0,U.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,U.jsx)(`span`,{className:`text-xs font-medium text-[#1F1F1F] dark:text-[#E3E3E3]`,children:`Hasil Base64:`}),(0,U.jsxs)(G,{size:`sm`,variant:`outline`,onClick:()=>D(x,`Base64`),children:[(0,U.jsx)(Nr,{className:`w-3.5 h-3.5 mr-1.5`}),`Salin`]})]}),(0,U.jsx)(`textarea`,{readOnly:!0,value:x,className:`w-full h-40 p-3 text-xs font-mono rounded-xl bg-[#F8FAFD] dark:bg-[#18191A] border border-[#E0E3E7] dark:border-[#36373A] text-[#1F1F1F] dark:text-[#E3E3E3] resize-none select-all focus:outline-none`})]})]})]})]})}function yk(){return(0,U.jsx)(Po,{children:(0,U.jsx)(is,{children:(0,U.jsx)(ko,{children:(0,U.jsx)(Ho,{children:(0,U.jsxs)(Pt,{children:[(0,U.jsx)(Mt,{path:`login`,element:(0,U.jsx)(qs,{})}),(0,U.jsx)(Mt,{path:`register`,element:(0,U.jsx)(cc,{})}),(0,U.jsx)(Mt,{path:`google-auth`,element:(0,U.jsx)(Ys,{})}),(0,U.jsx)(Mt,{path:`google-connected`,element:(0,U.jsx)(Xs,{})}),(0,U.jsx)(Mt,{path:`public/files/:token`,element:(0,U.jsx)(xc,{})}),(0,U.jsx)(Mt,{path:`public/files/:token/embed`,element:(0,U.jsx)(xc,{embed:!0})}),(0,U.jsx)(Mt,{element:(0,U.jsx)(rr,{}),children:(0,U.jsxs)(Mt,{element:(0,U.jsx)($o,{}),children:[(0,U.jsx)(Mt,{index:!0,element:(0,U.jsx)(At,{to:`/all-files`,replace:!0})}),(0,U.jsx)(Mt,{path:`all-files`,element:(0,U.jsx)(Us,{})}),(0,U.jsx)(Mt,{path:`tools`,element:(0,U.jsx)(Hc,{})}),(0,U.jsx)(Mt,{path:`tools/remove-bg`,element:(0,U.jsx)(dm,{})}),(0,U.jsx)(Mt,{path:`tools/pdf`,element:(0,U.jsx)(ik,{})}),(0,U.jsx)(Mt,{path:`tools/image`,element:(0,U.jsx)(uk,{})}),(0,U.jsx)(Mt,{path:`tools/video`,element:(0,U.jsx)(pk,{})}),(0,U.jsx)(Mt,{path:`tools/data`,element:(0,U.jsx)(vk,{})}),(0,U.jsx)(Mt,{path:`quota`,element:(0,U.jsx)(rc,{})}),(0,U.jsx)(Mt,{path:`shared`,element:(0,U.jsx)(hc,{})}),(0,U.jsx)(Mt,{path:`recent`,element:(0,U.jsx)(oc,{})}),(0,U.jsx)(Mt,{path:`starred`,element:(0,U.jsx)(vc,{})}),(0,U.jsx)(Mt,{path:`archived`,element:(0,U.jsx)(Gs,{})}),(0,U.jsx)(Mt,{path:`trash`,element:(0,U.jsx)(Cc,{})}),(0,U.jsx)(Mt,{path:`activity`,element:(0,U.jsx)(wc,{})}),(0,U.jsx)(Mt,{path:`settings`,element:(0,U.jsx)(fc,{})}),(0,U.jsx)(Mt,{path:`api`,element:(0,U.jsx)(Sc,{})})]})}),(0,U.jsx)(Mt,{path:`*`,element:(0,U.jsx)(At,{to:`/all-files`,replace:!0})})]})})})})})}(0,y.createRoot)(document.getElementById(`root`)).render((0,U.jsx)(v.StrictMode,{children:(0,U.jsx)(wn,{children:(0,U.jsx)(yk,{})})}));export{l as n,C as t};
|